summaryrefslogtreecommitdiff
path: root/assembler/test
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-09-18 16:44:45 +0800
committerDamien Lespiau <damien.lespiau@intel.com>2013-03-04 15:54:32 +0000
commit1c009349bc894bd195b5522540536898b0bee574 (patch)
treef7b2eb6765cf0a4ebc4d457a34d1e8d9f79315b8 /assembler/test
parent868cbf7dc56d96dce1463cd9288730ece7ee9e9b (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.
Diffstat (limited to 'assembler/test')
-rw-r--r--assembler/test/run-test.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/assembler/test/run-test.sh b/assembler/test/run-test.sh
index cd21cf65..a7de7d42 100644
--- a/assembler/test/run-test.sh
+++ b/assembler/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