Commit Graph

34 Commits

Author SHA1 Message Date
Rob Landley
77381506e9 Don't force "make tests" or scripts/tests.sh to rebuild every time. 2023-01-09 15:34:54 -06:00
Rob Landley
04c395d51e Fix ASAN=1 with make test_command.
Test-built binaries were stripped even when ASAN was enabled (thus
the stack dump couldn't give line numbers) because in portability.sh
the CFLAGS change was exported but NOSTRIP=1 was local, and ASAN was
unset to prevent duplicate appends to FLAGS. When
test.sh->single.sh->make.sh it inherited only the CFLAGS change.

While I was there I cleaned up test.sh not to call back into make,
instead call the other scripts directly. (Cleaner layering.)
2022-11-21 23:14:40 -06:00
Rob Landley
959bf34619 Test suite update.
Reorder functions to group helpers and API, eliminate SKIPNEXT and make
SKIP a count (with optional setting it to 99999), fix txpect to actually
listen to exit codes (wait needs PID else rc always 0), allow multiple X
from txpect (since shxpect adds an X0 at end which could be duplicate),
simplify some stuff, adjust tests for new SKIP + txpect X semantics
2022-09-03 07:00:36 -05:00
Rob Landley
07bbc1f612 Fix "VERBOSE=all make tests" failure reporting.
Moving the tests into a subshell (commit e00b4c2655) broke it and
commit de474ba039 wasn't a complete fix.
2022-07-04 04:34:58 -05:00
Rob Landley
a125ba10bc Fix TEST_HOST path using symlinked command. 2021-07-24 12:13:44 -05:00
Rob Landley
de474ba039 Fix "make tests" exiting on failure when test run in subshell. 2021-06-02 06:46:47 -05:00
Rob Landley
e00b4c2655 Clear environment variables between tests. 2021-06-01 22:03:07 -05:00
Rob Landley
d6a0b3031f Have "make tests" fail if any of the tests failed.
This is sort of a hack because I want to move the individual tests to
subshells, which means they don't have a shared shell context. Functions
and variables not persisting into later tests is a good thing (test environments
polluting each other), but it makes accumulating FAILCOUNT more awkward.
2020-06-16 21:14:35 -05:00
Rob Landley
6b6436c848 Fix syntax checking for "if true; then echo hello | fi", fix some tests,
slightly more elaborate debug output.
2020-05-26 05:23:58 -05:00
Rob Landley
ce67bb5ac8 Teach scripts/test.sh to skip TEST_HOST commands that aren't installed. 2020-05-13 01:28:09 -05:00
Rob Landley
01864337c4 Fix "make tests". (realpath was replacing command name with "toybox".) 2020-05-11 13:23:26 -05:00
Rob Landley
b35e4740b3 Resolve absolute paths in places input can vary. 2020-04-30 11:24:17 -05:00
Rob Landley
c77018116c testcmd shouldn't use shell builtin for TEST_HOST unless there isn't
one in $PATH.
2019-06-26 23:42:14 -05:00
Rob Landley
fe12fb5146 Do a rm -rf of testdir between each command so debris files don't accumulate. 2019-03-10 18:17:16 -05:00
Rob Landley
b67a5a07b0 Have test.sh use portability.sh too. 2019-01-19 17:00:26 -06:00
Rob Landley
80e5d01eb0 Break runtest.sh out again: the Android devs were using it. 2018-12-03 17:04:23 -06:00
Rob Landley
b742998a26 Teach testcmd to say short name rather than full path. 2018-12-02 16:53:03 -06:00
Rob Landley
01844db4fb Merge runtest.sh into test.sh. 2018-12-02 16:22:41 -06:00
Rob Landley
7f062f2dcf Skip tests that don't have the executable bit set unless $TEST_ALL set. 2018-11-20 17:50:05 -06:00
Rob Landley
6e2ef60264 testcmd should only use absolute path to command when not doing TEST_HOST. 2017-07-22 17:00:11 -05:00
Rob Landley
ee14fc396d Test infrastructure: collate make "test_single" and "make tests" into common
function, and add $C variable with an absolute path to the command being tested
(you need to call things like printf by path to avoid shell builtins, might as
well be consistent).
2016-10-18 16:52:17 -05:00
Rob Landley
1ffa7f45eb Fix bzcat.test (as noted by Andy Chu), wean tests off $TOPDIR and supply $FILES
instead, move tests/blkid into tests/files/blkid.
2016-03-23 03:44:51 -05:00
Rob Landley
336c44adca Factor out command name at the start of test name, have runtest.sh print it. 2016-03-02 15:20:04 -06:00
Rob Landley
deb31c8294 Locale setting is case sensitive. 2016-01-15 16:58:42 -06:00
Rob Landley
7ca907824d Fix sort -f, add tests, make TEST_HOST pass new tests. 2016-01-15 12:38:32 -06:00
Rob Landley
387edf547e Move testsuite out of scripts/test into its own top level tests directory, and make ctrl-c kill "make test" more reliably. 2014-09-20 13:09:14 -05:00
Rob Landley
4a855d6cf6 Have "make test" run tests in testdir/testdir instead of same directory as command symlinks. (Makes cleanup easier.) 2014-07-03 22:09:11 -05:00
Rob Landley
dcf52cbf25 Remove leftover debris from scripts/test.sh that screws up single tests with single.sh. 2013-11-14 00:18:13 -06:00
Rob Landley
26f52eb13e Teach scripts/test.sh to call scripts/single.sh. 2013-10-15 00:57:39 -05:00
Rob Landley
728c94a002 Work around a Bash bug that removes "." from the $PATH when you're root. (The FSF believes it knows better than you, and won't let you do things, in the name of Freedom.) 2012-06-24 15:26:53 -05:00
Rob Landley
37256ff6f3 Adjust "optional" function (gen_config.h became generated/config.h). 2008-06-22 00:57:15 -05:00
Rob Landley
e156d44eb2 More tweaks to rmdir.test and the testing infrastructure. 2008-05-04 19:44:39 -05:00
Rob Landley
c564834cdc Teach run-all-tests mode to only test enabled commands. 2008-05-04 16:03:10 -05:00
Rob Landley
9d243a2efc Update help, move test.sh to scripts, and fix "make test" to call right script. 2008-03-28 00:44:44 -05:00