1
/* Procedures for recording and printing test results */
8
static int tests_passed = 0;
9
static int tests_failed = 0;
10
static char failed_tests[255][81];
11
static char suite_name[255];
14
void Test_Init(suite, rank)
20
sprintf(filename, "%s-%d.out", suite, rank);
21
strncpy(suite_name, suite, 255);
22
fileout = fopen(filename, "w");
24
fprintf( stderr, "Could not open %s on node %d\n", filename, rank );
25
MPI_Abort( MPI_COMM_WORLD, 1 );
29
void Test_Message(mess)
32
fprintf(fileout, "[%s]: %s\n", suite_name, mess);
36
void Test_Failed(test)
39
fprintf(fileout, "[%s]: *** Test '%s' Failed! ***\n", suite_name, test);
40
strncpy(failed_tests[tests_failed], test, 81);
45
void Test_Passed(test)
48
fprintf(fileout, "[%s]: Test '%s' Passed.\n", suite_name, test);
53
int Summarize_Test_Results()
55
fprintf(fileout, "For test suite '%s':\n", suite_name);
56
fprintf(fileout, "Of %d attempted tests, %d passed, %d failed.\n",
57
tests_passed + tests_failed, tests_passed, tests_failed);
58
if (tests_failed > 0) {
61
fprintf(fileout, "*** Tests Failed:\n");
62
for (i = 0; i < tests_failed; i++)
63
fprintf(fileout, "*** %s\n", failed_tests[i]);
75
/* Wait for every process to pass through this point. This test is used
76
to make sure that all processes complete, and that a test "passes" because
77
it executed, not because it some process failed.
79
void Test_Waitforall( )
81
int m, one, myrank, n;
83
MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
84
MPI_Comm_size( MPI_COMM_WORLD, &n );
86
MPI_Allreduce( &one, &m, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
89
printf( "[%d] Expected %d processes to wait at end, got %d\n", myrank,
93
printf( "All processes completed test\n" );