[PATCH 2/3] Fix gui/runtest.sh to work under either "make check" or being run manually.
Chris Lumens
clumens at redhat.com
Wed May 28 20:54:12 UTC 2014
"make check" runs from the tests/ directory, which means it's not going to find
the outside/ directory, nor is anything in the test itself going to find the
files it's looking for. Thus, attempt to cd into the gui/ directory first.
---
tests/gui/runtest.sh | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/tests/gui/runtest.sh b/tests/gui/runtest.sh
index c4a4a60..87f2ee7 100755
--- a/tests/gui/runtest.sh
+++ b/tests/gui/runtest.sh
@@ -18,6 +18,15 @@
#
# Red Hat Author(s): Chris Lumens <clumens at redhat.com>
+function doit() {
+ nosetests -s \
+ -v \
+ --nologcapture \
+ --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \
+ --tc=liveImage:"$1" $2 \
+ outside
+}
+
# We require the test_config plugin for nose, which is not currently packaged
# but is installable via pip.
if [ -z "$(nosetests -p | grep test_config)" ]; then
@@ -55,9 +64,13 @@ else
EXTRA=""
fi
-nosetests -s \
- -v \
- --nologcapture \
- --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \
- --tc=liveImage:"${LIVECD}" ${EXTRA} \
- outside
+# If we're being called from "make check", we will be outside the gui test directory.
+# Unfortunately, everything is written assuming that's where we will be. So cd there.
+if [ -d gui ]; then
+ ( cd gui && doit "${LIVECD}" ${EXTRA} )
+elif [ -d outside ]; then
+ doit "${LIVECD}" ${EXTRA}
+else
+ echo "Could not find test contents"
+ exit 3
+fi
--
1.9.0
More information about the anaconda-patches
mailing list