Revert "ztest: Add config switch for modes of test output"

This reverts commit 5a850a5d06, which
broke multiple tests in the CI.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2022-07-30 03:51:01 +09:00 committed by Anas Nashif
parent caed3931a4
commit e7263b19e1
2 changed files with 7 additions and 53 deletions

View file

@ -121,35 +121,14 @@ static inline void test_time_ms(void)
} while (0)
#endif
static inline void print_nothing(const char *fmt, ...)
{
ARG_UNUSED(fmt);
}
#ifndef TC_PRINT
#if defined(CONFIG_ZTEST_VERBOSE_OUTPUT)
#define TC_PRINT(fmt, ...) PRINT_DATA(fmt, ##__VA_ARGS__)
#else
#define TC_PRINT(fmt, ...) print_nothing(fmt, ##__VA_ARGS__)
#endif
#endif
#ifndef TC_SUMMARY_PRINT
#define TC_SUMMARY_PRINT(fmt, ...) PRINT_DATA(fmt, ##__VA_ARGS__)
#endif
#ifndef TC_START_PRINT
#if defined(CONFIG_ZTEST_VERBOSE_OUTPUT)
#define TC_START_PRINT(name) PRINT_DATA("START - %s\n", name);
#else
#define TC_START_PRINT(name)
#endif
#endif
#ifndef TC_START
#define TC_START(name) \
do { \
TC_START_PRINT(name); \
PRINT_DATA("START - %s\n", name); \
get_start_time_cyc(); \
} while (0)
#endif
@ -158,22 +137,15 @@ static inline void print_nothing(const char *fmt, ...)
#define TC_END(result, fmt, ...) PRINT_DATA(fmt, ##__VA_ARGS__)
#endif
#ifndef TC_END_PRINT
#if defined(CONFIG_ZTEST_VERBOSE_OUTPUT)
#define TC_END_PRINT(result, fmt, ...) PRINT_DATA(fmt, ##__VA_ARGS__); PRINT_LINE
#else
#define TC_END_PRINT(result, fmt, ...)
#endif
#endif
/* prints result and the function name */
#ifndef Z_TC_END_RESULT
/* prints result and the function name */
#define Z_TC_END_RESULT(result, func) \
do { \
test_time_ms(); \
TC_END_PRINT(result, " %s - %s in %u.%u seconds\n", \
TC_END(result, " %s - %s in %u.%u seconds\n", \
TC_RESULT_TO_STR(result), func, tc_spend_time/1000, \
tc_spend_time%1000); \
PRINT_LINE; \
} while (0)
#endif
@ -182,14 +154,10 @@ static inline void print_nothing(const char *fmt, ...)
Z_TC_END_RESULT((result), __func__)
#endif
#ifndef TC_SUITE_PRINT
#define TC_SUITE_PRINT(fmt, ...) PRINT_DATA(fmt, ##__VA_ARGS__)
#endif
#ifndef TC_SUITE_START
#define TC_SUITE_START(name) \
do { \
TC_SUITE_PRINT("Running TESTSUITE %s\n", name); \
TC_PRINT("Running TESTSUITE %s\n", name); \
PRINT_LINE; \
} while (0)
#endif
@ -198,9 +166,9 @@ static inline void print_nothing(const char *fmt, ...)
#define TC_SUITE_END(name, result) \
do { \
if (result != TC_FAIL) { \
TC_SUITE_PRINT("TESTSUITE %s succeeded\n", name); \
TC_PRINT("TESTSUITE %s succeeded\n", name); \
} else { \
TC_SUITE_PRINT("TESTSUITE %s failed.\n", name); \
TC_PRINT("TESTSUITE %s failed.\n", name); \
} \
} while (0)
#endif

View file

@ -122,20 +122,6 @@ config ZTEST_SHUFFLE_TEST_REPEAT_COUNT
endif #ZTEST_SHUFFLE
config ZTEST_VERBOSE_OUTPUT
bool "Verbose test output"
default y
help
This option controls whether test output is shown verbosely or
no output at all.
config ZTEST_VERBOSE_SUMMARY
bool "Verbose test summary"
default y
help
This option controls whether suite summary is shwon verbosely or
just in one line.
endif # ZTEST_NEW_API
endif # ZTEST