Skip to contentSkip to conversation

scripts: Add capability to resume interrupted run-tests.sh session

PATCH In review Mike Mason 2 participants 2 messages Aug 26, 2014 – Aug 29, 2014

lore
Share & tools
lore

Mike Mason

author
#0 lore raw

PATCH 1/1 scripts: Add capability to resume interrupted run-tests.sh session

Piglit provides a 'resume' feature that can restart an interrupted test run at the point where it stopped. This patch adds that feature to run_tests.sh.

---
 scripts/run-tests.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
scripts/run-tests.sh +11 -4
index d0e0c67..580f777 100755
@@ -59,6 +59,8 @@ function print_help {
 	echo "  -v              enable verbose mode"
 	echo "  -x <regex>      exclude tests that match the regular expression"
 	echo "                  (can be used more than once)"
+	echo "  -R              resume interrupted test where the partial results"
+	echo "                  are in the directory given by -r"
 	echo ""
 	echo "Useful patterns for test filtering are described in tests/NAMING-CONVENTION"
 }
@@ -73,7 +75,7 @@ function list_tests {
 	done
 }
 
-while getopts ":dhlr:st:vx:" opt; do
+while getopts ":dhlr:st:vx:R" opt; do
 	case $opt in
 		d) download_piglit; exit ;;
 		h) print_help; exit ;;
@@ -83,6 +85,7 @@ while getopts ":dhlr:st:vx:" opt; do
 		t) FILTER="$FILTER -t $OPTARG" ;;
 		v) VERBOSE="-v" ;;
 		x) EXCLUDE="$EXCLUDE -x $OPTARG" ;;
+		R) RESUME="true" ;;
 		:)
 			echo "Option -$OPTARG requires an argument."
 			exit 1
@@ -112,11 +115,15 @@ if [ ! -x "$PIGLIT" ]; then
 	exit 1
 fi
 
-mkdir -p "$RESULTS"
-
-sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS" $VERBOSE $EXCLUDE $FILTER
+if [ "x$RESUME" != "x" ]; then
+	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume "$RESULTS"
+else
+	mkdir -p "$RESULTS"
+	sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS" $VERBOSE $EXCLUDE $FILTER
+fi
 
 if [ "$SUMMARY" == "html" ]; then
 	"$PIGLIT" summary html --overwrite "$RESULTS/html" "$RESULTS"
 	echo "HTML summary has been written to $RESULTS/html/index.html"
 fi
+
Signature · 1 line
1.9.1
#1 lore raw
Quoted 57 lines · Mike Mason

Piglit provides a 'resume' feature that can restart an interrupted test run at the point where it stopped. This patch adds that feature to run_tests.sh.

---
 scripts/run-tests.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
scripts/run-tests.sh +0 -0
index d0e0c67..580f777 100755
@@ -59,6 +59,8 @@ function print_help {
        echo "  -v              enable verbose mode"
        echo "  -x <regex>      exclude tests that match the regular

expression"
echo " (can be used more than once)"
+ echo " -R resume interrupted test where the partial
results"
+ echo " are in the directory given by -r"
echo ""
echo "Useful patterns for test filtering are described in
tests/NAMING-CONVENTION"
}

scripts/run-tests.sh +2 -4
@@ -73,7 +75,7 @@ function list_tests {
        done
 }
 
-while getopts ":dhlr:st:vx:" opt; do
+while getopts ":dhlr:st:vx:R" opt; do
        case $opt in
                d) download_piglit; exit ;;
                h) print_help; exit ;;
@@ -83,6 +85,7 @@ while getopts ":dhlr:st:vx:" opt; do
                t) FILTER="$FILTER -t $OPTARG" ;;
                v) VERBOSE="-v" ;;
                x) EXCLUDE="$EXCLUDE -x $OPTARG" ;;
+               R) RESUME="true" ;;
                :)
                        echo "Option -$OPTARG requires an argument."
                        exit 1
@@ -112,11 +115,15 @@ if [ ! -x "$PIGLIT" ]; then
        exit 1
 fi
 
-mkdir -p "$RESULTS"
-
-sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS" $VERBOSE

$EXCLUDE $FILTER

scripts/run-tests.sh +5 -0
+if [ "x$RESUME" != "x" ]; then
+       sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" resume "$RESULTS"
+else
+       mkdir -p "$RESULTS"
+       sudo IGT_TEST_ROOT="$IGT_TEST_ROOT" "$PIGLIT" run igt "$RESULTS"

$VERBOSE $EXCLUDE $FILTER

scripts/run-tests.sh if [ ! -x "$PIGLIT" ]; then · line 129

Quoted 7 lines
scripts/run-tests.sh +2 -0
+fi
 
 if [ "$SUMMARY" == "html" ]; then
        "$PIGLIT" summary html --overwrite "$RESULTS/html" "$RESULTS"
        echo "HTML summary has been written to $RESULTS/html/index.html"
 fi
+

Patch merged, although I've removed this additional new line from the end of the file.

Quoted 8 lines

--
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx