aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-03-29 22:52:14 +0300
committerGitHub <noreply@github.com>2017-03-29 22:52:14 +0300
commit571451b521822aea71b8fe154217fc9a5ecfa005 (patch)
treefbf680b8ca7e52ce83a55f6fbb71244060e74a57 /test cases
parent8cc89e468d4d8cfcafe7afd8884d9884d2aac751 (diff)
parent87f35d71184722aede59516f31de50411892599b (diff)
downloadmeson-571451b521822aea71b8fe154217fc9a5ecfa005.zip
meson-571451b521822aea71b8fe154217fc9a5ecfa005.tar.gz
meson-571451b521822aea71b8fe154217fc9a5ecfa005.tar.bz2
Merge pull request #1346 from msink/test-mingw
appveyor: run tests against MSYS2-MinGW
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/127 cpp and asm/meson.build5
-rw-r--r--test cases/common/127 cpp and asm/symbol-underscore.h2
-rw-r--r--test cases/common/135 generated assembly/square-arm.S.in3
-rw-r--r--test cases/common/135 generated assembly/square-x86.S.in3
-rw-r--r--test cases/common/135 generated assembly/square-x86_64.S.in5
-rw-r--r--test cases/windows/5 resources/inc/meson.build1
-rw-r--r--test cases/windows/5 resources/inc/resource/resource.h (renamed from test cases/windows/5 resources/inc/resource.h)0
-rw-r--r--test cases/windows/5 resources/meson.build65
-rw-r--r--test cases/windows/5 resources/res/meson.build4
-rw-r--r--test cases/windows/5 resources/res/myres.rc (renamed from test cases/windows/5 resources/myres.rc)0
-rw-r--r--test cases/windows/5 resources/res/sample.ico (renamed from test cases/windows/5 resources/sample.ico)bin9662 -> 9662 bytes
11 files changed, 78 insertions, 10 deletions
diff --git a/test cases/common/127 cpp and asm/meson.build b/test cases/common/127 cpp and asm/meson.build
index ac7adb3..9160775 100644
--- a/test cases/common/127 cpp and asm/meson.build
+++ b/test cases/common/127 cpp and asm/meson.build
@@ -1,5 +1,6 @@
project('c++ and assembly test', 'cpp')
+cpp = meson.get_compiler('cpp')
cpu = host_machine.cpu_family()
supported_cpus = ['arm', 'x86', 'x86_64']
@@ -8,6 +9,10 @@ if not supported_cpus.contains(cpu)
error('MESON_SKIP_TEST unsupported cpu:' + cpu)
endif
+if cpp.symbols_have_underscore_prefix()
+ add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'cpp')
+endif
+
sources = ['trivial.cc']
# If the compiler cannot compile assembly, don't use it
if meson.get_compiler('cpp').get_id() != 'msvc'
diff --git a/test cases/common/127 cpp and asm/symbol-underscore.h b/test cases/common/127 cpp and asm/symbol-underscore.h
index 508cf50..d0f3ef9 100644
--- a/test cases/common/127 cpp and asm/symbol-underscore.h
+++ b/test cases/common/127 cpp and asm/symbol-underscore.h
@@ -1,4 +1,4 @@
-#if defined(__WIN32__) || defined(__APPLE__)
+#if defined(MESON_TEST__UNDERSCORE_SYMBOL)
# define SYMBOL_NAME(name) _##name
#else
# define SYMBOL_NAME(name) name
diff --git a/test cases/common/135 generated assembly/square-arm.S.in b/test cases/common/135 generated assembly/square-arm.S.in
index b13c8a0..168c980 100644
--- a/test cases/common/135 generated assembly/square-arm.S.in
+++ b/test cases/common/135 generated assembly/square-arm.S.in
@@ -2,7 +2,8 @@
.text
.globl SYMBOL_NAME(square_unsigned)
-#ifndef __APPLE__
+/* Only supported on Linux with GAS */
+# ifdef __linux__
.type square_unsigned,%function
#endif
diff --git a/test cases/common/135 generated assembly/square-x86.S.in b/test cases/common/135 generated assembly/square-x86.S.in
index 31688b1..19dd9f5 100644
--- a/test cases/common/135 generated assembly/square-x86.S.in
+++ b/test cases/common/135 generated assembly/square-x86.S.in
@@ -21,7 +21,8 @@ END
.text
.globl SYMBOL_NAME(square_unsigned)
-# ifndef __APPLE__
+/* Only supported on Linux with GAS */
+# ifdef __linux__
.type square_unsigned,@function
# endif
diff --git a/test cases/common/135 generated assembly/square-x86_64.S.in b/test cases/common/135 generated assembly/square-x86_64.S.in
index 5aedd81..b6d7fb0 100644
--- a/test cases/common/135 generated assembly/square-x86_64.S.in
+++ b/test cases/common/135 generated assembly/square-x86_64.S.in
@@ -1,7 +1,5 @@
#include "symbol-underscore.h"
-#include "symbol-underscore.h"
-
#ifdef _MSC_VER /* MSVC on Windows */
PUBLIC SYMBOL_NAME(square_unsigned)
@@ -20,7 +18,8 @@ END
.text
.globl SYMBOL_NAME(square_unsigned)
-# ifndef __APPLE__
+/* Only supported on Linux with GAS */
+# ifdef __linux__
.type square_unsigned,@function
# endif
diff --git a/test cases/windows/5 resources/inc/meson.build b/test cases/windows/5 resources/inc/meson.build
new file mode 100644
index 0000000..b8b511a
--- /dev/null
+++ b/test cases/windows/5 resources/inc/meson.build
@@ -0,0 +1 @@
+inc = include_directories('resource')
diff --git a/test cases/windows/5 resources/inc/resource.h b/test cases/windows/5 resources/inc/resource/resource.h
index dbdd509..dbdd509 100644
--- a/test cases/windows/5 resources/inc/resource.h
+++ b/test cases/windows/5 resources/inc/resource/resource.h
diff --git a/test cases/windows/5 resources/meson.build b/test cases/windows/5 resources/meson.build
index 3c13634..e92a43c 100644
--- a/test cases/windows/5 resources/meson.build
+++ b/test cases/windows/5 resources/meson.build
@@ -1,9 +1,66 @@
project('winmain', 'c')
-win = import('windows')
-res = win.compile_resources('myres.rc',
- include_directories : include_directories('inc')
-)
+# MinGW windres has a bug due to which it doesn't parse args with space properly:
+# https://github.com/mesonbuild/meson/pull/1346
+# https://sourceware.org/bugzilla/show_bug.cgi?id=4933
+if meson.get_compiler('c').get_id() == 'gcc'
+ # Construct build_to_src and skip this test if it has spaces
+ # because then the -I flag to windres will also have spaces
+ # and we know the test will fail
+ src_parts = meson.source_root().split('/')
+ build_parts = meson.build_root().split('/')
+
+ # Get the common path (which might just be '/' or 'C:/')
+ common = []
+ done = false
+ count = 0
+ if src_parts.length() > build_parts.length()
+ parts = build_parts
+ other = src_parts
+ else
+ parts = src_parts
+ other = build_parts
+ endif
+ foreach part : parts
+ if not done and part == other.get(count)
+ common += [part]
+ else
+ done = true
+ endif
+ count += 1
+ endforeach
+
+ # Create path components to go down from the build root to the common path
+ count = 0
+ rel = build_parts
+ foreach build : build_parts
+ if count < build_parts.length() - common.length()
+ rel += ['..']
+ endif
+ count += 1
+ endforeach
+
+ # Create path components to go up from the common path to the build root
+ count = 0
+ foreach src : src_parts
+ if count >= common.length()
+ rel += [src]
+ endif
+ count += 1
+ endforeach
+
+ build_to_src = '/'.join(rel)
+
+ if build_to_src.contains(' ')
+ message('build_to_src is: ' + build_to_src)
+ error('MESON_SKIP_TEST build_to_src has spaces')
+ endif
+ # Welcome to the end of this conditional.
+ # We hope you never have to implement something like this.
+endif
+
+subdir('inc')
+subdir('res')
exe = executable('prog', 'prog.c',
res,
diff --git a/test cases/windows/5 resources/res/meson.build b/test cases/windows/5 resources/res/meson.build
new file mode 100644
index 0000000..184854e
--- /dev/null
+++ b/test cases/windows/5 resources/res/meson.build
@@ -0,0 +1,4 @@
+win = import('windows')
+
+res = win.compile_resources('myres.rc',
+ include_directories : inc)
diff --git a/test cases/windows/5 resources/myres.rc b/test cases/windows/5 resources/res/myres.rc
index 802bc7b..802bc7b 100644
--- a/test cases/windows/5 resources/myres.rc
+++ b/test cases/windows/5 resources/res/myres.rc
diff --git a/test cases/windows/5 resources/sample.ico b/test cases/windows/5 resources/res/sample.ico
index 24bd3d9..24bd3d9 100644
--- a/test cases/windows/5 resources/sample.ico
+++ b/test cases/windows/5 resources/res/sample.ico
Binary files differ