summaryrefslogtreecommitdiff
path: root/assembler
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-08-20 14:52:05 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2013-08-20 14:52:05 +0100
commit497814f2f2828efdc5bdd787ebc490d5083f61b8 (patch)
treef816e99cdcab6cd17307e2cd1b5699c5554080b5 /assembler
parent5959b8bb41fd852f44c4b81276fc451d896c2f05 (diff)
assembler: Revert "Automatically run all test cases."
The tests where supposed to be run through make check, not running the "run-test.sh" standalone. So revert that patch to have make check work as intended. This reverts commit 6983eebf47f37def8f2315d5af1800b81644f240.
Diffstat (limited to 'assembler')
-rw-r--r--assembler/test/Makefile.am3
-rw-r--r--assembler/test/run-test.sh88
2 files changed, 11 insertions, 80 deletions
diff --git a/assembler/test/Makefile.am b/assembler/test/Makefile.am
index 0d8d3492..1c5b13e9 100644
--- a/assembler/test/Makefile.am
+++ b/assembler/test/Makefile.am
@@ -77,7 +77,8 @@ EXTRA_DIST = \
run-test.sh
$(TESTS): run-test.sh
- chmod +x ${srcdir}/run-test.sh
+ sed "s|TEST|$@|g" ${srcdir}/run-test.sh > $@
+ chmod +x $@
CLEANFILES = \
*.out \
diff --git a/assembler/test/run-test.sh b/assembler/test/run-test.sh
index e02a6e09..a7de7d42 100644
--- a/assembler/test/run-test.sh
+++ b/assembler/test/run-test.sh
@@ -1,83 +1,13 @@
#!/bin/sh
-#TODO: add new test cases in environment variables ${TEST_GEN4_XXX}
-
DIR="$( cd -P "$( dirname "$0" )" && pwd )"
-ASSEMBLER="${DIR}/../src/intel-gen4asm"
-
-# Tests that are expected to success because they contain correct code.
-# $1 is the gen level, e.g., 4 or 7
-# $2 is the test case name
-function check_if_work()
-{
- GEN_LEVEL="$1"
- TEST_CASE_NAME="$2"
- SOURCE="${TEST_CASE_NAME}.g${1}a"
- EXPECTED="${TEST_CASE_NAME}.expected"
- TEMP_OUT="temp.out"
- ${ASSEMBLER} -g ${GEN_LEVEL} ${DIR}/${SOURCE} -o ${TEMP_OUT}
- if cmp ${TEMP_OUT} ${DIR}/${EXPECTED} 2> /dev/null;
- then
- echo "[ OK ] ${TEST_CASE_NAME}";
- else
- echo "[FAIL] ${TEST_CASE_NAME}";
- diff -u ${DIR}/${EXPECTED} ${TEMP_OUT};
- fi
-}
-
-# Tests that are expected to fail because they contain wrong code.
-function check_if_fail()
-{
- GEN_LEVEL="$1"
- TEST_CASE_NAME="$2"
- SOURCE="${TEST_CASE_NAME}.g${1}a"
- TEMP_OUT="temp.out"
- ${ASSEMBLER} -g ${GEN_LEVEL} ${DIR}/${SOURCE} -o ${TEMP_OUT} 2>/dev/null
- if [ $? -eq 0 ];
- then
- echo "[FAIL] ${TEST_CASE_NAME}";
- else
- echo "[ OK ] ${TEST_CASE_NAME}";
- fi
-}
-
-# Tests that are expected to success because they contain correct code.
-TEST_GEN4_SHOULD_WORK="\
- mov \
- frc \
- rndd \
- rndu \
- rnde \
- rnde-intsrc \
- rndz \
- lzd \
- not \
- jmpi \
- if \
- iff \
- while \
- else \
- break \
- cont \
- halt \
- wait \
- endif \
- declare \
- immediate \
- "
-
-# Tests that are expected to fail because they contain wrong code.
-TEST_GEN4_SHOULD_FAIL="\
- rnde-intsrc \
- "
-
-for T in ${TEST_GEN4_SHOULD_WORK}
-do
- check_if_work 4 ${T}
-done
-
-for T in ${TEST_GEN4_SHOULD_FAIL}
-do
- check_if_fail 4 ${T}
-done
+${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 ${DIR}/TEST.expected TEST.out
+ exit 1;
+fi