diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-12-20 21:08:55 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-20 21:08:55 +0100 |
commit | 84490e821deee16fe8155df2b9328c23d953c4fb (patch) | |
tree | fd5375aecd92a64c156191fc3293a414184af06e /testsuite/gna | |
parent | c3ed5c426b8be1144574b9e33135450cf6ceab1a (diff) | |
download | ghdl-84490e821deee16fe8155df2b9328c23d953c4fb.tar.gz ghdl-84490e821deee16fe8155df2b9328c23d953c4fb.tar.bz2 ghdl-84490e821deee16fe8155df2b9328c23d953c4fb.zip |
testsuite/gna: adjust for windows.
Diffstat (limited to 'testsuite/gna')
-rw-r--r-- | testsuite/gna/README | 25 | ||||
-rwxr-xr-x | testsuite/gna/bug032/testsuite.sh | 6 | ||||
-rwxr-xr-x | testsuite/gna/bug063/testsuite.sh | 2 | ||||
-rwxr-xr-x | testsuite/gna/issue147/testsuite.sh | 5 | ||||
-rwxr-xr-x | testsuite/gna/issue176/testsuite.sh | 6 | ||||
-rwxr-xr-x | testsuite/gna/issue67/testsuite.sh | 6 | ||||
-rwxr-xr-x | testsuite/gna/issue98/testsuite.sh | 6 | ||||
-rwxr-xr-x | testsuite/gna/ticket24/testsuite.sh | 4 | ||||
-rwxr-xr-x | testsuite/gna/ticket30/testsuite.sh | 4 |
9 files changed, 56 insertions, 8 deletions
diff --git a/testsuite/gna/README b/testsuite/gna/README new file mode 100644 index 000000000..f2489f91a --- /dev/null +++ b/testsuite/gna/README @@ -0,0 +1,25 @@ +Tests +----- + +This directory contains a regression testsuite. See the driver testsuite.sh +for naming convention. + +The tests are run by a unix shell like bash (not a c-shell). This is fine +under Linux and MacOS-X, but creates issues on Windows. + +Here are some tips for portability. + +- Do not create complex driver, keep them simple. +- pipes (commands list separated by |) do not work well on windows if one + process exits early. On unix, writers are killed by SIGPIPE but on windows + they aren't (SIGPIPE doesn't exist) and reports errors. + So avoid program that may exit before reading all the input: + * instead of 'grep -q xxx', use 'grep xxx > /dev/null' +- reference files use unix end of line. Use 'diff --strip-trailing-cr' to + compare expected output with a reference file. +- don't forget that executable files have a .exe suffix on windows, but most + cygwin tools transparently add the suffix. +- For VPI tests, the directory containing the dll file must be added in PATH. + See issue98 for an example. +- As a last resort, you can test if you are on Windows: + if [ "$OS" = "Windows_NT" ]; then ... diff --git a/testsuite/gna/bug032/testsuite.sh b/testsuite/gna/bug032/testsuite.sh index 5e3301810..d145c461d 100755 --- a/testsuite/gna/bug032/testsuite.sh +++ b/testsuite/gna/bug032/testsuite.sh @@ -1,5 +1,11 @@ #! /bin/sh +if [ "$OS" = "Windows_NT" ]; then + # Many issues with blanks in command line. Not worth fixing it. + echo "Test skipped on windows" + exit 0 +fi + . ../../testenv.sh # Incorrect options are always rejected (analyze_failure doesn't work here) diff --git a/testsuite/gna/bug063/testsuite.sh b/testsuite/gna/bug063/testsuite.sh index 5bb108e0f..e3ffefd9f 100755 --- a/testsuite/gna/bug063/testsuite.sh +++ b/testsuite/gna/bug063/testsuite.sh @@ -3,7 +3,7 @@ . ../../testenv.sh analyze_failure dff.vhdl 2> dff.out -diff dff.out dff.expected +diff --strip-trailing-cr dff.out dff.expected rm -f dff.out clean diff --git a/testsuite/gna/issue147/testsuite.sh b/testsuite/gna/issue147/testsuite.sh index 84a22c0a7..5bc1c80b7 100755 --- a/testsuite/gna/issue147/testsuite.sh +++ b/testsuite/gna/issue147/testsuite.sh @@ -13,8 +13,9 @@ rmdir work1 # Some simple checks if test -f simple || test -f 'e~simple.o'; then - echo "Not correctly cleaned" - exit 1 + echo "Not correctly cleaned" + ls -l + exit 1 fi echo "Test successful" diff --git a/testsuite/gna/issue176/testsuite.sh b/testsuite/gna/issue176/testsuite.sh index e8562e586..26ef8fa12 100755 --- a/testsuite/gna/issue176/testsuite.sh +++ b/testsuite/gna/issue176/testsuite.sh @@ -2,8 +2,10 @@ . ../../testenv.sh -$GHDL --file-to-xml t2.vhdl | grep -q "01X" -$GHDL --file-to-xml test.vhdl | grep -q '"00"' +# Don't use grep -q, as SIGPIPE doesn't exist on windows. + +$GHDL --file-to-xml t2.vhdl | grep "01X" > /dev/null +$GHDL --file-to-xml test.vhdl | grep '"00"' > /dev/null clean echo "Test successful" diff --git a/testsuite/gna/issue67/testsuite.sh b/testsuite/gna/issue67/testsuite.sh index 3ed6c40d7..581db85c4 100755 --- a/testsuite/gna/issue67/testsuite.sh +++ b/testsuite/gna/issue67/testsuite.sh @@ -1,5 +1,11 @@ #! /bin/sh +# Missing SEH handler on windows-64. +if [ "$OS" = "Windows_NT" -a "$PROCESSOR_ARCHITECTURE" = "AMD64" ]; then + echo "Test skipped" + exit 0 +fi + . ../../testenv.sh analyze nullacc.vhdl diff --git a/testsuite/gna/issue98/testsuite.sh b/testsuite/gna/issue98/testsuite.sh index 23746d630..f30613c5f 100755 --- a/testsuite/gna/issue98/testsuite.sh +++ b/testsuite/gna/issue98/testsuite.sh @@ -2,6 +2,12 @@ . ../../testenv.sh +if [ "$OS" = "Windows_NT" ]; then + vpi_lib=`$GHDL --vpi-library-dir | sed -e 's!\\\\!/!g' -e 's!^C:!/C!g'` + echo vpi_lib: $vpi_lib + PATH="$PATH:$vpi_lib" +fi + analyze test_load.vhdl $GHDL --vpi-compile -v gcc -c vpi1.c $GHDL --vpi-link -v gcc -o vpi1.vpi vpi1.o diff --git a/testsuite/gna/ticket24/testsuite.sh b/testsuite/gna/ticket24/testsuite.sh index 2609c6022..1336ae331 100755 --- a/testsuite/gna/ticket24/testsuite.sh +++ b/testsuite/gna/ticket24/testsuite.sh @@ -5,7 +5,7 @@ analyze -fpsl psl.vhdl elab_simulate -fpsl psl --psl-report=psl.out -if ! cmp psl.out psl.ref; then +if ! diff --strip-trailing-cr psl.out psl.ref > /dev/null; then echo "report mismatch" exit 1 fi @@ -18,7 +18,7 @@ GHDL_STD_FLAGS="-fpsl --std=08" analyze psl.vhdl elab_simulate psl --psl-report=psl.out -cmp -s psl.out psl.ref +diff --strip-trailing-cr -q psl.out psl.ref rm -f psl.out clean diff --git a/testsuite/gna/ticket30/testsuite.sh b/testsuite/gna/ticket30/testsuite.sh index 0d33bb257..dd6d640a6 100755 --- a/testsuite/gna/ticket30/testsuite.sh +++ b/testsuite/gna/ticket30/testsuite.sh @@ -2,7 +2,9 @@ . ../../testenv.sh -if ! "$GHDL" --dir ieee | grep -q vital; then +# Don't use grep -q, doesn't work on windows. + +if ! "$GHDL" --dir ieee | grep vital > /dev/null; then echo "No vital libraries, skipping" exit 0 fi |