From mboxrd@z Thu Jan 1 00:00:00 1970 From: alex.bennee@linaro.org (=?UTF-8?q?Alex=20Benn=C3=A9e?=) Date: Thu, 24 Nov 2016 16:10:25 +0000 Subject: [kvm-unit-tests PATCH v7 03/11] run_tests: allow passing of options to QEMU In-Reply-To: <20161124161033.11456-1-alex.bennee@linaro.org> References: <20161124161033.11456-1-alex.bennee@linaro.org> Message-ID: <20161124161033.11456-4-alex.bennee@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org This introduces a the option -o for passing of options directly to QEMU which is useful. In my case I'm using it to toggle MTTCG on an off: ./run_tests.sh -t -o "-tcg mttcg=on" Signed-off-by: Alex Benn?e --- run_tests.sh | 10 +++++++--- scripts/functions.bash | 13 +++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 4f2e5cb..05cc7fb 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -13,10 +13,11 @@ function usage() { cat < test.log -for_each_unittest $config run +for_each_unittest $config run "$extra_opts" diff --git a/scripts/functions.bash b/scripts/functions.bash index ee9143c..d38a69e 100644 --- a/scripts/functions.bash +++ b/scripts/functions.bash @@ -2,11 +2,12 @@ function for_each_unittest() { local unittests="$1" - local cmd="$2" - local testname + local cmd="$2" + local extra_opts=$3 + local testname local smp local kernel - local opts + local opts=$extra_opts local groups local arch local check @@ -21,7 +22,7 @@ function for_each_unittest() testname=${BASH_REMATCH[1]} smp=1 kernel="" - opts="" + opts=$extra_opts groups="" arch="" check="" @@ -32,7 +33,7 @@ function for_each_unittest() elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then smp=${BASH_REMATCH[1]} elif [[ $line =~ ^extra_params\ *=\ *(.*)$ ]]; then - opts=${BASH_REMATCH[1]} + opts="$opts ${BASH_REMATCH[1]}" elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then groups=${BASH_REMATCH[1]} elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then @@ -45,6 +46,6 @@ function for_each_unittest() timeout=${BASH_REMATCH[1]} fi done - "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" exec {fd}<&- } -- 2.10.1