From 7cad975038847fccd9c94d693edbe12bf9bcde02 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Mon, 26 May 2014 15:03:34 -0400 Subject: [PATCH] add timeout (sec) arg, and "additional wesnoth args" to test script --- run_wml_tests | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/run_wml_tests b/run_wml_tests index 46297e9ec629..d4f7381a6ed4 100755 --- a/run_wml_tests +++ b/run_wml_tests @@ -13,6 +13,8 @@ usage() echo -e "\t-w\tVery verbose mode. (Debug script.)" echo -e "\t-u\tUse unix timeout instead of wesnoth --timeout argument." echo -e "\t \tUnix timeout will send a TERM signal, followed by KILL." + echo -e "\t-a arg\tAdditional arguments to go to wesnoth." + echo -e "\t-t arg\tNew timer value to use, instead of 10s as default." echo -e "\t-s\tDisable strict mode. By default, we run wesnoth with option" echo -e "\t \t'--log-strict=warning' to ensure errors result in a failed test." echo -e "\t-d\tRun wesnoth-debug binary instead of wesnoth." @@ -138,11 +140,11 @@ run_test() binary+="wesnoth " fi + timer=$basetimer # Use validcache on tests that aren't the first test. if [ "$FirstTest" -eq 1 ]; then - timer=20 + ((timer *= 2)) else - timer=10 opts+="--validcache " fi # Add a timeout @@ -161,7 +163,7 @@ run_test() command="$preopts" command+="$binary" command+="$opts" - command+="$extra_opts" + command+="$extra_opts" if [ "$Verbose" -eq 1 ]; then echo "$command" elif [ "$Verbose" -eq 2 ]; then @@ -187,8 +189,10 @@ LoadFile="wml_test_schedule" BinPath="./" StrictMode=1 DebugMode=0 +extra_opts="" +basetimer=10 -while getopts ":hvwusdp:l:" Option +while getopts ":hvwusdp:l:a:t:" Option do case $Option in h ) @@ -215,24 +219,31 @@ do DebugMode=1 ;; p ) - BinPath=$OPTARG + BinPath="$OPTARG" ;; l ) - LoadFile=$OPTARG + LoadFile="$OPTARG" + ;; + a ) + extra_opts+="$OPTARG" + ;; + t ) + echo "Replacing default timer of 10s with " "$OPTARG" + basetimer="$OPTARG" ;; esac done shift $(($OPTIND - 1)) -extra_opts="$*" +extra_opts+="$*" if [ "$Verbose" -ge 2 ]; then if [ "${#extra_opts}" -ge 0 ]; then - echo "Found additional arguments to wesnoth: " $extra_opts + echo "Found additional arguments to wesnoth: " "$extra_opts" fi fi -echo "Getting tests from" $LoadFile "..." +echo "Getting tests from" "$LoadFile" "..." old_IFS=$IFS IFS=$'\n'