summaryrefslogtreecommitdiff
path: root/tests/thelp.pl
Commit message (Collapse)AuthorAgeFilesLines
* * tests/scripts/options/dash-l: Simplify the test via the helperPaul Smith2023-02-261-11/+25
| | | | * tests/thelp.pl: Add "exist" and "noexist" operators.
* [SV 62654] Support GNU Make on z/OSPaul Smith2023-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original patches provided by Igor Todorovski <itodorov@ca.ibm.com> Reworked by Paul Smith <psmith@gnu.org>. Thanks to IBM for providing a test system. * NEWS: Announce support. * AUTHORS: Ditto. * README.zOS: Provide details on building GNU Make on z/OS. * build.sh (get_mk_var): z/OS sh has a strange bug which causes it to generate extra lines of output: rework the function to print output as we compute it instead of collecting it into a variable, which works around this bug. * src/makeint.h: Declare MK_OS_ZOS if we're building for z/OS. * src/arscan.c: Don't include <ar.h> on z/OS. * src/job.c: We can't change environ in ASCII mode on z/OS. * src/main.c: Ditto. Also we can't use pselect() on z/OS. * src/posixos.c: pselect() seems to hang on z/OS: don't use it. * tests/run_make_tests.pl: Handle different exit codes on z/OS. * tests/test_driver.pl: Preserve some special z/OS env.vars. Add special checks to output comparisons when on z/OS. * tests/scripts/features/archives: Don't validate names. Don't try to compile empty files as IBM compilers complain. * tests/scripts/features/shell_assignment: Fix octal value of #. * tests/scripts/features/temp_stdin: Don't print "term". * tests/scripts/functions/shell: Handle shell exit codes. * tests/scripts/targets/ONESHELL: Ditto. * tests/scripts/targets/POSIX: sh -x prints differently. * tests/scripts/variables/SHELL: Ditto.
* [SV 61463] Don't export inherited private variablesPaul Smith2023-01-021-1/+12
| | | | | | | | | | | If a parent target has an exported variable that is private, don't export it in child targets. * NEWS: Mention this change. * src/variable.c (target_environment): Ignore private inherited variables. * tests/thelp.pl: Add a new "env" operation to show env.var. values. * tests/scripts/variables/private: Verify this new behavior.
* Avoid using false(1) in regression testsPaul Smith2022-12-311-1/+1
| | | | | | | | | | | | The POSIX standard only requires false(1) to return a "non-zero" exit code; almost all systems return 1 but some (Solaris!!!) return 255 or possibly even other values. Use our helper "fail" instead. * tests/thelp.pl: Have the "fail" command obey -q. * tests/scripts/features/parallelism: Helper -q no longer prints fail. * tests/scripts/targets/POSIX: Replace false with #HELPER# -q fail 1. * tests/scripts/variables/MAKEFLAGS: Ditto. * tests/scripts/variables/SHELL: Ditto.
* [SV 63315] tests: Simplify TERM signalingPaul Smith2022-11-131-0/+7
| | | | | | | | | | | | Tests that try to kill the make process were not behaving as expected on OpenBSD: the signal was sent from make to its children but the sleep didn't die. Something odd about the way the shell treats TERM. To reduce platform dependencies add "term" to the helper tool and run that instead of kill / sleep. * tests/thelp.pl: Add a new operation "term" that takes a PID. * tests/scripts/features/output-sync: Use it. * tests/scripts/features/temp_stdin: Ditto.
* Enhance tests to work on different systemsPaul Smith2022-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | The GNU platform testers reported a number of test errors on different systems; try to address them. * tests/thelp.pl: A number of tests timed out with a 4-second timeout. Increase the default timeout to 10 seconds. * tests/run_make_tests.pl: Executing directories on cygwin behaves differently in Perl than make so skip these tests there. * tests/scripts/options/symlinks: Check for the symlink feature in make, rather than whether the system supports them. * tests/scripts/features/implicit_search: On some systems "false" exits with a different exit code. Use the helper instead. * tests/scripts/features/loadapi: Ditto. * tests/scripts/features/output-sync: Sleep before make -f bar in the first test as well as the second one. * tests/scripts/features/exec: Skip on cygwin, which seems to be "UNIX" but where scripts don't run normally. * tests/scripts/misc/fopen-fail: Skip on cygwin, where make eventually exits with exit code 0 and no error messages.
* [SV 58497] Ensure $(file <) newline removal succeedsPaul Smith2021-03-151-1/+6
| | | | | | | | | | | | | Keep a count of bytes read rather than comparing pointers since the variable_buffer might get reallocated. Bug and patch by Ken Tossell <ken@tossell.net> Regression tests by Dmitry Goncharov <dgoncharov@users.sf.net> Tweaked by Paul Smith <psmith@gnu.org> * src/function.c (func_file): Use bytes read rather than a pointer. * tests/scripts/functions/file: Provide various tests for reading empty files, files with/without newlines, and large files.
* Rename jhelp.pl to thelp.pl and make it a generic test helper.Paul Smith2019-12-161-0/+113
* tests/thelp.pl: Rename from tests/jhelp.pl. (op): Use names instead of options for the operations. (op): Add new operations for sleep, mkdir, and rm. (op): Enhance wait to time out * tests/run_make_tests.pl: Add a new #HELPER# replacement (subst_make_string): Use fully-qualified path to thelp.pl * tests/scripts/features/parallelism: Update to use thelp.pl and the new named operations. Use thelp.pl sleep instead of system-specific sleep commands. * tests/scripts/features/output-sync: Update to use thelp.pl instead of complex shell scripts. * Makefile.am: Distribute tests/thelp.pl instead of tests/jhelp.pl