aboutsummaryrefslogtreecommitdiffstats
path: root/test/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build130
1 files changed, 20 insertions, 110 deletions
diff --git a/test/meson.build b/test/meson.build
index 791cf04..f047ff0 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,4 +1,4 @@
-# Copyright 2021-2023 David Robillard <d@drobilla.net>
+# Copyright 2021-2025 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR ISC
# Suppress some additional C warnings in tests
@@ -17,20 +17,6 @@ if get_option('warning_level') == 'everything'
test_c_args = cc.get_supported_arguments(test_c_args)
endif
-# Suppress some additional C++ warnings in tests
-test_cpp_args = []
-if get_option('warning_level') == 'everything' and is_variable('cpp')
- if cpp.get_id() == 'clang'
- test_cpp_args += [
- '-Wno-documentation', # Cairo
- '-Wno-documentation-unknown-command', # Cairo
- '-Wno-old-style-cast',
- ]
- endif
-
- test_cpp_args = cpp.get_supported_arguments(test_cpp_args)
-endif
-
# Check licensing metadata
if not meson.is_subproject() and get_option('lint')
reuse = find_program('reuse', required: false)
@@ -70,11 +56,6 @@ if with_timers
basic_tests += ['timer']
endif
-includes = [
- '.',
- '../include',
-]
-
foreach test : basic_tests
test(
test,
@@ -82,8 +63,8 @@ foreach test : basic_tests
'test_' + test,
'test_@0@.c'.format(test),
c_args: test_c_args,
- dependencies: [pugl_dep, pugl_stub_dep],
- include_directories: include_directories(includes),
+ dependencies: [pugl_dep, pugl_stub_dep, puglutil_dep],
+ implicit_include_directories: false,
),
suite: 'unit',
)
@@ -96,8 +77,8 @@ foreach test : basic_exclusive_tests
'test_' + test,
'test_@0@.c'.format(test),
c_args: test_c_args,
- dependencies: [pugl_dep, pugl_stub_dep],
- include_directories: include_directories(includes),
+ dependencies: [pugl_dep, pugl_stub_dep, puglutil_dep],
+ implicit_include_directories: false,
),
is_parallel: false,
suite: 'unit',
@@ -112,8 +93,8 @@ if opengl_dep.found()
'test_' + test,
'test_@0@.c'.format(test),
c_args: test_c_args,
- dependencies: [pugl_dep, pugl_gl_dep],
- include_directories: include_directories(includes),
+ dependencies: [pugl_dep, pugl_gl_dep, puglutil_dep],
+ implicit_include_directories: false,
),
suite: 'unit',
)
@@ -128,8 +109,8 @@ if cairo_dep.found()
'test_' + test,
'test_@0@.c'.format(test),
c_args: test_c_args + cairo_args,
- dependencies: [pugl_dep, pugl_cairo_dep],
- include_directories: include_directories(includes),
+ dependencies: [pugl_dep, pugl_cairo_dep, puglutil_dep],
+ implicit_include_directories: false,
),
suite: 'unit',
)
@@ -144,95 +125,24 @@ if vulkan_dep.found()
'test_' + test,
'test_@0@.c'.format(test),
c_args: test_c_args,
- cpp_args: test_cpp_args,
- dependencies: [pugl_dep, pugl_vulkan_dep],
- include_directories: include_directories(includes),
+ dependencies: [pugl_dep, pugl_vulkan_dep, puglutil_dep],
+ implicit_include_directories: false,
),
suite: 'unit',
)
endforeach
endif
-unified_args = core_args
-unified_deps = [core_deps]
-if cairo_dep.found()
- unified_args += ['-DWITH_CAIRO']
- unified_deps += [cairo_dep]
-endif
-
-if opengl_dep.found()
- unified_args += ['-DWITH_OPENGL']
- unified_deps += [opengl_dep]
-endif
-
-if vulkan_dep.found()
- unified_args += ['-DWITH_VULKAN']
- unified_deps += [vulkan_deps]
-endif
-
-if host_machine.system() == 'darwin'
- add_languages(['objcpp'], native: false)
-
- objcpp = meson.get_compiler('objcpp')
-
- objcpp_unified_args = unified_args
- if objcpp.get_id() == 'clang'
- objcpp_unified_args += [
- '-Wno-c++98-compat',
- '-Wno-c++98-compat-pedantic',
- '-Wno-deprecated-declarations',
- '-Wno-direct-ivar-access',
- ]
- endif
-
- objcpp_unified_args = objcpp.get_supported_arguments(objcpp_unified_args)
-
- test(
- 'inline_objcpp',
- executable(
- 'test_inline_objcpp',
- 'test_inline_objcpp.mm',
- dependencies: unified_deps,
- include_directories: include_directories(includes),
- objcpp_args: objcpp_unified_args,
- ),
- suite: 'unit',
- )
+###################
+# Header Warnings #
+###################
-elif is_variable('cpp')
- cpp_unified_args = unified_args
- if cpp.get_id() == 'clang'
- cpp_unified_args += [
- '-Wno-old-style-cast',
- '-Wno-switch-default',
- '-Wno-switch-enum',
- '-Wno-unused-macros', # Mac
- ]
- elif cpp.get_id() == 'gcc'
- cpp_unified_args += [
- '-Wno-conditionally-supported',
- '-Wno-old-style-cast',
- '-Wno-switch-default',
- '-Wno-switch-enum',
- '-Wno-useless-cast',
- ]
- elif cpp.get_id() == 'msvc'
- cpp_unified_args += [
- '/wd4464', # relative include path contains '..'
- ]
- endif
+subdir('headers')
- cpp_unified_args = cpp.get_supported_arguments(cpp_unified_args)
+#######################
+# C++ / Objective C++ #
+#######################
- test(
- 'inline_cpp',
- executable(
- 'test_inline_cpp',
- 'test_inline_cpp.cpp',
- cpp_args: cpp_unified_args,
- dependencies: unified_deps,
- include_directories: include_directories(includes),
- ),
- suite: 'unit',
- )
+if is_variable('cpp')
+ subdir('cpp')
endif