2 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # Copyright 2004-2008 Jean Privat <jean@pryen.org>
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # This shell script compile, run and verify Nit program files
20 # Set lang do default to avoid failed tests because of locale
23 # Explore candidates for LC_ALL
25 # If C.UTF-8, the most agnostic UTF-8 locale is supported, we
26 # use it, otherwise we default to the UTF-8 system locale, and
27 # if unavailable, we default on C.
29 # Note that C however is not guaranteed to be UTF-8, and
30 # some tests may fail when relying on Unicode semantics.
31 locale_candidate
=C.UTF
-8
32 if ! locale
-a
2>/dev
/null |
grep -q C.UTF
-8; then
33 locale_candidate
="$(locale -a | grep -i utf8 | head -n1)"
34 if [ -z
"$locale_candidate" ]; then
38 export LC_ALL
="$locale_candidate"
41 if uname |
grep Darwin
1>/dev
/null
2>&1; then
42 export LANG
=en_US.UTF
-8
43 export LC_ALL
=en_US.UTF
-8
45 # Fix for errors on some libevent/nitcorn clients
46 export EVENT_NOKQUEUE
=1
49 export NIT_TESTING
=true
50 # Use the pid as a collision prevention
51 export NIT_TESTING_ID
=$$
54 # Identify this as a tests.sh test to differentiate from a nitunit test
55 export NIT_TESTING_TESTS_SH
=true
59 # Get the first Java lib available
60 if which_java
=$
(which javac
2>/dev
/null
); then
62 if sh
-c
"readlink -f ." 1>/dev
/null
2>&1; then
63 READLINK
="readlink -f"
68 JAVA_HOME
=$
(dirname $
(dirname $
($READLINK "$which_java")))
71 paths
=`echo $JAVA_HOME/jre/lib/*/{client,server}/libjvm.so`
72 if [ -n
"$paths" ]; then
74 JNI_LIB_PATH
=`dirname ${paths[0]}`
82 # User CPU time limit (in seconds)
83 # Is used to avoid to CPU intensive test (infinite loops). See ulimit -t
84 usertimelimit
=600 # 1 CPU minute
86 # Real-time limit (in seconds)
87 # Is used to avoid waiting or sleeping tests.
88 # Require timeout or timelimit, or else is not used.
89 realtimelimit
=300 # 5 min
91 # User limit for write files (in kilo-bytes)
92 # Is used to avoid execution that loop and fill the hard drive. See ulimit -f
93 # Note that a test might require a lot of temporary disk space (eg. nitc+gcc)
94 filelimit
=100000 # ~100MB
96 # Limit (in bytes) for generated .res file.
97 # Larger ones are truncated and will fail tests
98 # Is used to avoid processing huge crappy res file (diff, xml, etc)
99 reslimit
=100000 # ~100KB
105 Usage
: $e [options
] modulenames
106 -o option Pass option to the engine
107 -v Verbose
(show tests steps
)
109 --engine Use a specific engine
(default
=nitc
)
110 --noskip Do not skip a
test even
if the .skip
file matches
111 --outdir Use a specific output folder
(default
=out
/)
112 --compdir Use a specific temporary compilation folder
(default
=$compdir)
113 --node Run as a node
in parallel
, will not output context information
114 --autosav Copy the .res files directly
in the sav folder overriding existing .res files
118 # Run a command with a timeout and a time count.
120 # -o file write the user time into file (REQUIRED). see `-o` in `man time`
121 # -a append the time to the file (instead of overwriting it). see `-a` in `man time`
127 while [ $stop = false
]; do
129 -o
) o
="$2"; shift; shift;;
135 ulimit -f
"$filelimit" 2> /dev
/null
136 ulimit -t
"$usertimelimit" 2> /dev
/null
137 if test -d
"$1"; then
139 elif test -n
"$TIME"; then
140 $TIME -o
"$o" $a $TIMEOUT "$@"
142 if test -n
"$a"; then echo 0 >> "$o"; else echo 0 > "$o"; fi
148 # Output a timestamp attribute for XML, or an empty line
151 if test -n
"$TIMESTAMP"; then
152 echo "timestamp='`$TIMESTAMP`'"
159 # Get platform specific commands ##########################
161 # Detect a working timeout
162 if sh
-c
"timelimit echo" 1>/dev
/null
2>&1; then
163 TIMEOUT
="timelimit -t $realtimelimit"
164 elif sh
-c
"timeout 1 echo" 1>/dev
/null
2>&1; then
165 TIMEOUT
="timeout ${realtimelimit}s"
167 echo "No timelimit or timeout command detected. Tests may hang :("
170 # Detect a working time command
171 if command time --quiet
-f
%e true
2>/dev
/null
; then
172 TIME
="command time --quiet -f%e"
173 elif command time -f
%e true
2>/dev
/null
; then
174 TIME
="command time -f%e"
175 elif command gtime
-f
%e true
2>/dev
/null
; then
176 TIME
="command gtime -f%e"
181 # Detect a working date command
182 if date -Iseconds
>/dev
/null
2>&1; then
183 TIMESTAMP
="date -Iseconds"
188 # Detect a working hostname command
189 if hostname
--version
2>&1 |
grep coreutils
>/dev
/null
2>&1; then
192 HOSTNAME
="hostname -s"
195 UNAME
=`uname | sed s/-.*//`
197 # $1 is the pattern of the test
198 # $2 is the file to compare to
200 # 0: if the file to compare to do not exists
201 # 1: if the file match
202 # 2: if the file match with soso
203 # 3: if the file do not match
204 function compare_to_result
()
208 if [ ! -r
"$sav" ]; then return 0; fi
209 test "`cat -- "$sav"`" = "UNDEFINED" && return 1
210 diff -u
--strip
-trailing
-cr
-- "$sav" "$outdir/$pattern.res" > "$outdir/$pattern.diff.sav.log"
211 if [ "$?" == 0 ]; then
214 sed '/[Ww]arning/d;/[Ee]rror/d' "$outdir/$pattern.res" > "$outdir/$pattern.res2"
215 sed '/[Ww]arning/d;/[Ee]rror/d' "$sav" > "$outdir/$pattern.sav2"
216 grep '[Ee]rror' "$outdir/$pattern.res" >/dev
/null
&& echo "Error" >> "$outdir/$pattern.res2"
217 grep '[Ee]rror' "$sav" >/dev
/null
&& echo "Error" >> "$outdir/$pattern.sav2"
218 diff -u
--strip
-trailing
-cr
"$outdir/$pattern.sav2" "$outdir/$pattern.res2" > "$outdir/$pattern.diff.sav.log2"
219 if [ "$?" == 0 ]; then
228 sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'<<EOF
233 # As argument: the pattern used for the file
234 function process_result
()
252 # Truncate too big res file
253 local size
=$
(wc -c
< "$outdir/$pattern.res")
254 if test -n
"$reslimit" -a
"$size" -gt
"$reslimit"; then
255 # The most portable way to truncate a file is with Perl
256 perl
-e
"truncate \"$outdir/$pattern.res\", $reslimit;"
257 echo "***TRUNCATED***" >> "$outdir/$pattern.res"
260 echo >>$xml "<testcase classname='`xmlesc "$pack"`' name='`xmlesc "$description"`' time='`cat -- "$outdir/$pattern.
time.out
"`' `timestamp`>"
261 #for sav in "sav/$engine/fixme/$pattern.res" "sav/$engine/$pattern.res" "sav/fixme/$pattern.res" "sav/$pattern.res" "sav/$pattern.sav"; do
262 for savdir
in $savdirs; do
263 local sav
=$savdir/fixme
/$pattern.res
264 compare_to_result
"$pattern" "$sav"
274 if [ -z
"$FIRST" ]; then
281 if [ -z
"$FIRST" ]; then
289 sav
=$savdir/$pattern.res
290 compare_to_result
"$pattern" "$sav"
300 if [ -z
"$FIRST" ]; then
307 if [ -z
"$FIRST" ]; then
315 OLD
=`echo "$OLD" | sed -e 's/ */ /g' -e 's/^ //' -e 's/ $//'`
316 istodo
"$outdir/$pattern.res"
318 if [ -n
"$SAV" ]; then
319 if [ -n
"$OLD" ]; then
320 echo "[*ok*] $outdir/$pattern.res $SAV - but $OLD remains!"
321 echo >>$xml "<error message='`xmlesc "ok
$outdir/$pattern.res
- but
$OLD remains
"`'/>"
322 remains
="$remains $OLD"
323 test "$autosav" = "true" && rm "$OLD"
325 echo "[ok] $outdir/$pattern.res $SAV"
328 elif [ -n
"$FIXME" ]; then
329 if [ -n
"$OLD" ]; then
330 echo "[*fixme*] $outdir/$pattern.res $FIXME - but $OLD remains!"
331 echo >>$xml "<error message='`xmlesc "ok
$outdir/$pattern.res
- but
$OLD remains
"`'/>"
332 remains
="$remains $OLD"
333 test "$autosav" = "true" && rm "$OLD"
335 echo "[fixme] $outdir/$pattern.res $FIXME"
336 echo >>$xml "<skipped/>"
338 todos
="$todos $pattern"
339 elif [ "x$NYI" = "x0" ]; then
340 echo "[todo] $outdir/$pattern.res -> not yet implemented"
341 echo >>$xml "<skipped/>"
342 todos
="$todos $pattern"
343 elif [ -n
"$SOSO" ]; then
344 echo "[======= soso $outdir/$pattern.res $SOSO =======]"
345 echo >>$xml "<error message='`xmlesc "soso
$outdir/$pattern.res
$SOSO"`'/>"
346 echo >>$xml "<system-out><![CDATA["
347 cat -v
-- "$outdir/$pattern.diff.sav.log" |
head >>$xml -n
50
348 echo >>$xml "]]></system-out>"
350 echo "$ii" >> "$ERRLIST"
351 test "$autosav" = "true" && cp "$outdir/$pattern.res" "$SOSO"
352 elif [ -n
"$SOSOF" ]; then
353 echo "[======= fixme soso $outdir/$pattern.res $SOSOF =======]"
354 echo >>$xml "<error message='`xmlesc "soso
$outdir/$pattern.res
$SOSO"`'/>"
355 echo >>$xml "<system-out><![CDATA["
356 cat -v
-- "$outdir/$pattern.diff.sav.log" |
head >>$xml -n
50
357 echo >>$xml "]]></system-out>"
359 echo "$ii" >> "$ERRLIST"
360 test "$autosav" = "true" && cp "$outdir/$pattern.res" && "$SOSO"
361 elif [ -n
"$NSAV" ]; then
362 echo "[======= fail $outdir/$pattern.res $NSAV =======]"
363 echo >>$xml "<error message='`xmlesc "fail
$outdir/$pattern.res
$NSAV"`'/>"
364 echo >>$xml "<system-out><![CDATA["
365 cat -v
-- "$outdir/$pattern.diff.sav.log" |
head >>$xml -n
50
366 echo >>$xml "]]></system-out>"
368 echo "$ii" >> "$ERRLIST"
369 test "$autosav" = "true" && cp "$outdir/$pattern.res" "$NSAV"
370 elif [ -n
"$NFIXME" ]; then
371 echo "[======= changed $outdir/$pattern.res $NFIXME ======]"
372 echo >>$xml "<error message='`xmlesc "changed
$outdir/$pattern.res
$NFIXME"`'/>"
373 echo >>$xml "<system-out><![CDATA["
374 cat -v
-- "$outdir/$pattern.diff.sav.log" |
head >>$xml -n
50
375 echo >>$xml "]]></system-out>"
377 echo "$ii" >> "$ERRLIST"
378 test "$autosav" = "true" && cp "$outdir/$pattern.res" "$NFIXME"
379 elif [ -s
"$outdir/$pattern.res" ]; then
380 echo "[=== no sav ===] $outdir/$pattern.res is not empty"
381 echo >>$xml "<error message='no sav and not empty'/>"
382 echo >>$xml "<system-out><![CDATA["
383 cat -v
>>$xml -- "$outdir/$pattern.res"
384 echo >>$xml "]]></system-out>"
386 echo "$ii" >> "$ERRLIST"
387 test "$autosav" = "true" && cp "$outdir/$pattern.res" "sav/"
389 # no sav but empty res
390 echo "[0k] $outdir/$pattern.res is empty"
393 if test -s
"$outdir/$pattern.cmp.err"; then
394 echo >>$xml "<system-err><![CDATA["
395 cat -v
>>$xml -- "$outdir/$pattern.cmp.err"
396 echo >>$xml "]]></system-err>"
398 echo >>$xml "</testcase>"
403 test "$noskip" = true
&& return 1
404 if echo "$1" |
grep -f
"$engine.skip" >/dev
/null
2>&1; then
406 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
409 if test -n
"$isinterpret" && echo "$1" |
grep -f
"exec.skip" >/dev
/null
2>&1; then
410 echo "=> $2: [skip exec]"
411 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
414 if test -n
"GITLAB_CI" && echo "$1" |
grep -f
"gitlab_ci.skip" >/dev
/null
2>&1; then
415 echo "=> $2: [skip gitlab ci]"
416 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
421 local os_skip_file
=$UNAME.skip
422 if test -e
$os_skip_file && echo "$1" |
grep -f
"$os_skip_file" >/dev
/null
2>&1; then
423 echo "=> $2: [skip os]"
424 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
429 local host_skip_file
=`$HOSTNAME`.skip
430 if test -e
$host_skip_file && echo "$1" |
grep -f
"$host_skip_file" >/dev
/null
2>&1; then
431 echo "=> $2: [skip hostname]"
432 echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
440 test "$noskip" = true
&& return 1
441 for savdir
in $savdirs .
; do
442 local f
="$savdir/exec.skip"
443 test -f
"$f" ||
continue
444 if echo "$1" |
grep -f
"$f" >/dev
/null
2>&1; then
445 echo -n
"_ no exec by $f; "
454 test "$noskip" = true
&& return 1
455 for savdir
in $savdirs .
; do
456 local f
="$savdir/cc.skip"
457 test -f
"$f" ||
continue
458 if echo "$1" |
grep -f
"$f" >/dev
/null
2>&1; then
465 # Check that the resfile ($1) matches some magic strings in `todo` files.
468 test "$no" = true
&& return 1
469 for savdir
in $savdirs .
; do
470 local f
="$savdir/todo"
471 test -f
"$f" ||
continue
472 if grep -f
"$f" "$1" >/dev
/null
2>&1; then
481 local name
="$enginebinname"
482 local recent
=`ls -t ../src/$name ../src/$name_[0-9] ../bin/$name ../contrib/nitin/bin/$name ../c_src/$name 2>/dev/null | head -1`
483 if [[ "x$recent" == "x" ]]; then
484 echo "Could not find binary for engine $engine, aborting"
487 if [ "x$isnode" = "xfalse" ]; then
488 echo "Found binary for engine $engine: $recent $OPT"
500 while [ $stop = false
]; do
502 -o
) OPT
="$OPT $2"; shift; shift;;
503 -v
) verbose
=true
; shift;;
505 --engine
) engine
="$2"; shift; shift;;
506 --noskip
) noskip
=true
; shift;;
507 --outdir
) outdir
="$2"; shift; shift;;
508 --compdir
) compdir
="$2"; shift; shift;;
509 --node
) isnode
=true
; shift;;
510 --autosav
) autosav
=true
; shift;;
514 enginebinname
=$engine
521 OPT
="--separate $OPT --compile-dir $compdir"
522 savdirs
="sav/nitc-common/"
527 OPT
="--separate $OPT --compile-dir $compdir"
528 savdirs
="sav/nitc-common/"
533 OPT
="--erasure $OPT --compile-dir $compdir"
534 savdirs
="sav/nitc-common/"
539 OPT
="--semi-global $OPT --compile-dir $compdir"
540 savdirs
="sav/nitc-common/"
545 OPT
="--global $OPT --compile-dir $compdir"
546 savdirs
="sav/nitc-common/"
568 OPT
="--compile-dir $compdir --ant"
570 savdirs
="sav/nitc-common/"
574 OPT
="-m emscripten_nodejs.nit --semi-global $OPT --compile-dir $compdir"
575 savdirs
="sav/nitcsg/"
578 echo "unknown engine $engine"
583 savdirs
="sav/`$HOSTNAME` sav/$UNAME sav/$engine $savdirs sav/"
584 test -n
"$GITLAB_CI" && savdirs
="sav/gitlab_ci $savdirs"
586 # The default nitc compiler
587 [ -z
"$NITC" ] && find_nitc
589 # Set NIT_DIR if needed
590 [ -z
"$NIT_DIR" ] && export NIT_DIR
=..
592 # Mark to distinguish files among tests
600 # CLEAN the out directory
601 rm -rf
"$outdir/" 2>/dev
/null
602 mkdir
"$outdir" 2>/dev
/null
604 # File where error tests are outputed
605 # Old ERRLIST is backuped
606 ERRLIST
=${ERRLIST:-errlist}
607 ERRLIST_TARGET
=$ERRLIST
609 # Initiate new ERRLIST
610 if [ "x$ERRLIST" = "x" ]; then
621 if [ "x$XMLDIR" = "x" ]; then
622 xml
="tests-$engine.xml"
624 sum=`echo $@ | md5sum | cut -f1 -d " "`
625 xml
="$XMLDIR/tests-$engine-$sum.xml"
629 echo >$xml "<testsuites><testsuite>"
632 if [ ! -f
"$ii" ]; then
633 echo "File '$ii' does not exist."
636 f
=`basename -- "$ii" .nit`
638 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|'`
640 # Sould we skip the file for this engine?
641 need_skip
"$f" "$f" "$pack" && continue
643 local_tmp
=${ii/../AA}
644 if [ "x$local_tmp" = "x$ii" ]; then
645 includes
="-I . -I ../lib/core -I ../lib/core/collection -I alt"
650 for i
in "$ii" `./alterner.pl --start '#' --altsep '_' -- "$ii"`; do
651 bf
=`basename -- "$i" .nit`
654 # Sould we skip the alternative for this engine?
655 need_skip
"$bf" "$bf" "$pack" && continue
659 if [ -f
"$f.inputs" ]; then
661 export MNIT_READ_INPUT
="$f.inputs"
664 export MNIT_READ_INPUT
=/dev
/null
668 if [ "$engine" = "emscripten" ]; then
672 if [ -n
"$isinterpret" ]; then
673 cat > "$ff.bin" <<END
674 exec $NITC --no
-color
$OPT $includes -- $
(printf '%q' "$i") "\$@"
680 echo 0.0 > "$ff.time.out"
681 elif [ -n
"$isinteractive" ]; then
682 cat > "$ff.bin" <<END
683 exec $NITC --no
-color
--no
-prompt
--source-name $
(printf '%q' "$i") $OPT $includes < $
(printf '%q' "$i") "\$@"
689 echo 0.0 > "$ff.time.out"
691 if skip_cc
"$bf"; then
697 if [ "x$verbose" = "xtrue" ]; then
699 echo $NITC --no
-color
$OPT -o
"$ffout" "$includes" $nocc "$i"
701 NIT_NO_STACK
=1 JNI_LIB_PATH
=$JNI_LIB_PATH JAVA_HOME
=$JAVA_HOME \
702 saferun
-o
"$ff.time.out" $NITC --no
-color
$OPT -o
"$ffout" $includes $nocc "$i" 2> "$ff.cmp.err" > "$ff.compile.log"
704 if [ "x$verbose" = "xtrue" ]; then
705 cat -- "$ff.compile.log"
706 cat >&2 -- "$ff.cmp.err"
709 rm -r
"$compdir" 2>/dev
/null
711 if [ "$engine" = "emscripten" ]; then
712 echo > "$ff.bin" "nodejs $ffout \"\$@\""
714 if grep "Fatal Error: more than one primitive class" "$ff.compile.log" > /dev
/null
; then
715 echo " [skip] do no not imports kernel"
716 echo >>$xml "<testcase classname='`xmlesc "$pack"`' name='`xmlesc "$bf"`' `timestamp`><skipped/></testcase>"
720 if [ "$ERR" != 0 ]; then
722 cat -- "$ff.compile.log" "$ff.cmp.err" > "$ff.res"
723 process_result
"$bf" "$bf" "$pack"
724 elif [ -n
"$nocc" ]; then
728 process_result
"$bf" "$bf" "$pack"
729 elif [ -x
"$ff.bin" ]; then
730 if skip_exec
"$bf"; then
733 process_result
"$bf" "$bf" "$pack"
739 if [ "x$verbose" = "xtrue" ]; then
741 echo "NIT_NO_STACK=1 $ff.bin" $args
743 NIT_NO_STACK
=1 LD_LIBRARY_PATH
=$JNI_LIB_PATH WRITE
="$ff.write" \
744 saferun
-a
-o
"$ff.time.out" "$ff.bin" $args < "$inputs" > "$ff.res" 2>"$ff.err"
745 mv "$ff.time.out" "$ff.times.out"
746 awk '{ SUM += $1} END { print SUM }' "$ff.times.out" > "$ff.time.out"
748 if [ "x$verbose" = "xtrue" ]; then
752 if [ -f
"$ff.write" ]; then
753 cat -- "$ff.write" >> "$ff.res"
754 elif [ -d
"$ff.write" ]; then
755 /bin
/ls -F
"$ff.write" >> "$ff.res"
757 cp -- "$ff.res" "$ff.res2"
758 cat -- "$ff.cmp.err" "$ff.err" "$ff.res2" > "$ff.res"
759 process_result
"$bf" "$bf" "$pack"
761 if [ -f
"$f.args" ]; then
769 name
="$bf args $cptr"
771 # Sould we skip the input for this engine?
772 need_skip
"$bff" " $name" "$pack" && continue
774 # use a specific inputs file, if required
775 if [ -f
"$bff.inputs" ]; then
776 ffinputs
="$bff.inputs"
781 rm -rf
"$fff.res" "$fff.err" "$fff.write" 2> /dev
/null
782 if [ "x$verbose" = "xtrue" ]; then
784 echo "NIT_NO_STACK=1 $ff.bin" $args
787 echo "$ff.bin $args" > "$fff.bin"
789 WRITE
="$fff.write" saferun
-o
"$fff.time.out" sh
-c
"NIT_NO_STACK=1 $fff.bin < $ffinputs > $fff.res 2>$fff.err"
790 if [ "x$verbose" = "xtrue" ]; then
792 cat >&2 -- "$fff.err"
794 if [ -f
"$fff.write" ]; then
795 cat -- "$fff.write" >> "$fff.res"
796 elif [ -d
"$fff.write" ]; then
797 /bin
/ls -F
-- "$fff.write" >> "$fff.res"
799 if [ -s
"$fff.err" ]; then
800 cp -- "$fff.res" "$fff.res2"
801 cat -- "$fff.err" "$fff.res2" > "$fff.res"
803 process_result
"$bff" " $name" "$pack"
806 elif [ -f
"$ff.bin" ]; then
807 #Not executable (platform?)"
809 process_result
"$bf" "$bf" "$pack"
812 cat -- "$ff.cmp.err" > "$ff.res"
813 echo "Compilation error" > "$ff.res"
814 process_result
"$bf" "$bf" "$pack"
819 if [ "x$isnode" = "xfalse" ]; then
820 echo "engine: $engine ($enginebinname $OPT)"
821 echo "ok: " `echo $ok | wc -w` "/" `echo $ok $nok $nos $todos | wc -w`
823 if [ -n
"$nok" ]; then
825 echo "There were $(echo $nok | wc -w) errors ! (see file $ERRLIST)"
827 if [ -n
"$nos" ]; then
830 if [ -n
"$todos" ]; then
831 echo "todo/fixme: $todos"
833 if [ -n
"$remains" ]; then
834 echo "sav that remains: $remains"
839 if [ "x$ERRLIST" != "x" ]; then
840 if [ -f
"$ERRLIST_TARGET" ]; then
841 mv "$ERRLIST_TARGET" "${ERRLIST_TARGET}.bak"
843 uniq $ERRLIST > $ERRLIST_TARGET
847 echo >>$xml "</testsuite></testsuites>"
849 if type junit2html
>/dev
/null
; then
853 if [ -n
"$nok" ]; then