From 2654707e86cc94413998976d179b2ab4a2aa3114 Mon Sep 17 00:00:00 2001
From: Jean-Marc Valin <jmvalin@jmvalin.ca>
Date: Fri, 1 Apr 2022 14:32:38 -0400
Subject: [PATCH] Cleanup testing directories to save space

---
 tests/opus_build_test.sh |  2 +-
 tests/random_config.sh   | 15 ++++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/opus_build_test.sh b/tests/opus_build_test.sh
index 6de504811..b334ec16d 100755
--- a/tests/opus_build_test.sh
+++ b/tests/opus_build_test.sh
@@ -18,7 +18,7 @@ fi
 mkdir build_tests
 
 configure_dir=`pwd`
-seq -w $nb_tests | parallel -j +2 "../random_config.sh build_tests/run_{} $configure_dir $oldvectors $newvectors"
+seq -w $nb_tests | parallel --halt now,fail=10 -j +2 "../random_config.sh build_tests/run_{} $configure_dir $oldvectors $newvectors"
 
 if [ $? -ne 0 ]
 then
diff --git a/tests/random_config.sh b/tests/random_config.sh
index 41a2f2762..073c83e7d 100755
--- a/tests/random_config.sh
+++ b/tests/random_config.sh
@@ -78,7 +78,7 @@ $configure_path/configure $config_opt > configure_output.txt 2>&1
 
 if [ $? -ne 0 ]
 then
-	echo configure error >> $config
+	echo configure FAIL >> $config
 	exit 1
 fi
 
@@ -86,7 +86,7 @@ make > make_output.txt 2>&1
 
 if [ $? -ne 0 ]
 then
-        echo make error >> $config
+        echo make FAIL >> $config
 	exit 1
 fi
 
@@ -100,7 +100,7 @@ fi
 
 if [ $? -ne 0 ]
 then
-        echo check error >> $config
+        echo check FAIL >> $config
 	exit 1
 fi
 
@@ -110,8 +110,13 @@ rate=`echo -e "8000\n12000\n16000\n24000\n48000" | shuf -n1`
 
 if [ $? -ne 0 ]
 then
-        echo testvectors error >> $config
+        echo testvectors FAIL >> $config
         exit 1
 fi
 
-echo all pass >> $config
+echo all tests PASS >> $config
+
+#When everything's good, do some cleaning up to save space
+make distclean > /dev/null 2>&1
+rm -f tmp.out
+gzip make_output.txt
-- 
GitLab