build: define 'ptrace' option

Define a new 'ptrace' option to replace the old TEST_RUN_PTRACE
environment variable. This is much cleaner and avoids relying on random
environment variables for communication.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
main
David Rheinsberg 2022-05-02 12:34:54 +02:00
parent a1fb0a3296
commit cd315e186c
3 changed files with 6 additions and 2 deletions

View File

@ -12,6 +12,7 @@ project_description = 'Intrusive Red-Black Tree Collection'
add_project_arguments('-D_GNU_SOURCE', language: 'c')
mod_pkgconfig = import('pkgconfig')
use_ptrace = get_option('ptrace')
dep_cstdaux = dependency('libcstdaux-1')
add_project_arguments(dep_cstdaux.get_variable('cflags').split(' '), language: 'c')

1
meson_options.txt Normal file
View File

@ -0,0 +1 @@
option('ptrace', type: 'boolean', value: false, description: 'Allow ptrace in test suite')

View File

@ -62,8 +62,10 @@ test('Generic Map', test_map)
test_misc = executable('test-misc', ['test-misc.c'], dependencies: libcrbtree_dep)
test('Miscellaneous', test_misc)
test_parallel = executable('test-parallel', ['test-parallel.c'], dependencies: libcrbtree_dep)
test('Lockless Parallel Readers', test_parallel)
if use_ptrace
test_parallel = executable('test-parallel', ['test-parallel.c'], dependencies: libcrbtree_dep)
test('Lockless Parallel Readers', test_parallel)
endif
test_posix = executable('test-posix', ['test-posix.c'], dependencies: libcrbtree_dep)
test('Posix tsearch(3p) Comparison', test_posix)