[kvm-unit-tests,1/9] x86/run: source config.mak
diff mbox

Message ID 1436546703-12258-2-git-send-email-drjones@redhat.com
State New
Headers show

Commit Message

Andrew Jones July 10, 2015, 4:44 p.m. UTC
We'll use a variable from config.mak in a later patch. Try not to break
users that have gotten used to doing cd x86; ./run test.flat by also
looking in the parent directory. While at it, add this parent directory
check to arm too.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 arm/run |  8 ++++++--
 x86/run | 10 ++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

Patch
diff mbox

diff --git a/arm/run b/arm/run
index 662a8564674a3..e50709dcd12f4 100755
--- a/arm/run
+++ b/arm/run
@@ -1,10 +1,14 @@ 
 #!/bin/bash
 
-if [ ! -f config.mak ]; then
+if [ ! -f config.mak ] && [ ! -f ../config.mak ]; then
 	echo run ./configure first. See ./configure -h
 	exit 2
 fi
-source config.mak
+if [ -f config.mak ]; then
+	source config.mak
+else
+	source ../config.mak
+fi
 processor="$PROCESSOR"
 
 qemu="${QEMU:-qemu-system-$ARCH_NAME}"
diff --git a/x86/run b/x86/run
index 5281fca2125d8..d00e8fece4b6d 100755
--- a/x86/run
+++ b/x86/run
@@ -2,6 +2,16 @@ 
 NOTFOUND=1
 TESTDEVNOTSUPP=2
 
+if [ ! -f config.mak ] && [ ! -f ../config.mak ]; then
+	echo run ./configure first. See ./configure -h
+	exit 2
+fi
+if [ -f config.mak ]; then
+	source config.mak
+else
+	source ../config.mak
+fi
+
 qemubinarysearch="${QEMU:-qemu-kvm qemu-system-x86_64}"
 
 for qemucmd in ${qemubinarysearch}