diff mbox

[kvm-unit-tests,07/12] scripts/runtime: change callsite of $TEST_DIR/run

Message ID 1453209851-27760-8-git-send-email-rkrcmar@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Radim Krčmář Jan. 19, 2016, 1:24 p.m. UTC
$TEST_DIR/run doesn't exist for standalone tests, they use
$RUNTIME_arch_run in its place.

Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
---
 run_tests.sh         | 2 ++
 scripts/runtime.bash | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Paolo Bonzini Jan. 19, 2016, 2:38 p.m. UTC | #1
On 19/01/2016 14:24, Radim Kr?má? wrote:
> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> index 8813b9ddbf1e..defbef31377d 100644
> --- a/scripts/runtime.bash
> +++ b/scripts/runtime.bash
> @@ -1,3 +1,5 @@
> +[ "${RUNTIME_arch_run?}" ]

If you want magic, you might as well say

: "${RUNTIME_arch_run?}"

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Radim Krčmář Jan. 19, 2016, 2:55 p.m. UTC | #2
2016-01-19 15:38+0100, Paolo Bonzini:
> On 19/01/2016 14:24, Radim Kr?má? wrote:
>> +++ b/scripts/runtime.bash
>> @@ -1,3 +1,5 @@
>> +[ "${RUNTIME_arch_run?}" ]
> 
> If you want magic, you might as well say
> 
> : "${RUNTIME_arch_run?}"

Much better, thanks.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/run_tests.sh b/run_tests.sh
index 2549679e653b..b488949d219b 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -6,6 +6,8 @@  if [ ! -f config.mak ]; then
 fi
 source config.mak
 source scripts/functions.bash
+
+RUNTIME_arch_run="./$TEST_DIR/run >> test.log"
 source scripts/runtime.bash
 
 config=$TEST_DIR/unittests.cfg
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 8813b9ddbf1e..defbef31377d 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -1,3 +1,5 @@ 
+[ "${RUNTIME_arch_run?}" ]
+
 qemu=${QEMU:-qemu-system-$ARCH}
 verbose=0
 
@@ -37,14 +39,14 @@  function run()
         fi
     done
 
-    cmdline="TESTNAME=$testname ACCEL=$accel ./$TEST_DIR-run $kernel -smp $smp $opts"
+    cmdline="TESTNAME=$testname ACCEL=$accel $RUNTIME_arch_run $kernel -smp $smp $opts"
     if [ $verbose != 0 ]; then
         echo $cmdline
     fi
 
     # extra_params in the config file may contain backticks that need to be
     # expanded, so use eval to start qemu
-    eval $cmdline >> test.log
+    eval $cmdline
 
     if [ $? -le 1 ]; then
         echo -e "\e[32mPASS\e[0m $1"