summaryrefslogtreecommitdiff
path: root/fw/test/fwtest.rc
diff options
context:
space:
mode:
Diffstat (limited to 'fw/test/fwtest.rc')
-rwxr-xr-xfw/test/fwtest.rc22
1 files changed, 22 insertions, 0 deletions
diff --git a/fw/test/fwtest.rc b/fw/test/fwtest.rc
index a7ba4d2..ffbc6b6 100755
--- a/fw/test/fwtest.rc
+++ b/fw/test/fwtest.rc
@@ -25,6 +25,11 @@ if(! test -x $fw){
exit nofw
}
+# where the source is, for the build check; skipped if it is not here
+src=$2
+if(~ $#src 0)
+ src=/sys/src/cmd/fw
+
tmp=/tmp/fwtest.$pid
mkdir -p $tmp
nA=$tmp/nA
@@ -139,6 +144,23 @@ fn nfw {
}
fwbefore=`{nfw}
+echo '== it builds without complaint'
+# A warning is a finding nobody had to look for. Two stood in fw.c for
+# as long as the program has existed, which is how long it has been
+# since anyone read the output of mk.
+if(test -d $src){
+ if(@{ cd $src && mk clean && mk all } >$tmp/build >[2=1])
+ r=ok
+ if not
+ r=failed
+ check 'the source still builds' ok $"r
+ grep warning $tmp/build > $tmp/why
+ r=`{grep -c warning $tmp/build}
+ check 'and the compiler has nothing to say about it' 0 $"r
+}
+if not
+ echo ' skip no '^$src^', not checking the build'
+
echo '== rules: parsing'
cat > $tmp/bad.ndb <<'!'