Start adding a test suite.

This commit is contained in:
Eric Anholt 2006-08-31 14:25:33 -07:00 committed by Damien Lespiau
parent 356ce76d44
commit e3cc73bec4
7 changed files with 36 additions and 1 deletions

View File

@ -1,4 +1,4 @@
SUBDIRS = doc src
SUBDIRS = doc src test
EXTRA_DIST = \
AUTHORS \

View File

@ -26,4 +26,5 @@ AC_OUTPUT([
Makefile
doc/Makefile
src/Makefile
test/Makefile
])

2
assembler/test/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.out
mov

View File

@ -0,0 +1,21 @@
check_SCRIPTS = run-test.sh
TESTS_ENVIRONMENT = top_builddir=${top_builddir}
TESTS = \
mov
TESTDATA = \
mov.expected \
mov.g4a
EXTRA_DIST = \
${TESTDATA} \
run-test.sh
$(TESTS): run-test.sh
sed "s|TEST|$@|g" ${srcdir}/run-test.sh > $@
chmod +x $@
CLEANFILES = \
*.out \
${TESTS}

View File

@ -0,0 +1 @@
{ 0x00000001, 0x20000021, 0x00000020, 0x00000000 },

1
assembler/test/mov.g4a Normal file
View File

@ -0,0 +1 @@
mov (1) g0<1>UD g1<0,1,0>UD { align1 };

View File

@ -0,0 +1,9 @@
#!/bin/sh
TESTDIR=${srcdir-`pwd`}
BUILDDIR=${top_builddir-`pwd`}
${BUILDDIR}/src/gen4asm -o TEST.out $TESTDIR/TEST.g4a
if cmp TEST.out ${TESTDIR}/TEST.expected; then : ; else
exit 1;
fi