diff options
author | Robert Sesek <rsesek@google.com> | 2019-02-12 11:22:57 -0500 |
---|---|---|
committer | Robert Sesek <rsesek@google.com> | 2019-02-12 11:31:32 -0500 |
commit | 8f82d0c580a88b4301353d419779ed41f6f0f443 (patch) | |
tree | 8b3347f02c831a09356edc014abbf34a742a901f /seccomp_bpf_tests.h | |
parent | ac56b768c6ca2fd2548cb26d61111e76beb0ff81 (diff) | |
download | seccomp-tests-8f82d0c580a88b4301353d419779ed41f6f0f443.tar.gz |
Change API to allow running a test by name, rather than returning the list.android-o-mr1-iot-release-1.0.12android-o-mr1-iot-release-1.0.10oreo-mr1-iot-release
Having C++ projects include linux/test_harness.h does not work because
libc++ sets _GNU_SOURCE in the compiler built-ins, which then produces
a re-defined macro error in that file.
Test: cts-tradefed run singleCommand cts -m CtsOsTestCases -t android.os.cts.SeccompTest
Bug: 124189460
Change-Id: Ieae63f215258be903e0df1e7f5fcd06e99596de5
Diffstat (limited to 'seccomp_bpf_tests.h')
-rw-r--r-- | seccomp_bpf_tests.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/seccomp_bpf_tests.h b/seccomp_bpf_tests.h index a46be51..1de226e 100644 --- a/seccomp_bpf_tests.h +++ b/seccomp_bpf_tests.h @@ -20,9 +20,16 @@ * for use by CTS. */ -#include "linux/test_harness.h" - -// Forward declare from seccomp_bpf_tests.c. +#ifdef __cplusplus extern "C" { -struct __test_metadata* get_seccomp_test_list(); +#endif + +/** + * Runs a Seccomp kernel test named |name|. Returns 1 if the test passed + * and 0 if the test failed. + */ +int run_seccomp_test(const char* name); + +#ifdef __cplusplus } +#endif |