Skip to content

Commit cd315e1

Browse files
committed
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 <[email protected]>
1 parent a1fb0a3 commit cd315e1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project_description = 'Intrusive Red-Black Tree Collection'
1212

1313
add_project_arguments('-D_GNU_SOURCE', language: 'c')
1414
mod_pkgconfig = import('pkgconfig')
15+
use_ptrace = get_option('ptrace')
1516

1617
dep_cstdaux = dependency('libcstdaux-1')
1718
add_project_arguments(dep_cstdaux.get_variable('cflags').split(' '), language: 'c')

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
option('ptrace', type: 'boolean', value: false, description: 'Allow ptrace in test suite')

src/meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ test('Generic Map', test_map)
6262
test_misc = executable('test-misc', ['test-misc.c'], dependencies: libcrbtree_dep)
6363
test('Miscellaneous', test_misc)
6464

65-
test_parallel = executable('test-parallel', ['test-parallel.c'], dependencies: libcrbtree_dep)
66-
test('Lockless Parallel Readers', test_parallel)
65+
if use_ptrace
66+
test_parallel = executable('test-parallel', ['test-parallel.c'], dependencies: libcrbtree_dep)
67+
test('Lockless Parallel Readers', test_parallel)
68+
endif
6769

6870
test_posix = executable('test-posix', ['test-posix.c'], dependencies: libcrbtree_dep)
6971
test('Posix tsearch(3p) Comparison', test_posix)

0 commit comments

Comments
 (0)