diff options
author | Chris Johns <chrisj@rtems.org> | 2017-11-08 08:25:36 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2017-11-11 16:14:59 +1100 |
commit | bcd0c06c9be41f68d41c2fc1ed9408410b9084a3 (patch) | |
tree | a1e3900176bfc6110ca284e2d8bc0c1da563ad29 /cpukit/libmisc/testsupport/testbeginend.c | |
parent | mvme162: Fix errors tripped by transition to using polled IO for tests (diff) | |
download | rtems-bcd0c06c9be41f68d41c2fc1ed9408410b9084a3.tar.bz2 |
tests: Use rtems_test_begin and rtems_test_end.
Add a tests enum and move all test banner test to the library in libmisc.
Update #3199.
Diffstat (limited to 'cpukit/libmisc/testsupport/testbeginend.c')
-rw-r--r-- | cpukit/libmisc/testsupport/testbeginend.c | 94 |
1 files changed, 89 insertions, 5 deletions
diff --git a/cpukit/libmisc/testsupport/testbeginend.c b/cpukit/libmisc/testsupport/testbeginend.c index ff64851c02..04748cb796 100644 --- a/cpukit/libmisc/testsupport/testbeginend.c +++ b/cpukit/libmisc/testsupport/testbeginend.c @@ -7,6 +7,8 @@ * Germany * <rtems@embedded-brains.de> * + * Copyright (c) 2017 Chris Johns <chrisj@rtems.org>. All rights reserved. + * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. @@ -18,24 +20,106 @@ #include <rtems/test.h> #include <rtems/bspIo.h> +#include <rtems/version.h> + +#define TEST_BUILD_DEFAULT "default" +#if RTEMS_POSIX + #define TEST_BUILD_DEFAULT "" + #define TEST_BUILD_POSIX "posix " +#else + #define TEST_BUILD_POSIX +#endif +#if RTEMS_SMP + #define TEST_BUILD_DEFAULT "" + #define TEST_BUILD_SMP "smp " +#else + #define TEST_BUILD_SMP +#endif +#if RTEMS_MULTIPROCESSING + #define TEST_BUILD_DEFAULT "" + #define TEST_BUILD_MP "mp " +#else + #define TEST_BUILD_MP +#endif +#if RTEMS_PARAVIRT + #define TEST_BUILD_DEFAULT "" + #define TEST_BUILD_PARAVIRT "paravirt " +#else + #define TEST_BUILD_PARAVIRT +#endif +#if RTEMS_NETWORKING + #define TEST_BUILD_DEFAULT "" + #define TEST_BUILD_NETWORKING "legacy-net " +#else + #define TEST_BUILD_NETWORKING +#endif +#if RTEMS_DEBUG + #define TEST_BUILD_DEFAULT "" + #define TEST_BUILD_DEBUG "debug " +#else + #define TEST_BUILD_DEBUG +#endif +#if RTEMS_PROFILING + #define TEST_BUILD_DEFAULT "" + #define TEST_BUILD_PROFILING "profiling " +#else + #define TEST_BUILD_PROFILING +#endif + +#define TEST_BUILD_STRING \ + TEST_BUILD_DEFAULT \ + TEST_BUILD_POSIX \ + TEST_BUILD_SMP \ + TEST_BUILD_MP \ + TEST_BUILD_PARAVIRT \ + TEST_BUILD_NETWORKING \ + TEST_BUILD_DEBUG \ + TEST_BUILD_PROFILING rtems_printer rtems_test_printer = { .printer = rtems_printk_printer }; -int rtems_test_begin(void) +static const char* const test_state_strings[] = { - return rtems_printf( + "EXPECTED-PASS", + "EXPECTED-FAIL", + "USER_INPUT", + "INDETERMINATE", + "BENCHMARK" +}; + +int rtems_test_begin(const char* name, const RTEMS_TEST_STATE state) +{ + int l; + l = rtems_printf( + &rtems_test_printer, + "\n\n*** BEGIN OF TEST %s ***\n", name + ); + l += rtems_printf( + &rtems_test_printer, + "*** TEST VERSION: %s\n", rtems_version() + ); + l += rtems_printf( + &rtems_test_printer, + "*** TEST STATE: %s\n", test_state_strings[state] + ); + l += rtems_printf( + &rtems_test_printer, + "*** TEST BUILD: %s\n", TEST_BUILD_STRING + ); + l += rtems_printf( &rtems_test_printer, - TEST_BEGIN_STRING + "*** TEST TOOLS: " __VERSION__ "\n" ); + return l; } -int rtems_test_end(void) +int rtems_test_end(const char* name) { return rtems_printf( &rtems_test_printer, - TEST_END_STRING + "\n*** END OF TEST %s ***\n\n", name ); } |