From 57b6156c3387b836a6888018024ce0c98a4fe008 Mon Sep 17 00:00:00 2001 From: brarcher Date: Sat, 4 Jan 2014 18:34:03 +0000 Subject: [PATCH] ex_output.c: add new output mode STDOUT_DUMP This mode will print the normal suite progress and result to stdout, but then dump every mode using srunner_print() git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1024 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- tests/ex_output.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/ex_output.c b/tests/ex_output.c index c601255..fba3e68 100644 --- a/tests/ex_output.c +++ b/tests/ex_output.c @@ -116,7 +116,7 @@ static void print_usage(void) #if ENABLE_SUBUNIT printf (" | CK_SUBUNIT"); #endif - printf (") (STDOUT | LOG | TAP | XML) (NORMAL | EXIT_TEST)\n"); + printf (") (STDOUT | STDOUT_DUMP | LOG | TAP | XML) (NORMAL | EXIT_TEST)\n"); printf(" If CK_ENV is used, the environment variable CK_VERBOSITY can be set to\n"); printf(" one of these: silent, minimal, or verbose. If it is not set to these, or\n"); printf(" if CK_VERBOSITY is not set, then CK_NORMAL will be used\n"); @@ -125,6 +125,7 @@ static void print_usage(void) static void run_tests (int printmode, char * log_type, int include_exit_test) { SRunner *sr; + int dump_everything_to_stdout = 0; sr = srunner_create(make_log1_suite()); srunner_add_suite(sr, make_log2_suite(include_exit_test)); @@ -134,6 +135,14 @@ static void run_tests (int printmode, char * log_type, int include_exit_test) { /* Nothing else to do here */ } + else if(strcmp(log_type, "STDOUT_DUMP") == 0) + { + /* + * Dump each type to stdout, in addition to printing out + * the configured print level. + */ + dump_everything_to_stdout = 1; + } else if(strcmp(log_type, "LOG") == 0) { srunner_set_log(sr, "test.log"); @@ -153,6 +162,23 @@ static void run_tests (int printmode, char * log_type, int include_exit_test) } srunner_run_all(sr, printmode); + + if(dump_everything_to_stdout) + { + srunner_print(sr, CK_SILENT); + srunner_print(sr, CK_MINIMAL); + srunner_print(sr, CK_NORMAL); + srunner_print(sr, CK_VERBOSE); + srunner_print(sr, CK_ENV); +#if ENABLE_SUBUNIT + /* + * Note that this call does not contribute anything, as + * subunit is not fully considered an 'output mode'. + */ + srunner_print(sr, CK_SUBUNIT); +#endif + } + srunner_free(sr); } -- 2.40.0