Skip to content

Commit 12230b3

Browse files
authored
Merge pull request #19 from cniethammer/log_output_updates
Log output updates
2 parents 109d071 + 377b675 commit 12230b3

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

cmdline.ggo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ in order, so use 'all,^exclude'."
1313
text "\n"
1414
option "atomic-io" a "enable atomicity for files in I/O for all tests that support it"
1515
option "num-threads" j "number of additional threads to execute the tests" int default="0"
16-
option "report" r "level of detail for test report" values="summary","run","full" default="summary"
16+
option "report" r "level of detail for test report" values="none","summary","run","full" default="summary"
1717
option "execution-mode" x "level of correctness testing" values="disabled","strict","relaxed" default="relaxed"
1818

1919
option "list" l "list all available tests, communicators, datatypes and corresponding classes"

mpi_test_suite.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int main (int argc, char * argv[])
142142
MPI_Comm_rank (MPI_COMM_WORLD, &tst_global_rank);
143143
MPI_Comm_size (MPI_COMM_WORLD, &tst_global_size);
144144

145-
tst_output_init (DEBUG_LOG, TST_OUTPUT_RANK_SELF, TST_REPORT_MAX, TST_OUTPUT_TYPE_LOGFILE, "tst.log");
145+
tst_output_init (DEBUG_LOG, TST_OUTPUT_RANK_SELF, TST_REPORT_NONE, TST_OUTPUT_TYPE_STDERR);
146146

147147
char info_str[MAX_INFO_STRING_LENGTH];
148148
get_compiler_info(info_str);
@@ -359,7 +359,7 @@ int main (int argc, char * argv[])
359359
str = strtok (NULL, ",");
360360
}
361361

362-
for (tst_report = TST_REPORT_SUMMARY; tst_report < TST_REPORT_MAX; tst_report++) {
362+
for (tst_report = TST_REPORT_NONE; tst_report < TST_REPORT_MAX; tst_report++) {
363363
if (0 == strcasecmp (args_info.report_arg, tst_reports[tst_report])) {
364364
break;
365365
}
@@ -435,7 +435,7 @@ int main (int argc, char * argv[])
435435
if (tst_test_check_sync (&tst_env))
436436
MPI_Barrier (MPI_COMM_WORLD);
437437

438-
if (tst_global_rank == 0 && tst_report > TST_REPORT_SUMMARY)
438+
if (tst_global_rank == 0 && tst_report >= TST_REPORT_RUN)
439439
printf ("%s tests %s (%d/%d), comm %s (%d/%d), type %s (%d/%d)\n",
440440
tst_test_getclass_string (tst_env.test),
441441
tst_test_getdescription (tst_env.test), tst_env.test+1, num_tests,
@@ -461,7 +461,7 @@ int main (int argc, char * argv[])
461461
MPI_Barrier (MPI_COMM_WORLD);
462462
}
463463

464-
if (tst_global_rank == 0) {
464+
if (tst_global_rank == 0 && tst_report >= TST_REPORT_SUMMARY) {
465465
tst_test_print_failed ();
466466
}
467467

tst_output.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static int tst_output_global_rank;
2626

2727
/* Corresponding strings to values in enum tst_report_types. */
2828
const char * tst_reports[] = {
29+
"None",
2930
"Summary",
3031
"Run",
3132
"Full",
@@ -143,6 +144,10 @@ int tst_output_printf(tst_output_stream * output,
143144
int count;
144145
va_list arglist;
145146

147+
if (output->isopen == 0) {
148+
return 0;
149+
}
150+
146151
#ifdef HAVE_MPI2_THREADS
147152
{
148153
if (tst_thread_running()) {
@@ -153,7 +158,7 @@ int tst_output_printf(tst_output_stream * output,
153158
}
154159
#endif
155160

156-
if ((output->isopen == 1) && (output->rank == tst_output_global_rank) && (error_level <= output->level)) {
161+
if ((output->rank == tst_output_global_rank) && (error_level <= output->level)) {
157162
va_start(arglist, format);
158163
count = vfprintf (output->streamptr, format, arglist);
159164
fflush (output->streamptr);

tst_output.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ typedef enum {
2626

2727

2828
typedef enum {
29-
TST_REPORT_SUMMARY = 0, /**< No output, except for final summary */
29+
TST_REPORT_NONE = 0, /**< No output */
30+
TST_REPORT_SUMMARY, /**< No output, except for final summary */
3031
TST_REPORT_RUN, /**< Output every test that runs, plus the previous */
3132
TST_REPORT_FULL, /**< Full output, including hexdump of wrong memory */
3233
TST_REPORT_MAX /**< Output everything */

0 commit comments

Comments
 (0)