History log of /freebsd-10-stable/bin/sh/tests/parameters/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
291604 01-Dec-2015 ngie

MFC r269902,r270101:

r269902:

Convert bin/sh/tests to ATF

The new code uses a "test discovery mechanism" to determine
what tests are available for execution

The test shell can be specified via:

kyua test -v test_suites.FreeBSD.bin.sh.test_shell=/path/to/test/sh

Sponsored by: EMC / Isilon Storage Division
Approved by: jmmv (mentor)
Reviewed by: jilles (maintainer)

r270101 (by jilles):

sh: Don't hardcode relative paths in the tests stderr files.

These paths have had to be adjusted to changes in the testsuite runner
several times, so modify the tests to remove the need for such adjustment.

A cp in functional_test.sh is now unneeded, but this matters little in
performance.

287755 13-Sep-2015 jilles

MFC r268436,273243,278806,280920,286971: sh: Add various tests.

These new tests from head pass with unmodified stable/10 sh.

275777 14-Dec-2014 jilles

MFC r268576: sh: Correctly handle positional parameters beyond INT_MAX on
64-bit systems.

Currently, there can be no more than INT_MAX positional parameters. Make
sure to treat all higher ones as unset to avoid incorrect results and
crashes.

On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and
sign-extends them.

On 32-bit systems, the call to atoi() returned INT_MAX for too high values
and there is not enough address space for so many positional parameters, so
there was no issue.

PR: 195918

262951 09-Mar-2014 jmmv

Sync sh(1) in stable/10 to head.

This is a MFC of all the commits listed below.

My original goal of this change was to only merge the move of the tests
from tools/regression/bin/ into the new layout (which include tests for
sh(1) and other tools as well). However, doing so is tricky due to the
ongoing work in sh(1) and, especially, the many changes to its tests
since stable/10 was first branched.

Merging everything is the simplest way to achieve this goal and, as a
bonus point, we get various fixes and miscellaneous improvements into
the branch.

Per jilles' suggestion, I'm avoiding the merge of a couple of changes
(r256850 and r257506) that required depending kernel changes. I'm also
avoiding very recent changes that have not had a long enough time to be
validated in current.

This is "make tinderbox" clean.

r256735 sh: Remove one syscall when waiting for a foreground job.
r257399 sh: Allow trapping SIGINT/SIGQUIT after ignore because of '&'.
r257504 sh: Reorder union node to reduce its size on 64-bit platforms.
r257920 sh: Add a test case for would-be assignments that are not due to quoting.
r257929 sh: Properly quote alias output from command -v.
r258489 sh: Add tests for the </dev/null implicit in a background command.
r258533 sh: Add more tests for the </dev/null implicit in a background command.
r258535 sh: Make <&0 disable the </dev/null implicit in a background command.
r258776 sh: Prefer memcpy() to strcpy() in most cases. Remove the scopy macro.
r259047 sh: Split set -x output into a separate function.
r259210 Migrate tools/regression/bin/ tests to the new layout.
r259844 sh: Remove an unused variable.
r259846 sh: Initialize OPTIND=1 even if it came from the environment.
r259874 sh: Simplify code related to PPID variable.
r259946 sh: Don't check input for non-whitespace if history is disabled.
r260246 sh(1): Discourage use of -e.
r260506 Run the sh(1) and test(1) tests as unprivileged.
r260586 Mark the bin/pax tests as requiring perl.
r260634 Use TAP_TESTS_PERL to register the legacy_test in bin/pax.
r260635 Replace hand-crafted Kyuafiles with automatic generation.
r260654 sh: Remove SIGWINCH handler and just check for resize before every read.
r261121 sh: Add test for nested alias.
r261125 sh: Solve the alias recursion problem in a less hackish way.
r261141 sh: Do not depend on parse/execute split in new alias test.
r261160 sh: Add tests for alias names after another alias.
r261192 sh: Allow aliases to force alias substitution on the following word.
r262533 sh: Make expari() static.
r262565 sh: Do not corrupt internal representation if LINENO inner expansion fails.
r262697 sh: Simplify expari().

Reviewed by: jilles


