aboutsummaryrefslogtreecommitdiffstats
path: root/test/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build65
1 files changed, 62 insertions, 3 deletions
diff --git a/test/meson.build b/test/meson.build
index bd838f3..a50b6c7 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,3 +1,38 @@
+# Suppress some additional C warnings in tests
+test_c_args = []
+if get_option('strict')
+ if cc.get_id() == 'clang'
+ test_c_args += [
+ '-Wno-float-equal',
+ ]
+ elif cc.get_id() == 'gcc'
+ test_c_args += [
+ '-Wno-float-equal',
+ ]
+ endif
+
+ test_c_args = cc.get_supported_arguments(test_c_args)
+endif
+
+# Suppress some additional C++ warnings in tests
+test_cpp_args = []
+if get_option('strict') and is_variable('cpp')
+ if cpp.get_id() == 'clang'
+ test_cpp_args += [
+ '-Wno-documentation', # Cairo
+ '-Wno-documentation-unknown-command', # Cairo
+ '-Wno-old-style-cast',
+ '-Wno-padded',
+ ]
+ elif cpp.get_id() == 'gcc'
+ test_cpp_args += [
+ '-Wno-padded',
+ ]
+ endif
+
+ test_cpp_args = cpp.get_supported_arguments(test_cpp_args)
+endif
+
basic_tests = [
'local_copy_paste',
'realize',
@@ -35,6 +70,7 @@ includes = [
foreach test : basic_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, stub_backend_dep]))
endforeach
@@ -43,6 +79,7 @@ if opengl_dep.found()
foreach test : gl_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, gl_backend_dep]))
endforeach
@@ -52,6 +89,7 @@ if cairo_dep.found()
foreach test : cairo_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, cairo_backend_dep]))
endforeach
@@ -61,6 +99,8 @@ if vulkan_dep.found()
foreach test : vulkan_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
+ cpp_args: test_cpp_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, vulkan_backend_dep]))
endforeach
@@ -88,14 +128,33 @@ if host_machine.system() == 'darwin'
objcpp = meson.get_compiler('objcpp')
unified_args += objcpp.get_supported_arguments(
- c_warnings + cpp_warnings + objc_warnings)
+ c_warnings + test_cpp_args + objc_warnings)
executable('inline_objcpp', 'test_inline_objcpp.mm',
include_directories: include_directories(includes),
dependencies: unified_deps,
objcpp_args: unified_args)
+
elif is_variable('cpp')
- if cpp.get_id() == 'msvc'
+ unified_args = []
+
+ if cpp.get_id() == 'clang'
+ unified_args += [
+ '-Wno-old-style-cast',
+ '-Wno-reserved-id-macro',
+ '-Wno-switch-default',
+ '-Wno-switch-enum',
+ '-Wno-unused-macros', # Mac
+ ]
+ elif cpp.get_id() == 'gcc'
+ unified_args += [
+ '-Wno-conditionally-supported',
+ '-Wno-old-style-cast',
+ '-Wno-switch-default',
+ '-Wno-switch-enum',
+ '-Wno-useless-cast',
+ ]
+ elif cpp.get_id() == 'msvc'
unified_args += [
'/wd4464' # relative include path contains '..'
]
@@ -104,5 +163,5 @@ elif is_variable('cpp')
executable('inline_cpp', 'test_inline_cpp.cpp',
include_directories: include_directories(includes),
dependencies: unified_deps,
- cpp_args: unified_args)
+ cpp_args: test_cpp_args + unified_args)
endif