6c76366e362f1941c584673e6e51d95f2a2f3b26
[nit.git] / tests / tests.sh
1 #!/bin/bash
2 # This file is part of NIT ( http://www.nitlanguage.org ).
3 #
4 # Copyright 2004-2008 Jean Privat <jean@pryen.org>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18 # This shell script compile, run and verify Nit program files
19
20 # Set lang do default to avoid failed tests because of locale
21 export LANG=C
22 export LC_ALL=C
23 export NIT_TESTING=true
24 export MNIT_SRAND=0
25
26 unset NIT_DIR
27
28 # Get the first Java lib available
29 shopt -s nullglob
30 JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac))))
31
32 paths=`echo $JAVA_HOME/jre/lib/*/{client,server}/libjvm.so`
33 paths=($paths)
34 JNI_LIB_PATH=`dirname ${paths[0]}`
35 shopt -u nullglob
36
37 outdir="out"
38 compdir=".nit_compile"
39
40 usage()
41 {
42 e=`basename "$0"`
43 cat<<END
44 Usage: $e [options] modulenames
45 -o option Pass option to the engine
46 -v Verbose (show tests steps)
47 -h This help
48 --engine Use a specific engine (default=nitc)
49 --noskip Do not skip a test even if the .skip file matches
50 --outdir Use a specific output folder (default=out/)
51 --compdir Use a specific temporary compilation folder (default=.nit_compile)
52 --node Run as a node in parallel, will not output context information
53 END
54 }
55
56 # Run a command with a timeout and a time count.
57 # Options:
58 # -o file write the user time into file (REQUIRED). see `-o` in `man time`
59 # -a append the time to the file (instead of overwriting it). see `-a` in `man time`
60 saferun()
61 {
62 local stop=false
63 local o=
64 local a=
65 while [ $stop = false ]; do
66 case "$1" in
67 -o) o="$2"; shift; shift;;
68 -a) a="-a"; shift;;
69 *) stop=true
70 esac
71 done
72 if test -n "$TIME"; then
73 $TIME -o "$o" $a $TIMEOUT "$@"
74 else
75 if test -n "$a"; then echo 0 >> "$o"; else echo 0 > "$o"; fi
76 $TIMEOUT "$@"
77 fi
78 }
79
80 # Output a timestamp attribute for XML, or an empty line
81 timestamp()
82 {
83 if test -n "$TIMESTAMP"; then
84 echo "timestamp='`$TIMESTAMP`'"
85 else
86 echo ""
87 fi
88
89 }
90
91 # Get platform specific commands ##########################
92
93 # Detect a working timeout
94 if sh -c "timelimit echo" 1>/dev/null 2>&1; then
95 TIMEOUT="timelimit -t 600"
96 elif sh -c "timeout 1 echo" 1>/dev/null 2>&1; then
97 TIMEOUT="timeout 600s"
98 else
99 echo "No timelimit or timeout command detected. Tests may hang :("
100 fi
101
102 # Detect a working time command
103 if env time --quiet -f%U true 2>/dev/null; then
104 TIME="env time --quiet -f%U"
105 elif env time -f%U true 2>/dev/null; then
106 TIME="env time -f%U"
107 else
108 TIME=
109 fi
110
111 # Detect a working date command
112 if date -Iseconds >/dev/null 2>&1; then
113 TIMESTAMP="date -Iseconds"
114 else
115 TIMESTAMP=
116 fi
117
118 # $1 is the pattern of the test
119 # $2 is the file to compare to
120 # the result is:
121 # 0: if the file to compare to do not exists
122 # 1: if the file match
123 # 2: if the file match with soso
124 # 3: if the file do not match
125 function compare_to_result()
126 {
127 local pattern="$1"
128 local sav="$2"
129 if [ ! -r "$sav" ]; then return 0; fi
130 test "`cat -- "$sav"`" = "UNDEFINED" && return 1
131 diff -u -- "$sav" "$outdir/$pattern.res" > "$outdir/$pattern.diff.sav.log"
132 if [ "$?" == 0 ]; then
133 return 1
134 fi
135 sed '/[Ww]arning/d;/[Ee]rror/d' "$outdir/$pattern.res" > "$outdir/$pattern.res2"
136 sed '/[Ww]arning/d;/[Ee]rror/d' "$sav" > "$outdir/$pattern.sav2"
137 grep '[Ee]rror' "$outdir/$pattern.res" >/dev/null && echo "Error" >> "$outdir/$pattern.res2"
138 grep '[Ee]rror' "$sav" >/dev/null && echo "Error" >> "$outdir/$pattern.sav2"
139 diff -u "$outdir/$pattern.sav2" "$outdir/$pattern.res2" > "$outdir/$pattern.diff.sav.log2"
140 if [ "$?" == 0 ]; then
141 return 2
142 else
143 return 3
144 fi
145 }
146
147 function xmlesc()
148 {
149 sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g'<<EOF
150 $*
151 EOF
152 }
153
154 # As argument: the pattern used for the file
155 function process_result()
156 {
157 # Result
158 pattern=$1
159 description=$2
160 pack=$3
161 SAV=""
162 NSAV=""
163 FIXME=""
164 NFIXME=""
165 SOSO=""
166 NSOSO=""
167 SOSOF=""
168 NSOSOF=""
169 OLD=""
170 LIST=""
171 FIRST=""
172 echo >>$xml "<testcase classname='`xmlesc "$pack"`' name='`xmlesc "$description"`' time='`cat -- "$outdir/$pattern.time.out"`' `timestamp`>"
173 #for sav in "sav/$engine/fixme/$pattern.res" "sav/$engine/$pattern.res" "sav/fixme/$pattern.res" "sav/$pattern.res" "sav/$pattern.sav"; do
174 for savdir in $savdirs; do
175 sav=$savdir/fixme/$pattern.res
176 compare_to_result "$pattern" "$sav"
177 case "$?" in
178 0)
179 ;; # no file
180 1)
181 OLD="$LIST"
182 FIXME="$sav"
183 LIST="$LIST $sav"
184 ;;
185 2)
186 if [ -z "$FIRST" ]; then
187 SOSOF="$sav"
188 FIRST="$sav"
189 fi
190 LIST="$LIST $sav"
191 ;;
192 3)
193 if [ -z "$FIRST" ]; then
194 NFIXME="$sav"
195 FIRST="$sav"
196 fi
197 LIST="$LIST $sav"
198 ;;
199 esac
200
201 sav=$savdir/$pattern.res
202 compare_to_result "$pattern" "$sav"
203 case "$?" in
204 0)
205 ;; # no file
206 1)
207 OLD="$LIST"
208 SAV="$sav"
209 LIST="$LIST $sav"
210 ;;
211 2)
212 if [ -z "$FIRST" ]; then
213 SOSO="$sav"
214 FIRST="$sav"
215 fi
216 LIST="$LIST $sav"
217 ;;
218 3)
219 if [ -z "$FIRST" ]; then
220 NSAV="$sav"
221 FIRST="$sav"
222 fi
223 LIST="$LIST $sav"
224 ;;
225 esac
226 done
227 OLD=`echo "$OLD" | sed -e 's/ */ /g' -e 's/^ //' -e 's/ $//'`
228 grep 'NOT YET IMPLEMENTED' "$outdir/$pattern.res" >/dev/null
229 NYI="$?"
230 if [ -n "$SAV" ]; then
231 if [ -n "$OLD" ]; then
232 echo "[*ok*] $outdir/$pattern.res $SAV - but $OLD remains!"
233 echo >>$xml "<error message='`xmlesc "ok $outdir/$pattern.res - but $OLD remains"`'/>"
234 remains="$remains $OLD"
235 else
236 echo "[ok] $outdir/$pattern.res $SAV"
237 fi
238 ok="$ok $pattern"
239 elif [ -n "$FIXME" ]; then
240 if [ -n "$OLD" ]; then
241 echo "[*fixme*] $outdir/$pattern.res $FIXME - but $OLD remains!"
242 echo >>$xml "<error message='`xmlesc "ok $outdir/$pattern.res - but $OLD remains"`'/>"
243 remains="$remains $OLD"
244 else
245 echo "[fixme] $outdir/$pattern.res $FIXME"
246 echo >>$xml "<skipped/>"
247 fi
248 todos="$todos $pattern"
249 elif [ "x$NYI" = "x0" ]; then
250 echo "[todo] $outdir/$pattern.res -> not yet implemented"
251 echo >>$xml "<skipped/>"
252 todos="$todos $pattern"
253 elif [ -n "$SOSO" ]; then
254 echo "[======= soso $outdir/$pattern.res $SOSO =======]"
255 echo >>$xml "<error message='`xmlesc "soso $outdir/$pattern.res $SOSO"`'/>"
256 echo >>$xml "<system-out><![CDATA["
257 cat -v -- "$outdir/$pattern.diff.sav.log" | head >>$xml -n 50
258 echo >>$xml "]]></system-out>"
259 nok="$nok $pattern"
260 echo "$ii" >> "$ERRLIST"
261 elif [ -n "$SOSOF" ]; then
262 echo "[======= fixme soso $outdir/$pattern.res $SOSOF =======]"
263 echo >>$xml "<error message='`xmlesc "soso $outdir/$pattern.res $SOSO"`'/>"
264 echo >>$xml "<system-out><![CDATA["
265 cat -v -- "$outdir/$pattern.diff.sav.log" | head >>$xml -n 50
266 echo >>$xml "]]></system-out>"
267 nok="$nok $pattern"
268 echo "$ii" >> "$ERRLIST"
269 elif [ -n "$NSAV" ]; then
270 echo "[======= fail $outdir/$pattern.res $NSAV =======]"
271 echo >>$xml "<error message='`xmlesc "fail $outdir/$pattern.res $NSAV"`'/>"
272 echo >>$xml "<system-out><![CDATA["
273 cat -v -- "$outdir/$pattern.diff.sav.log" | head >>$xml -n 50
274 echo >>$xml "]]></system-out>"
275 nok="$nok $pattern"
276 echo "$ii" >> "$ERRLIST"
277 elif [ -n "$NFIXME" ]; then
278 echo "[======= changed $outdir/$pattern.res $NFIXME ======]"
279 echo >>$xml "<error message='`xmlesc "changed $outdir/$pattern.res $NFIXME"`'/>"
280 echo >>$xml "<system-out><![CDATA["
281 cat -v -- "$outdir/$pattern.diff.sav.log" | head >>$xml -n 50
282 echo >>$xml "]]></system-out>"
283 nok="$nok $pattern"
284 echo "$ii" >> "$ERRLIST"
285 elif [ -s "$outdir/$pattern.res" ]; then
286 echo "[=== no sav ===] $outdir/$pattern.res is not empty"
287 echo >>$xml "<error message='no sav and not empty'/>"
288 echo >>$xml "<system-out><![CDATA["
289 cat -v >>$xml -- "$outdir/$pattern.res"
290 echo >>$xml "]]></system-out>"
291 nos="$nos $pattern"
292 echo "$ii" >> "$ERRLIST"
293 else
294 # no sav but empty res
295 echo "[0k] $outdir/$pattern.res is empty"
296 ok="$ok $pattern"
297 fi
298 if test -s "$outdir/$pattern.cmp.err"; then
299 echo >>$xml "<system-err><![CDATA["
300 cat -v >>$xml -- "$outdir/$pattern.cmp.err"
301 echo >>$xml "]]></system-err>"
302 fi
303 echo >>$xml "</testcase>"
304 }
305
306 need_skip()
307 {
308 test "$noskip" = true && return 1
309 if echo "$1" | grep -f "$engine.skip" >/dev/null 2>&1; then
310 echo "=> $2: [skip]"
311 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
312 return 0
313 fi
314 if test -n "$isinterpret" && echo "$1" | grep -f "exec.skip" >/dev/null 2>&1; then
315 echo "=> $2: [skip exec]"
316 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
317 return 0
318 fi
319
320 # Skip by OS
321 os_skip_file=`uname`.skip
322 if test -e $os_skip_file && echo "$1" | grep -f "$os_skip_file" >/dev/null 2>&1; then
323 echo "=> $2: [skip os]"
324 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
325 return 0
326 fi
327 return 1
328 }
329
330 skip_exec()
331 {
332 test "$noskip" = true && return 1
333 if echo "$1" | grep -f "exec.skip" >/dev/null 2>&1; then
334 echo -n "_ "
335 return 0
336 fi
337 return 1
338 }
339
340 skip_cc()
341 {
342 test "$noskip" = true && return 1
343 if echo "$1" | grep -f "cc.skip" >/dev/null 2>&1; then
344 return 0
345 fi
346 return 1
347 }
348
349 find_nitc()
350 {
351 name="$enginebinname"
352 recent=`ls -t ../src/$name ../src/$name_[0-9] ../bin/$name ../c_src/$name 2>/dev/null | head -1`
353 if [[ "x$recent" == "x" ]]; then
354 echo "Could not find binary for engine $engine, aborting"
355 exit 1
356 fi
357 if [ "x$isnode" = "xfalse" ]; then
358 echo "Found binary for engine $engine: $recent $OPT"
359 fi
360 NITC=$recent
361 }
362
363 verbose=false
364 isnode=false
365 stop=false
366 engine=nitc
367 noskip=
368 savdirs=
369 while [ $stop = false ]; do
370 case $1 in
371 -o) OPT="$OPT $2"; shift; shift;;
372 -v) verbose=true; shift;;
373 -h) usage; exit;;
374 --engine) engine="$2"; shift; shift;;
375 --noskip) noskip=true; shift;;
376 --outdir) outdir="$2"; shift; shift;;
377 --compdir) compdir="$2"; shift; shift;;
378 --node) isnode=true; shift;;
379 *) stop=true
380 esac
381 done
382 enginebinname=$engine
383 isinterpret=
384 case $engine in
385 nitc|nitg)
386 engine=nitg-s;
387 enginebinname=nitc;
388 OPT="--separate $OPT --compile-dir $compdir"
389 savdirs="sav/nitg-common/"
390 ;;
391 nitcs|nitg-s)
392 enginebinname=nitc;
393 OPT="--separate $OPT --compile-dir $compdir"
394 savdirs="sav/nitg-common/"
395 ;;
396 nitce|nitg-e)
397 enginebinname=nitc;
398 OPT="--erasure $OPT --compile-dir $compdir"
399 savdirs="sav/nitg-common/"
400 ;;
401 nitcsg|nitg-sg)
402 enginebinname=nitc;
403 OPT="--semi-global $OPT --compile-dir $compdir"
404 savdirs="sav/nitg-common/"
405 ;;
406 nitcg|nitg-g)
407 enginebinname=nitc;
408 OPT="--global $OPT --compile-dir $compdir"
409 savdirs="sav/nitg-common/"
410 ;;
411 nit)
412 engine=niti
413 isinterpret=true
414 ;;
415 niti)
416 enginebinname=nit
417 isinterpret=true
418 ;;
419 nitvm)
420 isinterpret=true
421 enginebinname=nit
422 OPT="--vm $OPT"
423 savdirs="sav/niti/"
424 ;;
425 emscripten)
426 enginebinname=nitc
427 OPT="-m emscripten_nodejs.nit --semi-global $OPT --compile-dir $compdir"
428 savdirs="sav/nitg-sg/"
429 ;;
430 nitc)
431 echo "disabled engine $engine"
432 exit 0
433 ;;
434 *)
435 echo "unknown engine $engine"
436 exit 1
437 ;;
438 esac
439
440 savdirs="sav/$engine $savdirs sav/"
441
442 # The default nitc compiler
443 [ -z "$NITC" ] && find_nitc
444
445 # Set NIT_DIR if needed
446 [ -z "$NIT_DIR" ] && export NIT_DIR=..
447
448 # Mark to distinguish files among tests
449 # MARK=
450
451 if [ $# = 0 ]; then
452 usage;
453 exit
454 fi
455
456 # CLEAN the out directory
457 rm -rf "$outdir/" 2>/dev/null
458 mkdir "$outdir" 2>/dev/null
459
460 # File where error tests are outputed
461 # Old ERRLIST is backuped
462 ERRLIST=${ERRLIST:-errlist}
463 ERRLIST_TARGET=$ERRLIST
464
465 # Initiate new ERRLIST
466 if [ "x$ERRLIST" = "x" ]; then
467 ERRLIST=/dev/null
468 else
469 ERRLIST=$ERRLIST.tmp
470 > "$ERRLIST"
471 fi
472
473 ok=""
474 nok=""
475 todos=""
476
477 if [ "x$XMLDIR" = "x" ]; then
478 xml="tests-$engine.xml"
479 else
480 sum=`echo $@ | md5sum | cut -f1 -d " "`
481 xml="$XMLDIR/tests-$engine-$sum.xml"
482 mkdir -p "$XMLDIR"
483 fi
484
485 echo >$xml "<testsuites><testsuite>"
486
487 for ii in "$@"; do
488 if [ ! -f "$ii" ]; then
489 echo "File '$ii' does not exist."
490 continue
491 fi
492 f=`basename -- "$ii" .nit`
493
494 pack="tests.${engine}".`echo $ii | perl -p -e 's|^../([^/]*)/([a-zA-Z_]*).*|\1.\2| || s|^([a-zA-Z]*)[^_]*_([a-zA-Z]*).*|\1.\2| || s|\W*([a-zA-Z_]*).*|\1|'`
495
496 # Sould we skip the file for this engine?
497 need_skip "$f" "$f" "$pack" && continue
498
499 tmp=${ii/../AA}
500 if [ "x$tmp" = "x$ii" ]; then
501 includes="-I . -I ../lib/standard -I ../lib/standard/collection -I alt"
502 else
503 includes="-I alt"
504 fi
505
506 for i in "$ii" `./alterner.pl --start '#' --altsep '_' -- "$ii"`; do
507 bf=`basename -- "$i" .nit`
508 ff="$outdir/$bf"
509
510 # Sould we skip the alternative for this engine?
511 need_skip "$bf" "$bf" "$pack" && continue
512
513 echo -n "=> $bf: "
514
515 if [ -f "$f.inputs" ]; then
516 inputs="$f.inputs"
517 export MNIT_READ_INPUT="$f.inputs"
518 else
519 inputs=/dev/null
520 export MNIT_READ_INPUT=/dev/null
521 fi
522
523 ffout="$ff.bin"
524 if [ "$engine" = "emscripten" ]; then
525 ffout="$ff.bin.js"
526 fi
527
528 if [ -n "$isinterpret" ]; then
529 cat > "$ff.bin" <<END
530 exec $NITC --no-color $OPT $includes -- $(printf '%q' "$i") "\$@"
531 END
532 chmod +x "$ff.bin"
533 > "$ff.cmp.err"
534 > "$ff.compile.log"
535 ERR=0
536 echo 0.0 > "$ff.time.out"
537 else
538 if skip_cc "$bf"; then
539 nocc="--no-cc"
540 else
541 nocc=
542 fi
543 # Compile
544 if [ "x$verbose" = "xtrue" ]; then
545 echo ""
546 echo $NITC --no-color $OPT -o "$ffout" "$includes" $nocc "$i"
547 fi
548 NIT_NO_STACK=1 JNI_LIB_PATH=$JNI_LIB_PATH JAVA_HOME=$JAVA_HOME \
549 saferun -o "$ff.time.out" $NITC --no-color $OPT -o "$ffout" $includes $nocc "$i" 2> "$ff.cmp.err" > "$ff.compile.log"
550 ERR=$?
551 if [ "x$verbose" = "xtrue" ]; then
552 cat -- "$ff.compile.log"
553 cat >&2 -- "$ff.cmp.err"
554 fi
555 fi
556 if [ "$engine" = "emscripten" ]; then
557 echo > "$ff.bin" "nodejs $ffout \"\$@\""
558 chmod +x "$ff.bin"
559 if grep "Fatal Error: more than one primitive class" "$ff.compile.log" > /dev/null; then
560 echo " [skip] do no not imports kernel"
561 echo >>$xml "<testcase classname='`xmlesc "$pack"`' name='`xmlesc "$bf"`' `timestamp`><skipped/></testcase>"
562 continue
563 fi
564 fi
565 if [ "$ERR" != 0 ]; then
566 echo -n "! "
567 cat -- "$ff.compile.log" "$ff.cmp.err" > "$ff.res"
568 process_result "$bf" "$bf" "$pack"
569 elif [ -n "$nocc" ]; then
570 # not compiled
571 echo -n "nocc "
572 > "$ff.res"
573 process_result "$bf" "$bf" "$pack"
574 elif [ -x "$ff.bin" ]; then
575 if skip_exec "$bf"; then
576 # No exec
577 > "$ff.res"
578 process_result "$bf" "$bf" "$pack"
579 break
580 fi
581 echo -n ". "
582 # Execute
583 args=""
584 if [ "x$verbose" = "xtrue" ]; then
585 echo ""
586 echo "NIT_NO_STACK=1 $ff.bin" $args
587 fi
588 NIT_NO_STACK=1 LD_LIBRARY_PATH=$JNI_LIB_PATH \
589 saferun -a -o "$ff.time.out" "$ff.bin" $args < "$inputs" > "$ff.res" 2>"$ff.err"
590 mv "$ff.time.out" "$ff.times.out"
591 awk '{ SUM += $1} END { print SUM }' "$ff.times.out" > "$ff.time.out"
592
593 if [ "x$verbose" = "xtrue" ]; then
594 cat -- "$ff.res"
595 cat >&2 -- "$ff.err"
596 fi
597 if [ -f "$ff.write" ]; then
598 cat -- "$ff.write" >> "$ff.res"
599 elif [ -d "$ff.write" ]; then
600 LANG=C /bin/ls -F "$ff.write" >> "$ff.res"
601 fi
602 cp -- "$ff.res" "$ff.res2"
603 cat -- "$ff.cmp.err" "$ff.err" "$ff.res2" > "$ff.res"
604 process_result "$bf" "$bf" "$pack"
605
606 if [ -f "$f.args" ]; then
607 fargs=$f.args
608 cptr=0
609 while read line; do
610 ((cptr=cptr+1))
611 args="$line"
612 bff=$bf"_args"$cptr
613 fff=$ff"_args"$cptr
614 name="$bf args $cptr"
615
616 # Sould we skip the input for this engine?
617 need_skip "$bff" " $name" "$pack" && continue
618
619 # use a specific inputs file, if required
620 if [ -f "$bff.inputs" ]; then
621 ffinputs="$bff.inputs"
622 else
623 ffinputs="$inputs"
624 fi
625
626 rm -rf "$fff.res" "$fff.err" "$fff.write" 2> /dev/null
627 if [ "x$verbose" = "xtrue" ]; then
628 echo ""
629 echo "NIT_NO_STACK=1 $ff.bin" $args
630 fi
631 echo -n "==> $name "
632 echo "$ff.bin $args" > "$fff.bin"
633 chmod +x "$fff.bin"
634 WRITE="$fff.write" saferun -o "$fff.time.out" sh -c "NIT_NO_STACK=1 $fff.bin < $ffinputs > $fff.res 2>$fff.err"
635 if [ "x$verbose" = "xtrue" ]; then
636 cat -- "$fff.res"
637 cat >&2 -- "$fff.err"
638 fi
639 if [ -f "$fff.write" ]; then
640 cat -- "$fff.write" >> "$fff.res"
641 elif [ -d "$fff.write" ]; then
642 LANG=C /bin/ls -F -- "$fff.write" >> "$fff.res"
643 fi
644 if [ -s "$fff.err" ]; then
645 cp -- "$fff.res" "$fff.res2"
646 cat -- "$fff.err" "$fff.res2" > "$fff.res"
647 fi
648 process_result "$bff" " $name" "$pack"
649 done < "$fargs"
650 fi
651 elif [ -f "$ff.bin" ]; then
652 #Not executable (platform?)"
653 > "$ff.res"
654 process_result "$bf" "$bf" "$pack"
655 else
656 echo -n "! "
657 cat -- "$ff.cmp.err" > "$ff.res"
658 echo "Compilation error" > "$ff.res"
659 process_result "$bf" "$bf" "$pack"
660 fi
661 done
662 done
663
664 if [ "x$isnode" = "xfalse" ]; then
665 echo "engine: $engine ($enginebinname $OPT)"
666 echo "ok: " `echo $ok | wc -w` "/" `echo $ok $nok $nos $todos | wc -w`
667
668 if [ -n "$nok" ]; then
669 echo "fail: $nok"
670 echo "There were $(echo $nok | wc -w) errors ! (see file $ERRLIST)"
671 fi
672 if [ -n "$nos" ]; then
673 echo "no sav: $nos"
674 fi
675 if [ -n "$todos" ]; then
676 echo "todo/fixme: $todos"
677 fi
678 if [ -n "$remains" ]; then
679 echo "sav that remains: $remains"
680 fi
681 fi
682
683 # write $ERRLIST
684 if [ "x$ERRLIST" != "x" ]; then
685 if [ -f "$ERRLIST_TARGET" ]; then
686 mv "$ERRLIST_TARGET" "${ERRLIST_TARGET}.bak"
687 fi
688 uniq $ERRLIST > $ERRLIST_TARGET
689 rm $ERRLIST
690 fi
691
692 echo >>$xml "</testsuite></testsuites>"
693
694 if [ -n "$nok" ]; then
695 exit 1
696 else
697 exit 0
698 fi