summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-09-18 16:44:45 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2012-09-26 23:27:00 -0400
commit5312be2ea55ee3acfd7453b71d3f7e15297eaf1a (patch)
treedd24e3a50ad08277240d4a7d44ade5414b37c831
parenta4cc1c4ed5d7c9ff90b4f14aae09d2792bcbb5e8 (diff)
Fix missing environment variables problem in test/run-test.sh
Currently test/run-test.sh cannot get the value of ${srcdir} and ${top_builddir}. Thus we cannot run any test case. This patch uses $0 to get the absolute path of run-test.sh. Now test cases work.
-rw-r--r--test/run-test.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/run-test.sh b/test/run-test.sh
index cd21cf6..a7de7d4 100644
--- a/test/run-test.sh
+++ b/test/run-test.sh
@@ -1,11 +1,13 @@
#!/bin/sh
-SRCDIR=${srcdir-`pwd`}
-BUILDDIR=${top_builddir-`pwd`}
+DIR="$( cd -P "$( dirname "$0" )" && pwd )"
-${BUILDDIR}/src/intel-gen4asm -o TEST.out $SRCDIR/TEST.g4a
-if cmp TEST.out ${SRCDIR}/TEST.expected 2> /dev/null; then : ; else
+${DIR}/../src/intel-gen4asm -o TEST.out ${DIR}/TEST.g4a
+if cmp TEST.out ${DIR}/TEST.expected 2> /dev/null;
+then
+ echo "Good";
+else
echo "Output comparison for TEST"
- diff -u ${SRCDIR}/TEST.expected TEST.out
+ diff -u ${DIR}/TEST.expected TEST.out
exit 1;
fi