changeset 121:08f7d7cdf1df

Add speedy option
author Chris Cannam
date Thu, 28 Sep 2017 10:34:24 +0100
parents 06c2a5337d56
children 9efd2d15cd58 828f0de6b2fb
files SCRIPTS/process.sh
diffstat 1 files changed, 48 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/SCRIPTS/process.sh	Wed May 18 15:42:12 2016 +0100
+++ b/SCRIPTS/process.sh	Thu Sep 28 10:34:24 2017 +0100
@@ -31,13 +31,17 @@
 fi
 
 do_rebuild=""
+do_speedy=""
+
+speedy_test_pattern="^[ABE]"
 
 usage() {
     echo 
-    echo "Usage: $0 <platform> [-c] [<dir> ...]"
+    echo "Usage: $0 <platform> [-c] [-s] [<dir> ...]"
     echo 
     echo " <platform>  one of native, linux32, linux64, mingw32, mingw64, osx32, osx64"
     echo " -c          build from clean"
+    echo " -s          speedy build: skip the slower tests"
     echo " <dir>       directory to build (default is all of them)"
     echo
     echo "Platform usually should match the platform you are running this"
@@ -157,11 +161,20 @@
     exit 2
 fi
 
-if [ t"$1" = t"-c" ]; then
-    echo "(Building from clean)"
-    do_rebuild=yes
-    shift
-fi
+while true; do
+    case "t$1" in
+        t-c)
+            echo "(Building from clean)"
+            do_rebuild=yes
+            shift ;;
+        t-s)
+            echo "(Speedy build)"
+            do_speedy=yes
+            shift ;;
+        *)
+            break;;
+    esac
+done
 
 metadir="$mydir"/../METADATA
 
@@ -406,20 +419,37 @@
 	if is_nondeterministic "$id"; then
 	    extra="-n"
 	fi
-	echo "Running command: VAMP_PATH=\"$pdir\" $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext \"$extra\" \"$id\"" | tee -a "$log"
-	if ( VAMP_PATH="$pdir$sep./vampy" $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext "$extra" "$id" 2>&1 | tee -a "$log" ; exit ${PIPESTATUS[0]} ) ; then
-	    echo "OK" | tee -a "$log"
-	else
-	    if have_vampy_plugins "$pdir"; then # (don't attempt vampy+valgrind)
-		echo | tee -a "$log"
-		echo "Tester failed for id $id (not restarting with valgrind, as this is a VamPy plugin)" | tee -a "$log"
+        tests=$($hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext -l | tail -n +6 | sed 's/ *|.*$//' | fmt -1000)
+        for test in $tests; do
+            run_this_test=yes
+            if [ -n "$do_speedy" ]; then
+                if echo "$test" | grep -q "$speedy_test_pattern"; then
+                    run_this_test=yes
+                else
+                    run_this_test=""
+                fi
+            fi
+            if [ -z "$run_this_test" ]; then
+                continue
+            fi
+	    echo "Running command: VAMP_PATH=\"$pdir\" $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext \"$extra\" -t \"$test\" \"$id\"" | tee -a "$log"
+	    if ( VAMP_PATH="$pdir$sep./vampy" time $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext "$extra" -t "$test" "$id" 2>&1 | tee -a "$log" ; exit ${PIPESTATUS[0]} ) ; then
+	        echo "OK" | tee -a "$log"
 	    else
-		echo | tee -a "$log"
-		echo "Tester failed for id $id: running again with valgrind (if available) and verbose for a report..." | tee -a "$log"
-		VAMP_PATH="$pdir$sep./vampy" $valgrind $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext -v "$extra" "$id" 2>&1 | tee -a "$log"
+                if [ -n "$do_speedy" ]; then
+		    echo | tee -a "$log"
+		    echo "Tester failed for id $id and test $test (not restarting with valgrind, as speedy flag is set)" | tee -a "$log"
+	        elif have_vampy_plugins "$pdir"; then # (don't attempt vampy+valgrind)
+		    echo | tee -a "$log"
+		    echo "Tester failed for id $id and test $test (not restarting with valgrind, as this is a VamPy plugin)" | tee -a "$log"
+	        else
+		    echo | tee -a "$log"
+		    echo "Tester failed for id $id and test $test: running again with valgrind (if available) and verbose for a report..." | tee -a "$log"
+		    VAMP_PATH="$pdir$sep./vampy" $valgrind $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext -v "$extra" -t "$test" "$id" 2>&1 | tee -a "$log"
+	        fi
+	        good=no
 	    fi
-	    good=no
-	fi
+        done
     done
     if [ "$good" != "yes" ]; then
 	echo "$dir" >> "$testfailed"