22 Commits

Author SHA1 Message Date
Simon Sobisch
3aedd28670 remove unused DO_COMPARISON 2023-03-15 13:36:52 -04:00
Eric S. Raymond
a67532dd57 Remove now-unused parts of test/testwrapper.sh. 2020-11-16 06:10:47 -05:00
Eric S. Raymond
22b9ea63bd Remove the ".one" category of tests; they've been replaced by rulesets.
This reduces the complexitry of the test machinery as well as making
tests less backend-specific.
2020-11-16 05:54:38 -05:00
Eric S. Raymond
a110b3b67d Simplify testwrapper.sh by abolishing the -t option.
It's easy enough to tell if a testfile wants a table by looking at its
name.  Getting rid of this option is a step towards putting all
tableopts tests in the generated set so they are trivially portable to
new back ends.
2020-10-21 17:13:01 -04:00
Daniel Brooks
8be9597d7d Use shellcheck on most of the shell scripts in the repository.
And add a "lint" target that runs shellcheck on them.
2020-10-21 17:08:22 -04:00
Eric S. Raymond
30b86fbc07 Abolish reject.l4; all the reject tests are in the new system now.
Still have the tableopts tests to do.
2020-10-20 15:51:58 -04:00
Eric S. Raymond
c23d0161dc Cut down on input-file proliferation.
With a minor tweak to testwrapper we can allow all the versions of
a test for different back ends (counting _r and _nr as back ends)
to share a common input file.
2020-10-17 22:12:25 -04:00
Explorer09
b4735d6925 test: echo 'set -v' before setting so in shell. 2017-06-04 16:15:23 -04:00
Will Estes
2c0152a0c3 test: remove duplicate shell options line 2017-05-26 11:21:16 -04:00
Explorer09
bcf7a07369 test: Remove test scripts bashisms.
They now all work under a POSIX compliant sh. Specifically, 'dash' can
now be used for running "make check" tests.

Note that none of these scripts has ever been using a pipe, so
`set -o pipefail` is unnecessary and removed.
2017-01-17 21:10:16 -05:00
Explorer09
8c8691c3fd test: exit on '-1' test non-zero status.
If a '-1' test program returns a non-zero status, don't go further and
compare it's (numeric) output values. This allows a '-1' test to
indicate a "skip" status or an otherwise error. (Currently no such '-1'
test would skip like this, though.)

Shell syntax note: `set -e` will not exit with the syntax like this
`test $(false) = $(false);`. The exit statuses of `false` in the
example will be ignored instead. But putting the output in a variable,
such as `VAR=$(false)`, DOES exit.
2017-01-17 21:08:42 -05:00
Will Estes
98fd512f9a test: drop .exe when making input file names 2016-05-20 17:31:27 -04:00
Mike Frysinger
4082a04921 tests: fixed paths to input files.
The current test wrapper works only when the inputs are specified using
relative paths.  If they're specified with absolute paths, the driver
fails to detect the inputs because it always prepends the input dir name
which itself is a relative path:
$ cd tests
$ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table
<fails to open inputs>

This normally doesn't show up because people run `./configure` or, for
out of tree builds, `../configure`.  But if you happen to run configure
with an absolute path, then automake tends to generate absolute paths
as well leading to test failures.

Fix all of this by dropping the implicit input directory prepending.

- INPUT_NAME is often a list of files, not just a single one
- the input directory is used to find the testname tables which are
  usually generated, so it's impossible to use files from both source
  and build directories
- most of the time, the full/correct path is already specified
2015-12-13 19:02:51 -05:00
Will Estes
f4ec87b6d9 use unofficial bash strict mode and cleanups in supporting bash scripts 2014-11-12 05:14:28 -05:00
Will Estes
7442349dab refactor lineno_nr test for new test suite layout 2014-11-12 05:14:28 -05:00
Will Estes
9b9780e3c7 refactor cxx_yywrap test for new test suite layout 2014-11-12 05:14:28 -05:00
Will Estes
7563365413 refactor rescan_r test for new test suite layout 2014-11-12 05:14:28 -05:00
Will Estes
dd021b412c Refactor rescan_nr test for new test suite layout.
Also add -r option to testwrapper.sh to support passing input file as
a command line argument to the test scanner without using shell
redirection.
2014-11-12 05:14:27 -05:00
Will Estes
99e4880ccd Refactor reject test for new test suite layout.
Split out reject test into its constituant tests. Add .reject tests
and .table tests for automake test log generation. Rewrite
testwrapper.sh to handle running with a tables file and specifying
optional input using command line options rather than positional
parameters.
2014-11-12 05:14:27 -05:00
Will Estes
778b4742ed Check if test input file exists.
Not all tests have input files, so check if one exists and run the
test program accordingly.
2014-11-12 05:14:27 -05:00
Will Estes
fddc982e9f make tests/testwrapper.sh more verbose; find input in srcdir
Since output is redirected by the automake parallel test suite driver,
turn on both -v and -x in bash for the testwrapper.sh shell
script. This helps a ton in debugging problems with the test harness
itself.

In general, the input files are in automake's srcdir and the name of
the test includes the relative path to it (even though that's supposed
to be ./). Therefore, pass srcdir in AM_LOG_FLAGS and prepend that to
the test name as part of constructing the input file's name.
2014-11-12 05:14:26 -05:00
Will Estes
382be5cdc5 refactor basic-nr test for new test suite layout 2014-11-12 05:14:25 -05:00