bc: convert to "G trick" - this returns bc to zero bss increase
[oweals/busybox.git] / scripts / randomtest.loop
index 2c8a9bd35ba6688fe000006dbe07cbd8c1e77634..edfbc5c58898037fc6d6678624d12eda035da47c 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+run_testsuite=false
+run_testsuite=true
+
+run_single_test=false
+run_single_test=true
+
 test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
 test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
 
@@ -21,7 +27,9 @@ while sleep 1; do
                echo "Failed build in: failed.$dir"
                exit 1 # you may comment this out...
                let fail++
-       else
+               continue
+       fi
+       if $run_testsuite; then
                (
                        cd -- "$dir/testsuite" || exit 1
                        echo "Running testsuite in $dir..."
@@ -29,10 +37,36 @@ while sleep 1; do
                )
                if test $? != 0; then
                        echo "Failed runtest in $dir"
-                       exit 1
+                       grep ^FAIL -- "$dir/testsuite/runtest.log"
+                       exit 1 # you may comment this out...
+                       let fail++
+                       continue
                fi
                tail -n10 -- "$dir/testsuite/runtest.log"
-               rm -rf -- "$dir"
        fi
+       if $run_single_test; then
+               (
+                       cd -- "$dir" || exit 1
+                       echo "Running make_single_applets.sh in $dir..."
+
+                       if grep -q '# CONFIG_FEATURE_TFTP_GET is not set' .config \
+                       && grep -q '# CONFIG_FEATURE_TFTP_PUT is not set' .config \
+                       ; then
+                               # If both off, tftp[d] is ifdefed out and test fails.
+                               # Enable one:
+                               sed 's/# CONFIG_FEATURE_TFTP_GET is not set/CONFIG_FEATURE_TFTP_GET=y/' -i .config
+                       fi
+
+                       ./make_single_applets.sh
+               )
+               if test $? != 0; then
+                       echo "Failed make_single_applets.sh in $dir"
+                       exit 1 # you may comment this out...
+                       let fail++
+                       continue
+               fi
+       fi
+       grep -i 'warning:' "$dir/make.log"
+       rm -rf -- "$dir"
        let cnt++
 done