Skip to content

Commit

Permalink
tests/rtld: Add support for conditionally skipping tests
Browse files Browse the repository at this point in the history
This allows test subdirs in tests/rtld to conditionally skip, e.g. when
patchelf is needed to build a test and not found.
  • Loading branch information
lzcunt committed Feb 2, 2025
1 parent 71ddf2d commit 85a52b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/rtld/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,23 @@ foreach test_name : rtld_test_cases
test_native_link_with = []
test_native_depends = []
test_additional_link_args = []
test_skipped = false

# Build the needed DSOs for the test. This sets the variables above.
subdir(test_name)

if test_skipped
exec = executable('rtld-' + test_name, ['skipped.c', test_sources],
dependencies: libc_dep,
link_args: test_link_args,
)
test(test_name, exec, suite: 'rtld')
if build_tests_host_libc and not host_libc_excluded_test_cases.contains(test_name)
test(test_name, exec, suite: ['host-libc', 'rtld'])
endif
continue
endif

exec = executable('rtld-' + test_name, [test_name / 'test.c', test_sources],
link_with: test_link_with,
dependencies: libc_dep,
Expand Down
3 changes: 3 additions & 0 deletions tests/rtld/skipped.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int main() {
return 77;
}

0 comments on commit 85a52b8

Please sign in to comment.