2 * Copyright (c) 2000 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 /* $Id: test.h,v 1.2 2005/11/09 02:50:19 nathans.longdrop.melbourne.sgi.com Exp $ */
30 #define TPASS 0 /* Test passed flag */
31 #define TFAIL 1 /* Test failed flag */
32 #define TBROK 2 /* Test broken flag */
33 #define TWARN 4 /* Test warning flag */
34 #define TRETR 8 /* Test retire flag */
35 #define TINFO 16 /* Test information flag */
36 #define TCONF 32 /* Test not appropriate for configuration flag */
39 * To determine if you are on a Umk or Unicos system,
40 * use sysconf(_SC_CRAY_SYSTEM). But since _SC_CRAY_SYSTEM
41 * is not defined until 90, it will be define here if not already
43 * if ( sysconf(_SC_CRAY_SYSTEM) == 1 )
45 * else # returned 0 or -1
47 * This is only being done on CRAY systems.
50 #ifndef _SC_CRAY_SYSTEM
51 #define _SC_CRAY_SYSTEM 140
52 #endif /* ! _SC_CRAY_SYSTEM */
56 * Ensure that NUMSIGS is defined.
57 * It should be defined in signal.h or sys/signal.h on
58 * UNICOS/mk and IRIX systems. On UNICOS systems,
59 * it is not defined, thus it is being set to UNICOS's NSIG.
60 * Note: IRIX's NSIG (signals are 1-(NSIG-1))
61 * is not same meaning as UNICOS/UMK's NSIG (signals 1-NSIG)
68 /* defines for unexpected signal setup routine (set_usig.c) */
69 #define FORK 1 /* SIGCLD is to be ignored */
70 #define NOFORK 0 /* SIGCLD is to be caught */
71 #define DEF_HANDLER 0 /* tells set_usig() to use default signal handler */
74 * The following defines are used to control tst_res and t_result reporting.
77 #define TOUTPUT "TOUTPUT" /* The name of the environment variable */
78 /* that can be set to one of the following */
79 /* strings to control tst_res output */
80 /* If not set, TOUT_VERBOSE_S is assumed */
82 #define TOUT_VERBOSE_S "VERBOSE" /* All test cases reported */
83 #define TOUT_CONDENSE_S "CONDENSE" /* ranges are used where identical messages*/
84 /* occur for sequential test cases */
85 #define TOUT_NOPASS_S "NOPASS" /* No pass test cases are reported */
86 #define TOUT_DISCARD_S "DISCARD" /* No output is reported */
88 #define TST_NOBUF "TST_NOBUF" /* The name of the environment variable */
89 /* that can be set to control whether or not */
90 /* tst_res will buffer output into 4096 byte */
91 /* blocks of output */
92 /* If not set, buffer is done. If set, no */
93 /* internal buffering will be done in tst_res */
94 /* t_result does not have internal buffering */
97 * The following defines are used to control tst_tmpdir, tst_wildcard and t_mkchdir
100 #define TDIRECTORY "TDIRECTORY" /* The name of the environment variable */
101 /* that if is set, the value (directory) */
102 /* is used by all tests as their working */
103 /* directory. tst_rmdir and t_rmdir will */
104 /* not attempt to clean up. */
105 /* This environment variable should only */
106 /* be set when doing system testing since */
107 /* tests will collide and break and fail */
108 /* because of setting it. */
110 #define TEMPDIR "/tmp" /* This is the default temporary directory. */
111 /* The environment variable TMPDIR is */
112 /* used prior to this valid by tempnam(3). */
113 /* To control the base location of the */
114 /* temporary directory, set the TMPDIR */
115 /* environment variable to desired path */
118 * The following contains support for error message passing.
119 * See test_error.c for details.
121 #define TST_ERR_MESG_SIZE 1023 /* max size of error message */
122 #define TST_ERR_FILE_SIZE 511 /* max size of module name used by compiler */
123 #define TST_ERR_FUNC_SIZE 127 /* max size of func name */
126 int te_line; /* line where last error was reported. Use */
127 /* "__LINE__" and let compiler do the rest */
128 int te_level; /* If set, will prevent current stored */
129 /* error to not be overwritten */
130 char te_func[TST_ERR_FUNC_SIZE+1]; /* name of function of last error */
131 /* Name of function or NULL */
132 char te_file[TST_ERR_FILE_SIZE+1]; /* module of last error. Use */
133 /* "__FILE__" and let compiler do the rest */
134 char te_mesg[TST_ERR_MESG_SIZE+1]; /* string of last error */
138 extern _TST_ERROR Tst_error; /* defined in test_error.c */
140 extern void tst_set_error(char *file, int line, char *func, char *fmt, ...);
142 extern void tst_set_error();
144 extern void tst_clear_error();
148 * The following define contains the name of an environmental variable
149 * that can be used to specify the number of iterations.
150 * It is supported in parse_opts.c and USC_setup.c.
152 #define USC_ITERATION_ENV "USC_ITERATIONS"
155 * The following define contains the name of an environmental variable
156 * that can be used to specify to iteration until desired time
157 * in floating point seconds has gone by.
158 * Supported in USC_setup.c.
160 #define USC_LOOP_WALLTIME "USC_LOOP_WALLTIME"
163 * The following define contains the name of an environmental variable
164 * that can be used to specify that no functional checks are wanted.
165 * It is supported in parse_opts.c and USC_setup.c.
167 #define USC_NO_FUNC_CHECK "USC_NO_FUNC_CHECK"
170 * The following define contains the name of an environmental variable
171 * that can be used to specify the delay between each loop iteration.
172 * The value is in seconds (fractional numbers are allowed).
173 * It is supported in parse_opts.c.
175 #define USC_LOOP_DELAY "USC_LOOP_DELAY"
178 * The following prototypes are needed to remove compile errors
179 * on IRIX systems when compiled with -n32 and -64.
181 extern void tst_res(int ttype, char *fname, char *arg_fmt, ...);
182 extern void tst_resm(int ttype, char *arg_fmt, ...);
183 extern void tst_brk(int ttype, char *fname, void (*func)(),
185 extern void tst_brkloop(int ttype, char *fname, void (*func)(),
187 extern void tst_brkm(int ttype, void (*func)(), char *arg_fmt, ...);
188 extern void tst_brkloopm(int ttype, void (*func)(), char *arg_fmt, ...);
190 extern int tst_environ();
191 extern void tst_exit();
192 extern void tst_flush();
194 /* prototypes for the t_res.c functions */
195 extern void t_result(char *tcid, int tnum, int ttype, char *tmesg);
196 extern void tt_exit();
197 extern int t_environ();
198 extern void t_breakum(char *tcid, int total, int typ, char *msg, void (*fnc)());
200 extern void tst_sig(int fork_flag, void (*handler)(), void (*cleanup)());
201 extern void tst_tmpdir();
202 extern void tst_rmdir();
204 extern char * get_high_address(void);
206 extern void get_kver(int*, int*, int*);
207 extern int tst_kvercmp(int, int, int);
209 #endif /* end of __TEST_H__ */