From 7f18ec816a57cbb71902045fc9a583d95f6daa25 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 1 Apr 2016 19:00:45 +0100 Subject: [PATCH] Create xtf.h and avoid using xtf/lib.h as the include-all header Signed-off-by: Andrew Cooper --- common/exlog.c | 2 ++ include/xtf.h | 37 ++++++++++++++++++++++++++++++++++++ include/xtf/lib.h | 9 --------- tests/cpuid/main.c | 2 +- tests/example/main.c | 2 +- tests/msr/main.c | 2 +- tests/pv-iopl/main.c | 2 +- tests/selftest/main.c | 2 +- tests/swint-emulation/main.c | 2 +- tests/xsa-122/main.c | 2 +- tests/xsa-123/main.c | 2 +- tests/xsa-167/main.c | 2 +- tests/xsa-168/main.c | 2 +- 13 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 include/xtf.h diff --git a/common/exlog.c b/common/exlog.c index b347a49..80efba7 100644 --- a/common/exlog.c +++ b/common/exlog.c @@ -1,5 +1,7 @@ #include +#include #include +#include static bool logging = false; static unsigned int log_entries; diff --git a/include/xtf.h b/include/xtf.h new file mode 100644 index 0000000..35c5b44 --- /dev/null +++ b/include/xtf.h @@ -0,0 +1,37 @@ +/** + * @file include/xtf.h + * + * Convenience header for tests. + */ +#ifndef XTF_H +#define XTF_H + +/* Primitives */ +#include +#include +#include + +#include +#include + +/* Core test functionality */ +#include +#include + +/* Optional functionality */ +#include +#include +#include +#include + +#endif /* XTF_H */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/include/xtf/lib.h b/include/xtf/lib.h index ab0df44..6da9d14 100644 --- a/include/xtf/lib.h +++ b/include/xtf/lib.h @@ -1,16 +1,7 @@ #ifndef XTF_LIB_H #define XTF_LIB_H -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include diff --git a/tests/cpuid/main.c b/tests/cpuid/main.c index f89ad6c..adb5bc1 100644 --- a/tests/cpuid/main.c +++ b/tests/cpuid/main.c @@ -9,7 +9,7 @@ * * @sa tests/cpuid/main.c */ -#include +#include static void dump_leaves( void (*cpuid_fn)(uint32_t leaf, uint32_t subleaf, diff --git a/tests/example/main.c b/tests/example/main.c index 1a34726..9b1e5b0 100644 --- a/tests/example/main.c +++ b/tests/example/main.c @@ -8,7 +8,7 @@ * * @sa tests/example/main.c */ -#include +#include void test_main(void) { diff --git a/tests/msr/main.c b/tests/msr/main.c index 391a320..2685420 100644 --- a/tests/msr/main.c +++ b/tests/msr/main.c @@ -11,7 +11,7 @@ * * @sa tests/msr/main.c */ -#include +#include static int rdmsr_safe(uint32_t msr, uint64_t *val) { diff --git a/tests/pv-iopl/main.c b/tests/pv-iopl/main.c index 91e4b6b..c446071 100644 --- a/tests/pv-iopl/main.c +++ b/tests/pv-iopl/main.c @@ -38,7 +38,7 @@ * * @sa tests/pv-iopl/main.c */ -#include +#include #include diff --git a/tests/selftest/main.c b/tests/selftest/main.c index 7181bf4..553b05a 100644 --- a/tests/selftest/main.c +++ b/tests/selftest/main.c @@ -9,7 +9,7 @@ * * @sa tests/selftest/main.c */ -#include +#include #include #include diff --git a/tests/swint-emulation/main.c b/tests/swint-emulation/main.c index b266c5a..f570f4d 100644 --- a/tests/swint-emulation/main.c +++ b/tests/swint-emulation/main.c @@ -44,7 +44,7 @@ * * @sa tests/swint-emulation/main.c */ -#include +#include #include #include diff --git a/tests/xsa-122/main.c b/tests/xsa-122/main.c index 3ae4797..bdd7685 100644 --- a/tests/xsa-122/main.c +++ b/tests/xsa-122/main.c @@ -20,7 +20,7 @@ * * @sa tests/xsa-122/main.c */ -#include +#include /* * Check a buffer of a specified size for non-NUL bytes following the string diff --git a/tests/xsa-123/main.c b/tests/xsa-123/main.c index 67479b5..2542b41 100644 --- a/tests/xsa-123/main.c +++ b/tests/xsa-123/main.c @@ -27,7 +27,7 @@ * * @sa tests/xsa-123/main.c */ -#include +#include void test_main(void) { diff --git a/tests/xsa-167/main.c b/tests/xsa-167/main.c index e9cda6e..d4bd4e3 100644 --- a/tests/xsa-167/main.c +++ b/tests/xsa-167/main.c @@ -25,7 +25,7 @@ * * @sa tests/xsa-167/main.c */ -#include +#include void test_main(void) { diff --git a/tests/xsa-168/main.c b/tests/xsa-168/main.c index d473b4f..c049b8d 100644 --- a/tests/xsa-168/main.c +++ b/tests/xsa-168/main.c @@ -29,7 +29,7 @@ * * @sa tests/xsa-168/main.c */ -#include +#include void test_main(void) { -- 2.39.5