| 1 | /* |
| 2 | * Copyright (c) 2001, 2002 Michael J. Roberts. All Rights Reserved. |
| 3 | * |
| 4 | * Please see the accompanying license file, LICENSE.TXT, for information |
| 5 | * on using and copying this software. |
| 6 | */ |
| 7 | /* |
| 8 | Name |
| 9 | t3test.h - common test definitions |
| 10 | Function |
| 11 | Provides some common definitions for the tads 3 test programs |
| 12 | Notes |
| 13 | |
| 14 | Modified |
| 15 | 11/11/01 MJRoberts - Creation |
| 16 | */ |
| 17 | |
| 18 | #ifndef T3TEST_H |
| 19 | #define T3TEST_H |
| 20 | |
| 21 | /* ------------------------------------------------------------------------ */ |
| 22 | /* |
| 23 | * Test initialization. Each test program invokes the macro test_init() |
| 24 | * at the start of its processing. This can be defined as needed per |
| 25 | * platform. |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * For Unix systems, at initialization time, turn off buffering on |
| 30 | * standard output. This will ensure that output sent to stdout is |
| 31 | * intermingled with stderr output in the same order in which the output |
| 32 | * is generated. If we leave stdout buffered, the order of stderr/stdout |
| 33 | * output will not be preserved, so the captured log file won't be |
| 34 | * predictable. |
| 35 | */ |
| 36 | #ifdef UNIX |
| 37 | #define test_init() setbuf(stdout, NULL) |
| 38 | #endif |
| 39 | |
| 40 | /* |
| 41 | * If we haven't defined a system-dependent test_init() by now, it must |
| 42 | * not be needed on the local system, so define it to nothing. |
| 43 | */ |
| 44 | #ifndef test_init |
| 45 | #define test_init() |
| 46 | #endif |
| 47 | |
| 48 | |
| 49 | #endif /* T3TEST_H */ |
| 50 |