Commit 79f42e64 authored by Kenneth Moreland's avatar Kenneth Moreland

At the end of tests, collect results to node 0.

Makes us more assured that a failure will actually be reported as such.
parent d2e7ef44
......@@ -380,10 +380,12 @@ void swap_buffers(void)
}
#endif
#define TEST_RESULT_TAG 3492
extern void finalize_communication(void);
void finalize_test(int result)
void finalize_test(IceTInt result)
{
IceTInt rank;
IceTInt num_proc;
#ifdef ICET_TESTS_USE_OPENGL
checkOglError();
......@@ -391,7 +393,18 @@ void finalize_test(int result)
checkIceTError();
icetGetIntegerv(ICET_RANK, &rank);
icetGetIntegerv(ICET_NUM_PROCESSES, &num_proc);
if (rank == 0) {
IceTInt p_id;
for (p_id = 1; p_id < num_proc; p_id++) {
IceTInt remote_result;
icetCommRecv(&remote_result, 1, ICET_INT, p_id, TEST_RESULT_TAG);
if (remote_result != TEST_PASSED) {
result = remote_result;
}
}
switch (result) {
case TEST_PASSED:
printf("***Test Passed***\n");
......@@ -403,9 +416,12 @@ void finalize_test(int result)
printf("***TEST NOT PASSED***\n");
break;
case TEST_FAILED:
default:
printf("***TEST FAILED***\n");
break;
}
} else {
icetCommSend(&result, 1, ICET_INT, 0, TEST_RESULT_TAG);
}
icetDestroyContext(context);
......
......@@ -45,7 +45,7 @@ void printrank(const char *fmt, ...);
void swap_buffers(void);
#endif
void finalize_test(int result);
void finalize_test(IceTInt result);
void write_ppm(const char *filename,
const IceTUByte *image,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment