annotate dstress.c @ 499:0434764d4a66

removed redundancy in the output
author thomask
date Sun, 01 May 2005 04:02:01 +0000
parents 1418f225a81e
children 03ad4005cd8e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
1 /*
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
2 * core test tool for the DStress test suite
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
3 * http://dstress.kuehne.cn
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
4 *
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
5 * Copyright (C) 2005 Thomas Kuehne <thomas@kuehne.cn>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
6 *
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
10 * (at your option) any later version.
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
11 *
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
15 * GNU General Public License for more details.
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
16 *
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
20 *
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
21 * $HeadURL$
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
22 * $Date$
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
23 * $Author$
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
24 *
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
25 */
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
26
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
27 /* Beware: the code doesn't care about freeing allocated memory etc... */
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
28
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
29 #include <stdlib.h>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
30 #include <stdio.h>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
31 #include <string.h>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
32 #include <errno.h>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
33
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
34 #define OBJ "-odobj "
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
35 #define TLOG "log.tmp"
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
36 #define CRASH_RUN "./crashRun__"
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
37
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
38 #define RUN 1
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
39 #define NORUN 2
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
40 #define COMPILE 4
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
41 #define NOCOMPILE 8
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
42
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
43 /* secure malloc */
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
44 void *xmalloc(size_t size){
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
45 void *p;
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
46 if (p < 0){
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
47 fprintf(stderr,"Failed to allocate %zd bytes!\n", size);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
48 exit(EXIT_FAILURE);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
49 }
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
50 p = malloc(size);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
51 if (p == NULL){
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
52 fprintf(stderr,"Failed to allocate %zd bytes!\n", size);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
53 exit(EXIT_FAILURE);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
54 }
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
55 return p;
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
56 }
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
57 #define malloc xmalloc
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
58
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
59 #if defined(__GNU_LIBRARY__) || defined(__GLIBC__)
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
60 #define USE_POSIX
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
61 #endif
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
62
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
63 #ifdef linux
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
64 #define USE_POSIX
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
65 #endif
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
66
273
68b883fe4fad added *BSD support to the test framework
thomask
parents: 261
diff changeset
67 #if defined(__APPLE__) && defined(__MACH__)
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
68 #define USE_POSIX
273
68b883fe4fad added *BSD support to the test framework
thomask
parents: 261
diff changeset
69 #endif
68b883fe4fad added *BSD support to the test framework
thomask
parents: 261
diff changeset
70
68b883fe4fad added *BSD support to the test framework
thomask
parents: 261
diff changeset
71 #ifdef __FreeBSD__
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
72 #define USE_POSIX
273
68b883fe4fad added *BSD support to the test framework
thomask
parents: 261
diff changeset
73 #endif
68b883fe4fad added *BSD support to the test framework
thomask
parents: 261
diff changeset
74
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
75
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
76 #ifdef USE_POSIX
254
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
77
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
78 #include <sys/types.h>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
79 #include <sys/stat.h>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
80 #include <fcntl.h>
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
81 #include <unistd.h>
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
82
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
83 #else
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
84 #ifdef WIN32
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
85
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
86 #include <windows.h>
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
87
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
88 #endif /* WIN 32 */
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
89 #endif /* USE_POSIX else */
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
90
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
91
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
92 char* loadFile(char* filename){
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
93 #ifdef USE_POSIX
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
94 char* back = NULL;
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
95 struct stat fileInfo;
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
96 int file = open(filename, O_RDONLY);
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
97 if(errno == 0 && file != 0 && file != -1){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
98 if(0==fstat(file, &fileInfo)){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
99 back=malloc(fileInfo.st_size+1);
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
100 fileInfo.st_size = read(file, back, fileInfo.st_size);
440
dc186d1266ba fixed handling of empty files
thomask
parents: 439
diff changeset
101 if(fileInfo.st_size>=0){
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
102 *(back+fileInfo.st_size+1) = '\x00';
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
103 }else{
436
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
104 back = NULL;
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
105 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
106 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
107 close(file);
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
108 }
436
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
109
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
110 if(back){
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
111 return back;
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
112 }
440
dc186d1266ba fixed handling of empty files
thomask
parents: 439
diff changeset
113 if(0==strcmp(filename, TLOG)){
dc186d1266ba fixed handling of empty files
thomask
parents: 439
diff changeset
114 return calloc(1,sizeof(char));
dc186d1266ba fixed handling of empty files
thomask
parents: 439
diff changeset
115 }
436
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
116
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
117 fprintf(stderr, "File not found \"%s\"\n", filename);
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
118 exit(EXIT_FAILURE);
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
119 #else /* USE_POSIX */
254
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
120 #ifdef WIN32
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
121
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
122 char* back=NULL;
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
123 DWORD size, numread;
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
124 HANDLE file=CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
125 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
126 if (file != INVALID_HANDLE_VALUE){
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
127 size = GetFileSize(file, NULL);
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
128 if (size != INVALID_FILE_SIZE){
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
129 back=malloc((size+1)*sizeof(char));
292
7e28d437d6d7 fixed Windows loadFile return code bug
thomask
parents: 273
diff changeset
130 if (ReadFile(file,back,size,&numread,NULL) == 1){
7e28d437d6d7 fixed Windows loadFile return code bug
thomask
parents: 273
diff changeset
131 if (numread==size){
254
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
132 *(back+size+1) = '\x00';
292
7e28d437d6d7 fixed Windows loadFile return code bug
thomask
parents: 273
diff changeset
133 }else{
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
134 back = NULL;
292
7e28d437d6d7 fixed Windows loadFile return code bug
thomask
parents: 273
diff changeset
135 }
7e28d437d6d7 fixed Windows loadFile return code bug
thomask
parents: 273
diff changeset
136 }else{
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
137 back = NULL;
292
7e28d437d6d7 fixed Windows loadFile return code bug
thomask
parents: 273
diff changeset
138 }
254
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
139 }
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
140 CloseHandle(file);
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
141 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
142 if(back){
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
143 errno = 0;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
144 return back;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
145 }
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
146
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
147 fprintf(stderr, "File not found \"%s\"\n", filename);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
148 exit(EXIT_FAILURE);
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
149 #else /* WIN32 */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
150
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
151 #error "no loadFile implementation present"
361
0147a35cbeb7 dif. fixes 5
thomask
parents: 340
diff changeset
152
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
153 #endif /* WIN32 else */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
154 #endif /* USE_POSIX else */
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
155 }
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
156
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
157 /* cleanup "/" versus "\" in filenames */
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
158 char* cleanPathSeperator(char* filename){
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
159 char* pos;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
160 #ifdef USE_POSIX
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
161 for(pos=strchr(filename, '\\'); pos; pos=strchr(filename, '\\')){
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
162 *pos='/';
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
163 }
439
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
164 #else
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
165 #if WIN32
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
166 for(pos=strchr(filename, '/'); pos; pos=strchr(filename, '/')){
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
167 *pos='\\';
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
168 }
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
169 #else
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
170
439
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
171 #error no cleanPathSeperator available for this system
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
172
439
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
173 #endif /* WIN32 else */
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
174 #endif /* USE_POSIX else */
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
175 return filename;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
176 }
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
177
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
178
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
179 /* query the environment for the compiler name */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
180 char* getCompiler(){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
181 char* back = getenv("DMD");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
182 if(back == NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
183 back = getenv("dmd");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
184 if(back==NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
185 back = "dmd";
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
186 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
187 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
188 return cleanPathSeperator(back);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
189 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
190
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
191 /* query the environment for general flags */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
192 char* getGeneralFlags(){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
193 char* back = getenv("DFLAGS");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
194 if(back == NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
195 back = getenv("dflags");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
196 if(back==NULL){
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
197 back = calloc(1,1);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
198 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
199 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
200 return cleanPathSeperator(back);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
201 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
202
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
203
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
204 /* extract the FIRST occurance of a given TAG until the next linebreak */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
205 char* getCaseFlag(const char* data, const char* tag){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
206 char* begin;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
207 char* end1;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
208 char* end2;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
209 char* back;
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
210
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
211 if(data!=NULL && tag!=NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
212 begin = strstr(data, tag);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
213 if(begin!=NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
214 begin = begin+strlen(tag);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
215 end1 = strstr(begin, "\n");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
216 end2 = strstr(begin, "\r");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
217 if(end2!=NULL && ((end1!=NULL && end2<end1) || end1==NULL)){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
218 end1=end2;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
219 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
220 if(end1==NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
221 end1 = begin + strlen(begin);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
222 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
223 back = malloc(end1-begin+1);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
224 strncpy(back, begin, end1-begin);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
225 back[end1-begin+1]='\x00';
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
226 return cleanPathSeperator(back);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
227 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
228 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
229
429
1185c50d4b08 fix dstress.c's memory handling
thomask
parents: 405
diff changeset
230 return calloc(1,1);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
231 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
232
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
233 /* check compile-time error messages */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
234 int checkErrorMessage(const char* file_, const char* line_, const char* buffer){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
235
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
236 char* file;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
237 char* line;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
238 char* dmd;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
239 char* gdc;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
240
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
241 int back=0;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
242
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
243 /* clean arguments */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
244 if(strcmp(file_, "")!=0){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
245 file = malloc(strlen(file_)+1);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
246 strcpy(file, file_);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
247 }else{
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
248 file=NULL;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
249 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
250
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
251 if(strcmp(line_, "")!=0){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
252 line = malloc(strlen(line_)+1);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
253 strcpy(line, line_);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
254 }else{
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
255 line=NULL;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
256 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
257
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
258 /* gen patterns*/
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
259 if(file!=NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
260 if(line!=NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
261 dmd = malloc(strlen(file)+strlen(line)+5);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
262 dmd[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
263 strcat(dmd, file);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
264 strcat(dmd, "(");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
265 strcat(dmd, line);
405
7df87732c662 fixed DMD's pattern generator for in-message location
thomask
parents: 373
diff changeset
266 strcat(dmd, ")");
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
267 gdc = malloc(strlen(file)+strlen(line)+4);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
268 gdc[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
269 strcat(gdc, file);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
270 strcat(gdc, ":");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
271 strcat(gdc, line);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
272 strcat(gdc, ": ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
273 }else{
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
274 dmd = malloc(strlen(file)+2);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
275 dmd[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
276 strcat(dmd, file);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
277 strcat(dmd, "(");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
278 gdc = malloc(strlen(file)+2);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
279 gdc[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
280 strcat(gdc, file);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
281 strcat(gdc, ":");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
282 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
283 }else if(line!=NULL){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
284 dmd = malloc(strlen(line)+5);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
285 dmd[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
286 strcat(dmd, "(");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
287 strcat(dmd, line);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
288 strcat(dmd, "): ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
289 gdc = malloc(strlen(line)+4);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
290 gdc[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
291 strcat(gdc, ":");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
292 strcat(gdc, line);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
293 strcat(gdc, ": ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
294 }else{
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
295 return 1;
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
296 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
297
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
298 /* specific error messages */
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
299
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
300 if( (dmd!=NULL && strstr(buffer, dmd))
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
301 || (gdc!=NULL && strstr(buffer, gdc))
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
302 || (dmd==NULL && gdc==NULL)){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
303 back=1;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
304 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
305
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
306 return back;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
307 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
308
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
309 int checkRuntimeErrorMessage(const char* file_, const char* line_, const char* buffer){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
310 /* PhobosLong dir/file.d(2)
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
311 * Phobos package.module(2)
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
312 */
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
313
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
314 char* file;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
315 char* line;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
316 char* phobos;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
317 char* phobosLong;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
318
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
319 char* begin;
439
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
320 char* end;
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
321
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
322 int back=0;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
323
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
324 /* clean arguments */
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
325 if(strcmp(file_, "")!=0){
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
326 file = malloc(strlen(file_)+1);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
327 strcpy(file, file_);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
328 }else{
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
329 file=NULL;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
330 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
331
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
332 if(strcmp(line_, "")!=0){
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
333 line = malloc(strlen(line_)+1);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
334 strcpy(line, line_);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
335 }else{
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
336 line=NULL;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
337 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
338
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
339 /* gen patterns*/
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
340 if(file!=NULL){
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
341 if(line!=NULL){
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
342 phobos = malloc(strlen(file)+strlen(line)+5);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
343 phobos[0]='\x00';
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
344 begin=strrchr(file,'/');
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
345 if(begin){
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
346 begin++;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
347 }else{
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
348 begin=strrchr(file,'\\');
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
349 if(begin){
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
350 begin++;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
351 }else{
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
352 begin=file;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
353 }
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
354 }
439
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
355 end=strrchr(file,'.');
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
356 strncat(phobos, begin, end-begin);
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
357 strcat(phobos, "(");
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
358 strcat(phobos, line);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
359 strcat(phobos, ")");
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
360
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
361 phobosLong = malloc(strlen(file)+strlen(line)+5);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
362 phobosLong[0]='\x00';
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
363 strcat(phobosLong, file);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
364 strcat(phobosLong, "(");
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
365 strcat(phobosLong, line);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
366 strcat(phobosLong, ")");
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
367
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
368 }else{
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
369 phobos = malloc(strlen(file)+2);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
370 phobos[0]='\x00';
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
371 begin=strrchr(file,'/');
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
372 if(begin){
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
373 begin++;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
374 }else{
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
375 begin=strrchr(file,'\\');
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
376 if(begin){
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
377 begin++;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
378 }else{
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
379 begin=file;
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
380 }
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
381 }
439
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
382 end=strrchr(file,'.');
edb0923c9159 cleanup for Linux(gcc)
thomask
parents: 438
diff changeset
383 strncat(phobos, begin, end-begin);
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
384 strcat(phobos, "(");
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
385
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
386 phobosLong = malloc(strlen(file)+2);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
387 phobosLong[0]='\x00';
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
388 strcat(phobosLong, file);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
389 strcat(phobosLong, "(");
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
390 }
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
391 }else if(line!=NULL){
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
392 phobos = malloc(strlen(line)+3);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
393 phobos[0]='\x00';
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
394 strcat(phobos, "(");
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
395 strcat(phobos, line);
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
396 strcat(phobos, ")");
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
397
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
398 phobosLong=NULL;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
399 }else{
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
400 return 1;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
401 }
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
402
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
403 /* specific error messages */
432
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
404
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
405 if( (phobos && strstr(buffer, phobos))
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
406 || (phobosLong && strstr(buffer, phobosLong)))
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
407 {
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
408 back=1;
db4b6169a99d 1) implemented checkRuntimeErrorMessage
thomask
parents: 429
diff changeset
409 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
410
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
411 return back;
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
412 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
413
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
414 int hadExecCrash(const char* buffer){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
415 if(strstr(buffer, "Segmentation fault")
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
416 || strstr(buffer, "Internal error")
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
417 || strstr(buffer, "gcc.gnu.org/bugs")
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
418 || strstr(buffer, "EXIT CODE: signal"))
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
419 {
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
420 return 1;
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
421 }
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
422 return 0;
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
423 }
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
424
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
425 /* system call with time-out */
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
426 int crashRun(const char* cmd){
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
427 #ifdef USE_POSIX
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
428 char* buffer=malloc(4+strlen(CRASH_RUN)+strlen(cmd));
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
429 buffer[0]='\x00';
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
430 strcat(buffer, "\"");
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
431 strcat(buffer, CRASH_RUN);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
432 strcat(buffer, "\" ");
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
433 strcat(buffer, cmd);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
434 system(buffer);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
435 buffer=loadFile(TLOG);
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
436
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
437 if(strstr(buffer, "EXIT CODE: 0")){
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
438 return EXIT_SUCCESS;
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
439 }else if(strstr(buffer, "EXIT CODE: 256")
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
440 || strstr(buffer, "EXIT CODE: timeout"))
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
441 {
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
442 return EXIT_FAILURE;
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
443 }else{
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
444 return RAND_MAX;
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
445 }
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
446 #else
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
447
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
448 #error no crashRun implementation present
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
449
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
450 #endif /* USE_POSIX else */
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
451 }
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
452
254
a39162afcc94 MSWindows port of "dstress.c"
thomask
parents: 251
diff changeset
453
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
454 int main(int argc, char* arg[]){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
455 char* compiler; /* the compiler - from enviroment flag "DMD" */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
456 char* cmd_arg_general; /* additional arguments - from enviroment flag "DFLAGS" */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
457 char* cmd_arg_case; /* additional arguments - from the testcase file */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
458 char* buffer; /* general purpos buffer */
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
459 int modus; /* test modus: RUN NORUN COMPILE NOCOMPILE */
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
460 int res; /* return code from external executions */
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
461 char* case_file;
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
462 char* error_file; /* expected sourcefile containing the error */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
463 char* error_line; /* expected error line */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
464 int good_error; /* error contained file and line and matched the expectations */
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
465
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
466 /* check arguments */
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
467 if(argc != 3){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
468 err:
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
469 if(argc!=0)
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
470 fprintf(stderr,"%s <run|norun|compile|nocompile> <source>\n", arg[0]);
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
471 else
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
472 fprintf(stderr,"dstress <run|norun|compile|nocompile> <source>\n");
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
473 exit(EXIT_FAILURE);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
474 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
475
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
476 if(0==strcmp(arg[1], "run") || 0==strcmp(arg[1], "RUN")){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
477 modus = RUN;
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
478 }else if(0==strcmp(arg[1], "norun") || 0==strcmp(arg[1], "NORUN")){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
479 modus = NORUN;
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
480 }else if(0==strcmp(arg[1], "compile") || 0==strcmp(arg[1], "COMPILE")){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
481 modus = COMPILE;
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
482 }else if(0==strcmp(arg[1], "nocompile") || 0==strcmp(arg[1], "NOCOMPILE")){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
483 modus = NOCOMPILE;
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
484 }else{
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
485 goto err;
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
486 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
487
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
488 /* gen flags */
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
489 case_file = cleanPathSeperator(strdup(arg[2]));
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
490 compiler = getCompiler();
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
491 cmd_arg_general = getGeneralFlags();
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
492 buffer = loadFile(case_file);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
493
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
494 cmd_arg_case = getCaseFlag(buffer, "__DSTRESS_DFLAGS__");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
495 error_line = getCaseFlag(buffer, "__DSTRESS_ELINE__");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
496 error_file = getCaseFlag(buffer, "__DSTRESS_EFILE__");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
497
493
1418f225a81e disabled debug output
thomask
parents: 490
diff changeset
498 #ifdef DEBUG
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
499 fprintf(stderr, "case: \"%s\"\n", case_file);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
500 fprintf(stderr, "compiler: \"%s\"\n", compiler);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
501 fprintf(stderr, "DFLAGS G: \"%s\"\n", cmd_arg_general);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
502 fprintf(stderr, "DFLAGS C: \"%s\"\n", cmd_arg_case);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
503 fprintf(stderr, "ELINE : \"%s\"\n", error_line);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
504 fprintf(stderr, "EFILE : \"%s\"\n", error_file);
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
505 #endif
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
506
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
507 /* strip spaces */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
508 while(error_line[0]==' '){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
509 error_line++;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
510 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
511 for(buffer=error_line+strlen(error_line)-1; buffer && buffer[0]==' '; buffer=error_line+strlen(error_line)-1){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
512 buffer[0]='\x00';
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
513 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
514 while(error_file[0]==' '){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
515 error_file++;
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
516 }
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
517 for(buffer=error_file+strlen(error_file)-1; buffer && buffer[0]==' '; buffer=error_file+strlen(error_file)-1){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
518 buffer[0]='\x00';
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
519 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
520
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
521 /* set implicit source file */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
522 if(strcmp(error_line, "")!=0 && strcmp(error_file, "")==0){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
523 error_file=case_file;
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
524 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
525
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
526 /* start working */
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
527 if(modus==COMPILE || modus==NOCOMPILE){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
528 /* gen command */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
529 buffer = malloc(strlen(compiler)+strlen(cmd_arg_general)+strlen(cmd_arg_case)+strlen(OBJ)
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
530 +strlen(case_file)+strlen(TLOG)+64);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
531 buffer[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
532 strcat(buffer, compiler);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
533 strcat(buffer, " ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
534 strcat(buffer, cmd_arg_general);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
535 strcat(buffer, " ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
536 strcat(buffer, cmd_arg_case);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
537 strcat(buffer, " -c ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
538 if(NULL==strstr(buffer, "-od")){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
539 strcat(buffer, OBJ);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
540 strcat(buffer, " ");
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
541 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
542 strcat(buffer, case_file);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
543 strcat(buffer, " 1> ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
544 strcat(buffer, TLOG);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
545 strcat(buffer, " 2>&1");
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
546
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
547 /* test */
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
548 if(modus==COMPILE){
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
549 fprintf(stderr, "compile: %s\n", buffer);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
550 }else{
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
551 fprintf(stderr, "nocompile: %s\n", buffer);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
552 }
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
553 res = crashRun(buffer);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
554
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
555 /* diagnostic */
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
556 buffer = loadFile(TLOG);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
557 fprintf(stderr, "%s\n", buffer);
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
558 good_error = checkErrorMessage(error_file, error_line, buffer);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
559
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
560 if(hadExecCrash(buffer)){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
561 printf("ERROR:\t%s [internal compiler error]\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
562 }else if(modus==COMPILE){
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
563 if(res==EXIT_SUCCESS){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
564 printf("PASS: \t%s\n", case_file);
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
565 }else if(res==EXIT_FAILURE && good_error){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
566 if(checkErrorMessage(case_file, "", buffer)){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
567 printf("FAIL: \t%s\n", case_file);
373
177ce8d13eac test cases that unexpectetly fail and in addition fail to provide file/line information are now treated as ERROR instead of FAIL
thomask
parents: 361
diff changeset
568 }else{
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
569 printf("ERROR:\t%s [bad error message]\n", case_file);
373
177ce8d13eac test cases that unexpectetly fail and in addition fail to provide file/line information are now treated as ERROR instead of FAIL
thomask
parents: 361
diff changeset
570 }
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
571 }else if(good_error){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
572 printf("ERROR:\t%s\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
573 }else{
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
574 printf("ERROR:\t%s [bad error message]\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
575 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
576 }else{
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
577 if(res==EXIT_FAILURE){
361
0147a35cbeb7 dif. fixes 5
thomask
parents: 340
diff changeset
578 if(good_error){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
579 printf("XFAIL:\t%s\n", case_file);
361
0147a35cbeb7 dif. fixes 5
thomask
parents: 340
diff changeset
580 }else{
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
581 printf("FAIL: \t%s [bad error message]\n", case_file);
361
0147a35cbeb7 dif. fixes 5
thomask
parents: 340
diff changeset
582 }
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
583 }else if(res==EXIT_SUCCESS){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
584 printf("XPASS:\t%s\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
585 }else{
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
586 printf("ERROR:\t%s\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
587 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
588 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
589 fprintf(stderr,"--------\n");
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
590 }else if(modus==RUN || modus==NORUN){
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
591 /* gen command */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
592 buffer = malloc(strlen(compiler)+strlen(cmd_arg_general)+strlen(cmd_arg_case)+strlen(OBJ)
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
593 +strlen(case_file)*2+strlen(TLOG)+64);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
594 buffer[0]='\x00';
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
595 strcat(buffer, compiler);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
596 strcat(buffer, " ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
597 strcat(buffer, cmd_arg_general);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
598 strcat(buffer, " ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
599 strcat(buffer, cmd_arg_case);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
600 strcat(buffer, " ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
601 if(NULL==strstr(buffer, "-od")){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
602 strcat(buffer, OBJ);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
603 strcat(buffer, " ");
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
604 }
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
605 if(NULL==strstr(buffer, "-of")){
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
606 strcat(buffer, "-of");
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
607 strcat(buffer, case_file);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
608 strcat(buffer, ".exe ");
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
609 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
610 strcat(buffer, case_file);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
611 strcat(buffer, " 1> ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
612 strcat(buffer, TLOG);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
613 strcat(buffer, " 2>&1");
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
614
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
615 /* test 1/2 */
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
616 if(modus==RUN){
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
617 fprintf(stderr, "run: %s\n", buffer);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
618 }else{
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
619 fprintf(stderr, "norun: %s\n", buffer);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
620 }
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
621 res = crashRun(buffer);
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
622
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
623 /* diagnostic 1/2 */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
624 buffer = loadFile(TLOG);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
625 fprintf(stderr, "%s", buffer);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
626 good_error = checkErrorMessage(error_file, error_line, buffer);
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
627 if(hadExecCrash(buffer)){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
628 printf("ERROR:\t%s [internal compiler error]\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
629 fprintf(stderr, "\n--------\n");
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
630 return EXIT_SUCCESS;
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
631 }else if(res==EXIT_FAILURE && good_error){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
632 printf("FAIL: \t%s\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
633 fprintf(stderr, "\n--------\n");
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
634 return EXIT_SUCCESS;
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
635 }else if(res!=EXIT_SUCCESS){
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
636 if(good_error){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
637 printf("ERROR:\t%s\n", case_file);
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
638 }else{
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
639 printf("ERROR:\t%s [bad error message]\n", case_file);
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
640 }
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
641 fprintf(stderr, "\n--------\n");
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
642 return EXIT_SUCCESS;
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
643 }
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
644
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
645 /* test 2/2 */
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
646 buffer = malloc(strlen(case_file) + strlen(TLOG) + 24);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
647 *buffer = '\x00';
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
648 strcat(buffer, case_file);
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
649 strcat(buffer, ".exe 1> ");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
650 strcat(buffer, TLOG);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
651 strcat(buffer, " 2>&1");
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
652 fprintf(stderr, "%s\n", buffer);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
653 res=crashRun(buffer);
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
654
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
655 /* diagnostic 2/2 */
339
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
656 buffer = loadFile(TLOG);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
657 fprintf(stderr, "%s\n", buffer);
a74c84e75682 added error line tests (__DSTRESS_ELINE__ / __DSTRESS_EFILE__)
thomask
parents: 292
diff changeset
658 good_error = checkRuntimeErrorMessage(error_file, error_line, buffer);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
659 if(modus==RUN){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
660 if(hadExecCrash(buffer)){
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
661 if(good_error){
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
662 printf("ERROR:\t%s [test case crash]\"", case_file);
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
663 }else{
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
664 printf("ERROR:\t%s [test case crash] [bad error message]\"", case_file);
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
665 }
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
666 }else if(res==EXIT_SUCCESS){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
667 printf("PASS: \t%s\n", case_file);
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
668 }else if(res==EXIT_FAILURE && good_error){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
669 printf("FAIL: \t%s\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
670 }else{
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
671 if(good_error){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
672 printf("ERROR:\t%s\n", case_file);
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
673 }else{
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
674 printf("ERROR:\t%s [bad error message]\n", case_file);
437
1b4034b27e93 added "[bad error message]" output
thomask
parents: 436
diff changeset
675 }
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
676 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
677 }else{
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
678 if(res==EXIT_FAILURE){
361
0147a35cbeb7 dif. fixes 5
thomask
parents: 340
diff changeset
679 if(good_error){
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
680 printf("XFAIL:\t%s\n", case_file);
361
0147a35cbeb7 dif. fixes 5
thomask
parents: 340
diff changeset
681 }else{
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
682 printf("FAIL: \t%s [bad errror message]\n", case_file);
361
0147a35cbeb7 dif. fixes 5
thomask
parents: 340
diff changeset
683 }
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 476
diff changeset
684 }else if(res==EXIT_SUCCESS){
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
685 printf("XPASS:\t%s\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
686 }else{
499
0434764d4a66 removed redundancy in the output
thomask
parents: 493
diff changeset
687 printf("ERROR:\t%s\n", case_file);
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
688 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
689 }
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
690 fprintf(stderr, "--------\n");
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
691 }else{
438
27039d5cbe81 partial cleanup for Windows(dmc)
thomask
parents: 437
diff changeset
692 printf("@bug@ %d (%s)\n", modus, case_file);
436
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
693 return EXIT_FAILURE;
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
694 }
436
5e210bace0f1 added "File not found" clause
thomask
parents: 432
diff changeset
695 return EXIT_SUCCESS;
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents:
diff changeset
696 }