/freebsd-10-stable/bin/Makefile
/freebsd-10-stable/bin/date/Makefile
/freebsd-10-stable/bin/date/tests
/freebsd-10-stable/bin/mv/Makefile
/freebsd-10-stable/bin/mv/tests
/freebsd-10-stable/bin/pax/Makefile
/freebsd-10-stable/bin/pax/tests
/freebsd-10-stable/bin/pax/tests/Makefile
/freebsd-10-stable/bin/pax/tests/legacy_test.pl
/freebsd-10-stable/bin/pax/tests/legacy_test.sh
/freebsd-10-stable/bin/sh/Makefile
/freebsd-10-stable/bin/sh/alias.c
/freebsd-10-stable/bin/sh/cd.c
/freebsd-10-stable/bin/sh/eval.c
/freebsd-10-stable/bin/sh/exec.c
/freebsd-10-stable/bin/sh/expand.c
/freebsd-10-stable/bin/sh/expand.h
/freebsd-10-stable/bin/sh/input.c
/freebsd-10-stable/bin/sh/jobs.c
/freebsd-10-stable/bin/sh/memalloc.c
/freebsd-10-stable/bin/sh/mystring.c
/freebsd-10-stable/bin/sh/mystring.h
/freebsd-10-stable/bin/sh/nodetypes
/freebsd-10-stable/bin/sh/parser.c
/freebsd-10-stable/bin/sh/parser.h
/freebsd-10-stable/bin/sh/redir.c
/freebsd-10-stable/bin/sh/sh.1
/freebsd-10-stable/bin/sh/show.c
/freebsd-10-stable/bin/sh/tests
/freebsd-10-stable/bin/sh/tests/Makefile
/freebsd-10-stable/bin/sh/tests/builtins/Makefile
/freebsd-10-stable/bin/sh/tests/builtins/command3.0.stdout
/freebsd-10-stable/bin/sh/tests/builtins/command5.0.stdout
/freebsd-10-stable/bin/sh/tests/builtins/command6.0.stdout
/freebsd-10-stable/bin/sh/tests/builtins/lineno2.0
Makefile
optind2.0
/freebsd-10-stable/bin/sh/tests/parser/Makefile
/freebsd-10-stable/bin/sh/tests/parser/alias11.0
/freebsd-10-stable/bin/sh/tests/parser/alias12.0
/freebsd-10-stable/bin/sh/tests/parser/alias13.0
/freebsd-10-stable/bin/sh/tests/parser/alias14.0
/freebsd-10-stable/bin/sh/tests/parser/alias15.0
/freebsd-10-stable/bin/sh/tests/parser/alias15.0.stdout
/freebsd-10-stable/bin/sh/trap.c
/freebsd-10-stable/bin/sh/trap.h
/freebsd-10-stable/bin/sh/var.c
/freebsd-10-stable/bin/sh/var.h
/freebsd-10-stable/bin/test/Makefile
/freebsd-10-stable/bin/test/tests
/freebsd-10-stable/bin/test/tests/Makefile
/freebsd-10-stable/bin/tests
/freebsd-10-stable/etc/mtree/BSD.tests.dist
/freebsd-10-stable/tools/regression/bin
259210 11-Dec-2013 jmmv

Migrate tools/regression/bin/ tests to the new layout.

This change is a proof of concept on how to easily integrate existing
tests from the tools/regression/ hierarchy into the /usr/tests/ test
suite and on how to adapt them to the new layout for src.

To achieve these goals, this change:

- Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/.
- Renames the previous regress.sh files to legacy_test.sh.
- Adds Makefiles to build and install the tests and all their supporting
data files into /usr/tests/bin/.
- Plugs the legacy_test test programs into the test suite using the new
TAP backend for Kyua (appearing in 0.8) so that the code of the test
programs does not have to change.
- Registers the new directories in the BSD.test.dist mtree file.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)


228873 25-Dec-2011 jilles

sh: Add some testcases for pasting $*/$@ directly to a literal.

This also passes on stable/8.


227773 20-Nov-2011 jilles

sh: Allow unsetting OPTIND.

Note that only assigning the decimal value 1 resets getopts, as before.


222957 10-Jun-2011 jilles

sh: Do parameter expansion on ENV before using it.

This is required by POSIX, and allows things like ENV=\$HOME/.shrc.

Note that tilde expansion is explicitly not performed.


222158 21-May-2011 jilles

sh: Add test for positional parameters with more than one digit.

This also passes on stable/8.


213738 12-Oct-2010 obrien

Allow one to regression test 'sh' changes without having to install
a potentially bad /bin/sh first.


206759 17-Apr-2010 jilles

sh: On startup of the shell, use PWD from the environment if it is valid.
Unset PWD if it is incorrect and no value for it can be determined.
This preserves the logical current directory across shell invocations.

Example (assuming /home is a symlink):
$ cd
$ pwd
/home/foo
$ sh
$ pwd
/home/foo

Formerly the second pwd would show the physical path (symlinks resolved).


206491 11-Apr-2010 jilles

sh: Test that bogus values of PWD are not imported from the environment.

Current versions pass this test trivially by never importing PWD, but I plan
to change sh to import PWD if it is an absolute pathname for the current
directory, possibly containing symlinks.


203677 08-Feb-2010 jilles

sh: Make sure the mail2.0 test can actually fail if $MAIL is not touched.


203576 06-Feb-2010 jilles

sh: Do not stat() $MAIL/$MAILPATH in non-interactive shells.

These may be NFS mounted, and we should not touch them unless we are going
to do something useful with the information.


185232 23-Nov-2008 stefanf

Add a test for r185231.