Commit Graph

64 Commits

Author SHA1 Message Date
kre e588572b24 Grunge. I know I fixed this typo before... must have been in a different
couy of the test.
2016-05-12 14:25:11 +00:00
kre 2f35ca415e Verify that questionable characters don't have bad associates.
ok christos@
2016-05-12 13:34:23 +00:00
kre 5ab36d6022 Add a test for fd redirections on functions in loops (the etcupdate issue)
and also fix a quoting bug which was causing a test to fail, though
ATF was ignoring (an ATF bug to be investigated later.)

OK christos@
2016-05-11 17:43:17 +00:00
kre 07e424459c PR bin/48875 PR bin/51123 This adds tests more that verify fide descriptor
redirection works correctly (including that the bugs reported in those PRs
are fixed.)  Note that the tests for 48875 are slow, so one of the new
test cases ends up running > 25 seconds (just doing sleeps) - each individual
test is just a few seconds, but there are several of them.

OK christos@
2016-05-09 22:34:37 +00:00
kre 44b3998960 Remove the trap_zero__explicit_return test case - it was testing undefined
behaviour (and failed with the NetBSD shell, and was marked as expected to
fail.)   Other shells do different things.   The test was worthless, and is
now gone.

OK christos@
2016-05-07 23:51:30 +00:00
christos 28ac500a6d More redirect tests, in particular, tests for redirects to/from
file descriptors outside the 0..9 range, and complex fd
reassignments.  Also test that the shell can cope with the
value of ulimit -n changing (downwards, up is harmless)
(Freom kre@)
2016-05-02 01:47:14 +00:00
christos c6dfc962be use "" so ${TEST_SH} is expanded. 2016-04-29 18:29:17 +00:00
christos 2e4e2294f3 Add a test case for here documents positioned outside `` with the
redirect operator inside the ``.   Move the one similar test using
$( ) into its own test case (and expand that test as well.
The `` case was omitted before, as no shells (including NetBSD) were
parsing it correctly,  Now the NetBSD shell does, so ... (from kre@)
2016-04-04 12:40:13 +00:00
christos 9f1b8a789b Avoid leaving turds in /tmp. (from kre@) 2016-03-31 16:22:54 +00:00
christos 87a25451df When embedding a command in a subshell "( ... )" avoid accidentally
producing (( (when the cmd starts with a '(' as that as a reserved
sequence (according to posix) and some shells do treat it specially.
So, force a space after the enclosing '(' to avoid the problem.
For symmetry, put a space before the concluding ')' as well, though
there is nothing special about )). (from kre@)
2016-03-31 16:22:27 +00:00
christos de3efde923 Added lots more end delimiter tests (some weird cases...). Also
use printf %s instead of echo, as there are embedded \ chars in
some of the strings, and some other (nameless) shells insist on
treating \ in the args to echo as something special... (from kre@)
2016-03-31 16:21:52 +00:00
christos 3f90444865 PR bin/51027 - tests for shell positional parameters, including
testing that $10 is correctly parsed as ${1}0 and not as ${10}.
More than that though. (from kre@)
2016-03-31 16:21:10 +00:00
christos 54d4333f65 Added tests collected by Sven Mascheck
http://www.in-ulm.de/~mascheck/various/cmd-subst/
which test cases of ')' being embedded in command substitutions.
(from kre@)
2016-03-31 16:20:39 +00:00
christos 8f7ab1d41a Don't confuse more capable shells by writing operator combinations
that could be interpreted as something different. That is, for our
shell +4++3 is just (+4)+(+3) and works fine. But others treat ++
as the increment operator.  Same for --. Sprinkle spaces to taste.
(from kre@)
2016-03-31 16:19:52 +00:00
christos 32b59da6c9 Allow for testing other than /bin/sh using TEST_SH (from kre@) 2016-03-27 14:57:50 +00:00
christos aa36454cd0 Finish these tests (or at least, fill in the place holder tests
with actual code ... tests are never really finished.)  One of these
new tests was how the bug in PR bin/50993 was discovered. (from kre@)
2016-03-27 14:53:17 +00:00
christos bb5046e57f PR bin/50993 - lots of new here document tests to validate all of
the changes made to fix that PR.   LOTS more tests...  A few general
improvements to the way the tests work and results are reported
as well. (from kre@)
2016-03-27 14:52:40 +00:00
christos e0530cd421 More tests, add protection against shells that allow wait N
to wait for the same process over and over again (forever) (???)
This test now takes slightly over 20 seconds to complete (elapsed
time) caused by all the waiting on sleep commands being run in
the background. (from kre@)
2016-03-27 14:50:40 +00:00
christos c43f84898f Finish TEST_SH - all tests should support it now.
Misc other KNF changes, minor bug fixes, and a few minor
extra tests added. (from kre@)
2016-03-27 14:50:01 +00:00
christos 8130505f80 Avoid relying on the test shell correctly implementing $(( ))
in order for some of the redirect tests to terminate. (from kre@)
2016-03-27 14:49:07 +00:00
christos bb9d40a374 new command substitution test from kre 2016-03-20 22:57:04 +00:00
christos e04f666a7e Better tests for redircloexec and add t_shift (from kre) 2016-03-16 21:13:51 +00:00
christos 487f18f8df remove binary test and other cleanups (from kre) 2016-03-16 17:39:12 +00:00
christos 96320c1795 New tests from kre 2016-03-16 15:49:19 +00:00
christos 239c335529 Add some redir-close-on-exec tests 2016-03-13 18:55:12 +00:00
christos 796504694c Implement TEST_SH for this test, add a test or two, and also some
commentary to explain some of the weirdness of shell quoting. (from kre@)
2016-03-12 14:58:03 +00:00
christos acfb0ca6d6 Set TEST_SH 2016-03-10 22:30:57 +00:00
christos 2c3c3b3c5b Added more test cases, more exhaustive testing. (from kre) 2016-03-08 14:26:54 +00:00
christos c5b16bb470 remove old test 2016-03-08 14:26:34 +00:00
christos e4619cdffb Tests for the shift builtin (from kre) 2016-03-08 14:26:26 +00:00
christos 491442e6cd This test tests nothing not tested elsewhere, and doesn't
do a very good job of that. Bang! (from kre)
2016-03-08 14:24:50 +00:00
christos c74a97456e Complete implementation of TEST_SH, use builting kill (which does
work, now anyway) rather than working around a defect by using
/bin/kill (if the shell is broken, the test should fail, not succeed)
and test more aspects of the wait builtin in the kill test. (from kre)
2016-03-08 14:24:06 +00:00
christos 764b20ba6a Cleanup left over (dead) debugging code (from kre) 2016-03-08 14:21:02 +00:00
christos e408fa7e5e Correct one test that (while OK for NetBSD) insisted on behaviour
that is not required by the standard. The test now allows either
of the two allowed responses. Also add commentary correcting
erroneous comments about what is correct, and incorrect. (from kre)
2016-03-08 14:20:22 +00:00
christos dd894f6fca Correct the way that TEST_SH is used so that the tests work as
intended when TEST_SH is specifies a shell that needs options (like
sh -F, or bash -o posix). (from kre)
2016-03-08 14:19:28 +00:00
christos 06f9bef68e Improved handling of TEST_SH so that it is possible to define it
to the name of a shell, plus options that shell needs to run it
in the correct mode to be tested: eg: TEST_SH='bash -o posix'
Also finished the implementation of tests of "set -n" now that
the NetBSD shell supports that as it should. (from kre)
2016-03-01 12:39:35 +00:00
christos 1843eb8cb0 more tests from kre 2016-02-29 23:52:53 +00:00
christos 22e9b677fe uncomment clean up 2016-02-24 14:42:50 +00:00
christos b189a00530 Test improvements from kre 2016-02-24 14:42:06 +00:00
christos c1ce7cf3ee Add t_option, from kre (with minor edits from me) 2016-02-23 16:20:42 +00:00
christos dd10ee88d0 Add new redirection test, from kre 2016-02-23 14:21:37 +00:00
christos 7b91d0e80f PR/43469 has been fixed 2016-02-22 20:02:29 +00:00
christos 449b5d003c Add new test 2016-02-22 19:52:03 +00:00
christos dd7e4e3700 undo accidental commit 2016-02-19 13:49:01 +00:00
christos 64d8e9d299 Add a test for PR/50827 2016-02-19 13:48:28 +00:00
christos 585297dcfb more robust ulimit test that works with most variants of bourne shells. 2015-12-30 22:24:44 +00:00
ozaki-r 3f3bb7d2ee Add delay to improve stability of test 2015-09-30 06:08:36 +00:00
christos 7ec9eaaab4 another wait test. 2015-08-23 07:15:16 +00:00
dholland 83a65169bb Visit the Bureau of Redundancy Department.
From Henning Petersen in PR 49191.
2014-09-11 18:25:30 +00:00
apb 91bc8fa990 Run scripts at build time via ${HOST_SH} 2014-07-27 14:24:17 +00:00