ref: 9a91d5b20e00cf2a74ef82aa0d6f1f4d847dc04f
parent: a458242e8256b735e5bc38085fb3db35d7fa720d
author: Ori Bernstein <[email protected]>
date: Sat Feb 6 19:44:06 EST 2021
make test.rc less verbose
--- a/cmd/test.rc
+++ b/cmd/test.rc
@@ -12,18 +12,14 @@
expect=$1
shift
- echo -n $expect^': test' $*
-
# check for syntax errors
syntax=`{test $* >[2=1]}
if(~ $"syntax ''){
switch($expect){
case 0
- if(test $*) echo ' OK'
- if not failed
+ if(! test $*) failed $expect $*
case 1
- if(test $*) failed
- if not echo ' OK'
+ if(test $*) failed $expect $*
}
}
if not
@@ -37,6 +33,7 @@
}
fn failed{
+ echo -n $1^': test' $*(2-)^'^: failed'
echo ' failed'
FAILED=`{echo $FAILED 1 + p | dc}
}
@@ -129,8 +126,10 @@
t 1 ! '(' XXX -o XXX ')'
t 0 ! '(' ! '(' XXX -o XXX ')' ')'
-echo
-echo 'Syntax errors:' $ERROR 'Failed:' $FAILED
+if(! ~ $ERROR 0 || ! ~ $FAILED 0){
+ echo
+ echo 'Syntax errors:' $ERROR 'Failed:' $FAILED
+}
if(! ~ $ERROR 0 || ! ~ $FAILED 0)
exit 'failures'
exit ''