diff mbox

[i-g-t,11/12] assembler/test: Prep work for meson

Message ID 20170902170406.8271-11-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Sept. 2, 2017, 5:04 p.m. UTC
Again we want to be able to run each testcase individually.

Also, we need to make sure the target directory for the temp files
exists - meson always builds with a build-dir outside of the source
tree.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 assembler/test/run-test.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/assembler/test/run-test.sh b/assembler/test/run-test.sh
index 20a408c61b2d..0a5252a89dc7 100644
--- a/assembler/test/run-test.sh
+++ b/assembler/test/run-test.sh
@@ -3,9 +3,17 @@ 
 SRCDIR=${srcdir-`pwd`}
 BUILDDIR=${top_builddir-`pwd`}
 
-${BUILDDIR}/intel-gen4asm -o TEST.out $SRCDIR/TEST.g4a
-if cmp TEST.out ${SRCDIR}/TEST.expected 2> /dev/null; then : ; else
-  echo "Output comparison for TEST"
-  diff -u ${SRCDIR}/TEST.expected TEST.out
+test="TEST"
+
+if [[ "$1" != "" ]] ; then
+	test="$1"
+fi
+
+test -d ${BUILDDIR}/test || mkdir ${BUILDDIR}/test/
+
+${BUILDDIR}/intel-gen4asm -o ${BUILDDIR}/${test}.out $SRCDIR/${test}.g4a
+if cmp ${BUILDDIR}/${test}.out ${SRCDIR}/${test}.expected 2> /dev/null; then : ; else
+  echo "Output comparison for ${test}"
+  diff -u ${SRCDIR}/${test}.expected ${test}.out
   exit 1;
 fi