summaryrefslogtreecommitdiffstats
path: root/tools/regression/bin
Commit message (Collapse)AuthorAgeFilesLines
* sh: Recognize "--" and explicitly reject options in wait builtin.jilles2013-03-152-0/+7
| | | | | | If syntactically invalid job identifiers are to be taken as jobs that exited with status 127, this should not apply to options, so that we can add options later if need be.
* sh: When executing a trap, keep exit status along with evalskip.jilles2013-03-031-0/+10
| | | | | | | This ensures 'return' in a trap returns the correct status to the caller. If evalskip is not set or if it is overridden by a previous evalskip, keep the old behaviour of restoring the exit status from before the trap.
* Enhance test(1) by adding provision to compare any combination of thepeterj2013-02-251-1/+64
| | | | | | | | | access, birth, change and modify times of two files, instead of only being able to compare modify times. The builtin test in sh(1) will automagically acquire the same expansion. Approved by: grog MFC after: 2 weeks
* sh: If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig.jilles2013-02-232-0/+24
|
* sh: Test that the exit status is 1 if read encounters EOF.jilles2013-02-231-0/+5
|
* sh: Pass $? to command substitution containing compound/multiple commands.jilles2013-01-141-0/+5
| | | | | Example: false; echo $(echo $?; :)
* sh: Add testcase that $? is preserved into a simple command substitution.jilles2013-01-131-0/+5
| | | | | The test builtins/trap6.0 already uses this but having it separate eases diagnosis if this would break.
* sh: Add some testcases related to subshells.jilles2013-01-135-0/+25
| | | | | These failed in earlier attempts to execute more subshells without forking. The patches are uncommitted.
* sh: Fix crash when parsing '{ } &'.jilles2013-01-131-0/+7
| | | | MFC after: 1 week
* sh: Don't lose $? when backquoted command ends with semicolon or newline.jilles2013-01-132-0/+10
| | | | | | | | | An empty simple command was added and overwrote the exit status with 0. This affects `...` but not $(...). Example: v=`false;`; echo $?
* sh: Detect and flag write errors on stdout in builtins.jilles2012-12-121-0/+3
| | | | | | | If there is a write error on stdout, a message will be printed (to stderr) and the exit status will be changed to 2 if it would have been 0 or 1. PR: bin/158206
* sh: Apply rlimits to parser/alias10.0 so it fails fast.jilles2012-11-181-0/+4
| | | | Requested by: uqs
* sh: Add tests for modifying an alias (r242766).jilles2012-11-083-0/+21
| | | | | Note: parser/alias10.0 will eat a lot of memory/cpu time when it fails (with the old sh).
* sh: Test that a redefined alias works.jilles2012-11-071-0/+6
|
* sh: Add some tests for aliasing a utility to itself.jilles2012-09-222-0/+8
|
* sh: Add a simple test for the "local" builtin.jilles2012-07-151-0/+13
|
* sh: Expand assignment-like words specially for export/readonly/local.jilles2012-07-155-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | Examples: export x=~ now expands the tilde local y=$1 is now safe, even if $1 contains IFS characters or metacharacters. For a word to "look like an assignment", it must start with a name followed by an equals sign, none of which may be quoted. The special treatment applies when the first word (potentially after "command") is "export", "readonly" or "local". There may be quoting characters but no expansions. If "local" is overridden with a function there is no special treatment ("export" and "readonly" cannot be overridden with a function). If things like local arr=(1 2 3) are ever allowed in the future, they cannot call a "local" function. This would either be a run-time error or it would call the builtin. This matches Austin Group bug #351, planned for the next issue of POSIX.1. PR: bin/166771
* sh: Add tests where "export" does not parse differently.jilles2012-07-131-0/+13
| | | | | | | | It is planned to expand variable assignments as assignments (no word splitting, different tilde expansion) when they follow a "declaration utility" (export, readonly or local). However, a quoted character cannot be part of a "name" so things like \v=~ are not assignments, and the existing behaviour applies.
* sh: Do not assume that SIGPIPE will only kill a subshell in builtins/wait3.0jilles2012-06-081-1/+1
| | | | | | | | | | | | | | test. POSIX says that SIGPIPE affects a process and therefore a SIGPIPE caused and received by a subshell environment may or may not affect the parent shell environment. The change assumes that ${SH} is executed in a new process. This must be the case if it contains a slash and everyone appears to do so anyway even though POSIX might permit otherwise. This change makes builtins/wait3.0 work in ksh93.
* sh: Add a test for variables with underscores in arithmetic.jilles2012-03-111-0/+4
| | | | | Things like $((_x+1)) are broken in stable/8 sh but work in stable/9 and head.
* sh: Make 'hash' return 1 if at least one utility is not found.jilles2012-02-111-0/+6
| | | | Reported by: lme
* sh: Fix $? in the first command of a 'for'.jilles2012-01-222-0/+17
| | | | | | In the first command of a 'for', $? should be the exit status of the last pipeline (command substitution in the word list or command before 'for'), not always 0.
* sh: Fix execution of multiple statements in a trap when evalskip is setdumbbell2012-01-162-0/+14
| | | | | | | | | | | Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when: o "-e" is set for this shell o a trap is set on EXIT o a function returns 1 and causes the script to abort Reviewed by: jilles MFC after: 2 weeks
* sh: Test EXIT trap with multiple statements in itdumbbell2012-01-161-0/+3
| | | | | Reviewed by: jilles MFC after: 2 weeks
* sh: Fix some bugs with exit status from case containing ;&.jilles2012-01-153-0/+17
| | | | | | | | | | | | | Also, rework evalcase() to not evaluate any tree. Instead, return the NCLISTFALLTHRU node and handle it in evaltree(). Fixed bugs: * If a ;& list with non-zero exit status is followed by an empty ;; or final list, the exit status of the case command should be equal to the exit status of the ;& list, not 0. * An empty ;& case should not reset $?.
* sh: Fix two bugs with case and exit status:jilles2012-01-153-0/+17
| | | | | | | * If no pattern is matched, POSIX says the exit status shall be 0 (even if there are command substitutions). * If a pattern is matched and there are no command substitutions, the first command should see the $? from before the case command, not always 0.
* sh: Add testcases that should not be broken by future optimizations.jilles2012-01-142-0/+18
|
* sh: Properly show "Not a directory" error in cd builtin.jilles2012-01-131-0/+26
| | | | | | | | The errno message display added in r222292 did not take attempting to cd to a non-directory or something that cannot be stat()ed into account. PR: bin/164070 MFC after: 10 days
* sh: Avoid possible echo options in a testcase.jilles2012-01-061-3/+3
|
* Spelling fixes for tools/uqs2011-12-301-1/+1
| | | | Add some $FreeBSD$ tags so svn will allow the commit.
* sh: Allow quoting ^ and ] in bracket expressions.jilles2011-12-281-0/+12
|
* sh: Add some testcases for pasting $*/$@ directly to a literal.jilles2011-12-251-0/+65
| | | | This also passes on stable/8.
* test: Add more testcases.jilles2011-11-281-4/+38
| | | | | | | The new testcases pass even on old stable/7, but some other implementations manage to get them wrong. Also remove a few duplicate testcases.
* sh: Add tests for some corner cases of 'case' exit status.jilles2011-11-262-0/+12
| | | | These already work properly.
* sh: Allow unsetting OPTIND.jilles2011-11-201-0/+3
| | | | Note that only assigning the decimal value 1 resets getopts, as before.
* sh: Add test for exit status of for loop without items.jilles2011-10-281-0/+4
| | | | | | POSIX says the exit status of a for loop without any items shall be 0. There are no exceptions if the exit status of the previous command was not 0 or if the item list contains a command substitution with non-zero exit status.
* sh: Add a test for a fairly obscure case with aliases.jilles2011-07-161-0/+6
| | | | This also passes on stable/8.
* sh: Test that '!' is literal if quoted and first char of bracket expressionjilles2011-06-251-0/+16
| | | | This also works on stable/8.
* sh: Add test for r223282.jilles2011-06-191-0/+6
|
* sh: Add case statement fallthrough (with ';&' instead of ';;').jilles2011-06-171-0/+39
| | | | | | | | | | | | Replacing ;; with the new control operator ;& will cause the next list to be executed as well without checking its pattern, continuing until a list ends with ;; or until the end of the case statement. This is like omitting "break" in a C "switch" statement. The sequence ;& was formerly invalid. This feature is proposed for the next POSIX issue in Austin Group issue #449.
* sh: Skip variables with invalid names in "set", "export -p", "readonly -p".jilles2011-06-172-0/+6
| | | | This ensures the output of these commands is valid shell input.
* sh: Reduce unnecessary forks with eval.jilles2011-06-161-0/+5
| | | | | | | | | | The eval special builtin now runs the code with EV_EXIT if it was run with EV_EXIT itself. In particular, this eliminates one fork when a command substitution contains an eval command that ends with an external program or a subshell. This is similar to what r220978 did for functions.
* sh: Add support for named character classes in bracket expressions.jilles2011-06-151-0/+32
| | | | | Example: case x in [[:alpha:]]) echo yes ;; esac
* sh: Add test for LC_COLLATE-based character ranges in case.jilles2011-06-121-0/+24
|
* sh: Add test for case pattern matching with iso-8859-1 charset.jilles2011-06-121-0/+52
| | | | This also passes on stable/8.
* sh: Do parameter expansion on ENV before using it.jilles2011-06-101-0/+11
| | | | | | This is required by POSIX, and allows things like ENV=\$HOME/.shrc. Note that tilde expansion is explicitly not performed.
* sh: Do parameter expansion before printing PS4 (set -x).jilles2011-06-091-0/+9
| | | | | | | | | | | | | | | | The function name expandstr() and the general idea of doing this kind of expansion by treating the text as a here document without end marker is from dash. All variants of parameter expansion and arithmetic expansion also work (the latter is not required by POSIX but it does not take extra code and many other shells also allow it). Command substitution is prevented because I think it causes too much code to be re-entered (for example creating an unbounded recursion of trace lines). Unfortunately, our LINENO is somewhat crude, otherwise PS4='$LINENO+ ' would be quite useful.
* sh: Add simple tests for set -x and PS4.jilles2011-06-082-0/+17
|
* sh: Fix $? in heredocs on simple commands.jilles2011-06-051-0/+15
| | | | PR: bin/41410
* sh: Add already working testcases for $? in here-document.jilles2011-06-051-0/+25
| | | | | | | | | If the here-document is attached to a compound command or subshell, $? already works properly. This is both a workaround for bin/41410 and a requirement for a true fix for bin/41410. PR: bin/41410 MFC after: 1 week
OpenPOWER on IntegriCloud