From 8f82d0c580a88b4301353d419779ed41f6f0f443 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 12 Feb 2019 11:22:57 -0500 Subject: Change API to allow running a test by name, rather than returning the list. 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 --- seccomp_bpf_tests.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'seccomp_bpf_tests.h') 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 -- cgit v1.2.3