From: Peter Johnson Date: Thu, 3 Oct 2002 19:23:44 +0000 (-0000) Subject: Add parsers/nasm automated tests. X-Git-Tag: v0.2.0~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6dd56e1ebeca5b7abb4ea3b3c35d7e08c383aaa;p=yasm Add parsers/nasm automated tests. svn path=/trunk/yasm/; revision=735 --- diff --git a/modules/parsers/nasm/Makefile.inc b/modules/parsers/nasm/Makefile.inc index 4df1553b..ae8b405b 100644 --- a/modules/parsers/nasm/Makefile.inc +++ b/modules/parsers/nasm/Makefile.inc @@ -21,4 +21,7 @@ CLEANFILES += \ nasm-token.c EXTRA_DIST += \ + src/parsers/nasm/tests/Makefile.inc \ src/parsers/nasm/nasm-token.re + +include src/parsers/nasm/tests/Makefile.inc diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc new file mode 100644 index 00000000..8b2af9e0 --- /dev/null +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -0,0 +1,21 @@ +# $IdPath$ + +TESTS += \ + src/parsers/nasm/tests/nasm_test.sh + +EXTRA_DIST += \ + src/parsers/nasm/tests/nasm_test.sh \ + src/parsers/nasm/tests/equlocal.asm \ + src/parsers/nasm/tests/equlocal.errwarn \ + src/parsers/nasm/tests/equlocal.hex \ + src/parsers/nasm/tests/newsect.asm \ + src/parsers/nasm/tests/newsect.errwarn \ + src/parsers/nasm/tests/newsect.hex + +CLEANFILES += \ + equlocal \ + equlocal.ew \ + equlocal.hx \ + newsect \ + newsect.ew \ + newsect.hx diff --git a/modules/parsers/nasm/tests/equlocal.asm b/modules/parsers/nasm/tests/equlocal.asm new file mode 100644 index 00000000..ca540620 --- /dev/null +++ b/modules/parsers/nasm/tests/equlocal.asm @@ -0,0 +1,7 @@ +blah +.local equ 5 +blah2 +db blah.local +.local +nonlocal equ 6 +je .local diff --git a/modules/parsers/nasm/tests/equlocal.errwarn b/modules/parsers/nasm/tests/equlocal.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/parsers/nasm/tests/equlocal.hex b/modules/parsers/nasm/tests/equlocal.hex new file mode 100644 index 00000000..0ee1d6e9 --- /dev/null +++ b/modules/parsers/nasm/tests/equlocal.hex @@ -0,0 +1,3 @@ +05 +74 +fe diff --git a/modules/parsers/nasm/tests/nasm_test.sh b/modules/parsers/nasm/tests/nasm_test.sh new file mode 100755 index 00000000..ad041506 --- /dev/null +++ b/modules/parsers/nasm/tests/nasm_test.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# $IdPath$ +${srcdir}/out_test.sh nasm_test src/parsers/nasm/tests "nasm-compat parser" "-f bin" "" +exit $? diff --git a/modules/parsers/nasm/tests/newsect.asm b/modules/parsers/nasm/tests/newsect.asm new file mode 100644 index 00000000..420e17ca --- /dev/null +++ b/modules/parsers/nasm/tests/newsect.asm @@ -0,0 +1,10 @@ +[absolute 0] +mytype: +.long resd 1 +mytype_size: +[section .text] +lbl: +..@6.strucstart: +times mytype.long-($-..@6.strucstart) db 0 +dd 'ABCD' +times mytype_size-($-..@6.strucstart) db 0 diff --git a/modules/parsers/nasm/tests/newsect.errwarn b/modules/parsers/nasm/tests/newsect.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/parsers/nasm/tests/newsect.hex b/modules/parsers/nasm/tests/newsect.hex new file mode 100644 index 00000000..7b68ada6 --- /dev/null +++ b/modules/parsers/nasm/tests/newsect.hex @@ -0,0 +1,4 @@ +41 +42 +43 +44 diff --git a/src/parsers/nasm/Makefile.inc b/src/parsers/nasm/Makefile.inc index 4df1553b..ae8b405b 100644 --- a/src/parsers/nasm/Makefile.inc +++ b/src/parsers/nasm/Makefile.inc @@ -21,4 +21,7 @@ CLEANFILES += \ nasm-token.c EXTRA_DIST += \ + src/parsers/nasm/tests/Makefile.inc \ src/parsers/nasm/nasm-token.re + +include src/parsers/nasm/tests/Makefile.inc diff --git a/src/parsers/nasm/tests/Makefile.inc b/src/parsers/nasm/tests/Makefile.inc new file mode 100644 index 00000000..8b2af9e0 --- /dev/null +++ b/src/parsers/nasm/tests/Makefile.inc @@ -0,0 +1,21 @@ +# $IdPath$ + +TESTS += \ + src/parsers/nasm/tests/nasm_test.sh + +EXTRA_DIST += \ + src/parsers/nasm/tests/nasm_test.sh \ + src/parsers/nasm/tests/equlocal.asm \ + src/parsers/nasm/tests/equlocal.errwarn \ + src/parsers/nasm/tests/equlocal.hex \ + src/parsers/nasm/tests/newsect.asm \ + src/parsers/nasm/tests/newsect.errwarn \ + src/parsers/nasm/tests/newsect.hex + +CLEANFILES += \ + equlocal \ + equlocal.ew \ + equlocal.hx \ + newsect \ + newsect.ew \ + newsect.hx diff --git a/src/parsers/nasm/tests/equlocal.asm b/src/parsers/nasm/tests/equlocal.asm new file mode 100644 index 00000000..ca540620 --- /dev/null +++ b/src/parsers/nasm/tests/equlocal.asm @@ -0,0 +1,7 @@ +blah +.local equ 5 +blah2 +db blah.local +.local +nonlocal equ 6 +je .local diff --git a/src/parsers/nasm/tests/equlocal.errwarn b/src/parsers/nasm/tests/equlocal.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/src/parsers/nasm/tests/equlocal.hex b/src/parsers/nasm/tests/equlocal.hex new file mode 100644 index 00000000..0ee1d6e9 --- /dev/null +++ b/src/parsers/nasm/tests/equlocal.hex @@ -0,0 +1,3 @@ +05 +74 +fe diff --git a/src/parsers/nasm/tests/nasm_test.sh b/src/parsers/nasm/tests/nasm_test.sh new file mode 100755 index 00000000..ad041506 --- /dev/null +++ b/src/parsers/nasm/tests/nasm_test.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# $IdPath$ +${srcdir}/out_test.sh nasm_test src/parsers/nasm/tests "nasm-compat parser" "-f bin" "" +exit $? diff --git a/src/parsers/nasm/tests/newsect.asm b/src/parsers/nasm/tests/newsect.asm new file mode 100644 index 00000000..420e17ca --- /dev/null +++ b/src/parsers/nasm/tests/newsect.asm @@ -0,0 +1,10 @@ +[absolute 0] +mytype: +.long resd 1 +mytype_size: +[section .text] +lbl: +..@6.strucstart: +times mytype.long-($-..@6.strucstart) db 0 +dd 'ABCD' +times mytype_size-($-..@6.strucstart) db 0 diff --git a/src/parsers/nasm/tests/newsect.errwarn b/src/parsers/nasm/tests/newsect.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/src/parsers/nasm/tests/newsect.hex b/src/parsers/nasm/tests/newsect.hex new file mode 100644 index 00000000..7b68ada6 --- /dev/null +++ b/src/parsers/nasm/tests/newsect.hex @@ -0,0 +1,4 @@ +41 +42 +43 +44