From 0ff2899a8e0d2c12e43f4c278d0eb7141495bef1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 28 Jul 2021 09:58:52 +0200 Subject: cpukit/libtest/testbeginend.c --- cpukit/libtest/testbeginend.c | 35 ++----------------------------- cpukit/libtest/testprinter.c | 49 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 33 deletions(-) create mode 100644 cpukit/libtest/testprinter.c diff --git a/cpukit/libtest/testbeginend.c b/cpukit/libtest/testbeginend.c index bacca81788..c0201ec41e 100644 --- a/cpukit/libtest/testbeginend.c +++ b/cpukit/libtest/testbeginend.c @@ -23,12 +23,6 @@ #include #include -#if !defined(RTEMS_QUAL_ONLY) -rtems_printer rtems_test_printer = { - .printer = rtems_printk_printer -}; -#endif - static const char* const test_state_strings[] = { "EXPECTED_PASS", @@ -40,7 +34,7 @@ static const char* const test_state_strings[] = int rtems_test_begin(const char* name, const RTEMS_TEST_STATE state) { -#if defined(RTEMS_QUAL_ONLY) +#if defined(RTEMS_QUAL) return _IO_Printf( rtems_put_char, NULL, @@ -83,7 +77,7 @@ int rtems_test_begin(const char* name, const RTEMS_TEST_STATE state) int rtems_test_end(const char* name) { -#if defined(RTEMS_QUAL_ONLY) +#if defined(RTEMS_QUAL) return _IO_Printf( rtems_put_char, NULL, @@ -94,28 +88,3 @@ int rtems_test_end(const char* name) "\n*** END OF TEST %s ***\n\n", name ); } - -#if !defined(RTEMS_QUAL_ONLY) -void rtems_test_exit(int status) -{ - (void) status; - rtems_shutdown_executive(0); -} - -int rtems_test_printf( - const char* format, - ... -) -{ - va_list ap; - int len; - va_start(ap, format); - len = rtems_vprintf( - &rtems_test_printer, - format, - ap - ); - va_end(ap); - return len; -} -#endif diff --git a/cpukit/libtest/testprinter.c b/cpukit/libtest/testprinter.c new file mode 100644 index 0000000000..5c2f0fedb3 --- /dev/null +++ b/cpukit/libtest/testprinter.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, 2018 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * + * + * Copyright (c) 2017 Chris Johns . 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +rtems_printer rtems_test_printer = { + .printer = rtems_printk_printer +}; + +void rtems_test_exit(int status) +{ + (void) status; + rtems_shutdown_executive(0); +} + +int rtems_test_printf( + const char* format, + ... +) +{ + va_list ap; + int len; + va_start(ap, format); + len = rtems_vprintf( + &rtems_test_printer, + format, + ap + ); + va_end(ap); + return len; +} -- cgit v1.2.3