Tests
-----

This directory contains a regression testsuite.

Each test correspond to one report, and is put in one directory (using
the support/bug number)

* bug0XX is for bugs not reported.
* bug[1-9]XXX is for bugs reported on https://gna.org/bugs/?group=ghdl
* srXXX is for support reported on https://gna.org/support/?group=ghdl
* debXX is for bugs report on https://www.debian.org/Bugs/
* ticketXX is from https://sourceforge.net/p/ghdl-updates/tickets/
* issueXXX is from https://github.com/ghdl/ghdl/issues

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_nocr' (from testenv.sh) 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.
- As a last resort, you can test if you are on Windows:
  if [ "$OS" = "Windows_NT" ]; then ...


VPI tests: on windows the directory containing the DLL file must be added in
PATH. From issue98:
--------------------------------------------------
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
--------------------------------------------------

GHDL could be configured without wave dump support. If you need to test ghw,
you should test if the feature is supported.  From issue158:
--------------------------------------------------
if ghdl_has_feature repro ghw; then
  simulate repro --wave=repro.ghw
  ghw_diff repro
  rm -f repro.txt repro.ghw
fi
--------------------------------------------------