History log of /freebsd-current/bin/sh/tests/parameters/Makefile
Revision Date Author Comments
# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 7cca93e6 08-Oct-2016 Jilles Tjoelker <jilles@FreeBSD.org>

sh: Do not import IFS's value from the environment.

Per Austin group issue #884, always set IFS to $' \t\n'. As before, IFS will
be exported iff it was in the environment.

Most shells (e.g. bash, ksh93 and mksh) already did this. This change
improves predictability, in that scripts can simply rely on the default
value.

However, the effect on security is little, since applications should not be
calling the shell with attacker-controlled environment variable names in the
first place and other security-sensitive variables such as PATH should be
and are imported by the shell.

When using a new sh with an old (before 10.2) libc wordexp(), IFS is no
longer passed on. Otherwise, wordexp() continues to pass along IFS from the
environment per its documentation.

Discussed with: pfg
Relnotes: yes


# 430f7286 04-May-2016 Enji Cooper <ngie@FreeBSD.org>

Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
namespacing is kept with FILES appropriately, and that this shouldn't need
to be repeated if the namespace changes -- only the definition of PACKAGE
needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
`tests`. In the event we get to the point where things can be split up
enough in the base system, it would make more sense to group the tests
with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division


# c4429c7e 03-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Fix build.

Sponsored by: The FreeBSD Foundation


# 43faedc1 02-Feb-2016 Glen Barber <gjb@FreeBSD.org>

First pass to fix the 'tests' packages.

Sponsored by: The FreeBSD Foundation


# d253cfe3 06-Dec-2015 Jilles Tjoelker <jilles@FreeBSD.org>

sh: Add limited test for ${#@} and ${#*}.

POSIX leaves the result of expanding ${#@} and ${#*} unspecified, but ensure
it is numeric.


# fb6fa0a7 04-Dec-2015 Jilles Tjoelker <jilles@FreeBSD.org>

sh: Link tests/parameters/positional8.0 to the build.

This was forgotten in r291025.


# 3fb51b3a 28-Oct-2014 Jilles Tjoelker <jilles@FreeBSD.org>

Treat IFS separators in "$*" as quoted.

This makes a difference if IFS starts with *, ?, [ or a CTL* byte.


# 12e2df3c 12-Aug-2014 Enji Cooper <ngie@FreeBSD.org>

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)


# 7b9104c0 12-Jul-2014 Jilles Tjoelker <jilles@FreeBSD.org>

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.


# 5ddabb83 12-Jul-2014 Jilles Tjoelker <jilles@FreeBSD.org>

sh: Consistently treat ${01} like $1.

Leading zeroes were ignored when checking whether a positional parameter is
set, but not when expanding its value. Ignore leading zeroes in any case.


# f1058ba0 08-Jul-2014 Jilles Tjoelker <jilles@FreeBSD.org>

sh: Add test for ${01} and ${010} that already works.

Although it is probably unwise to use this, POSIX is clear that leading
zeroes are permitted in positional parameters (and do not indicate octal).

Such positional parameters are checked for being unset and/or null
correctly, but their value is incorrectly expanded.


# 7e81d0c8 24-Dec-2013 Jilles Tjoelker <jilles@FreeBSD.org>

sh: Initialize OPTIND=1 even if it came from the environment.


# 13de33a5 10-Dec-2013 Julio Merino <jmmv@FreeBSD.org>

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)