Commit Graph

1119 Commits

Author SHA1 Message Date
Jilles Tjoelker
9d8ca3b2ad nftw(): POSIX says directories causing loops should be silently skipped.
Formerly, loops caused nftw() to abort the traversal with ELOOP.
2012-08-09 22:05:40 +00:00
Jilles Tjoelker
fe36e227e8 sh: Add a simple test for the "local" builtin. 2012-07-15 10:22:13 +00:00
Jilles Tjoelker
84fbdd8ca0 sh: Expand assignment-like words specially for export/readonly/local.
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
2012-07-15 10:19:43 +00:00
Jilles Tjoelker
a017ea22e5 sh: Add tests where "export" does not parse differently.
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.
2012-07-13 22:29:02 +00:00
John Baldwin
6f9cd2a9dc The etcupdate utility is a tool for managing updates to files that are
not updated as part of `make installworld' such as files in /etc.  It
manages updates by doing a three-way merge of changes made to these files
against the local versions.  It is also designed to minimize the amount
of user intervention with the goal of simplifying upgrades for clusters
of machines.

The primary difference from mergemaster is that etcupdate requires less
manual work.  The primary difference from etcmerge is that etcupdate
updates files in-place similar to mergemaster rather than building a
separate /etc tree.

Requested by:	obrien, kib, theraven, joeld (among others)
2012-07-13 13:23:48 +00:00
David E. O'Brien
6e50170633 Remove the "funny targets" make check. We no longer need embedded :: targets
to build FreeBSD (they are used in Perl man pages).  We never needed embedded
"!" in targets that I can find.

We got this from OpenBSD and I cannot find any other make that supports
such things -- contrary to their commit message claim: "This behaviour
is also consistent with other versions of make.".
2012-07-05 18:23:36 +00:00
Pawel Jakub Dawidek
64b0683e23 Recognize 'none' or '0' as no flags. 2012-07-04 17:31:53 +00:00
David E. O'Brien
3de8393d5b Support also running a 32-bit test on 64-bit platforms. 2012-06-29 15:54:07 +00:00
David E. O'Brien
3fbd14b443 Provide a mechanism to not clear out the work and output dirs when
developing tests.
2012-06-20 21:38:16 +00:00
David E. O'Brien
cca63ae56b Add a test for the :tl & :tu modifiers. 2012-06-12 23:16:00 +00:00
Jilles Tjoelker
b347830a7d sh: Do not assume that SIGPIPE will only kill a subshell in builtins/wait3.0
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.
2012-06-08 22:54:25 +00:00
David E. O'Brien
30a39288e4 Correct examples to the latest version I had. 2012-06-05 17:36:28 +00:00
David E. O'Brien
432a06aa01 Add a regression test for filemon(4) [r236592]. 2012-06-04 22:59:33 +00:00
David E. O'Brien
ede27e69cf Add regression test for '-V' command line option (requires r236346). 2012-05-31 01:07:52 +00:00
David E. O'Brien
a35a9551c4 make it easier to test newly-built make. 2012-05-30 22:26:16 +00:00
Baptiste Daroussin
98e903e7a0 Import byacc from invisible island, it brings us lots of compatibilities with
bison, keeping full compatibility with our previous yacc implementation.

Also bring the ability to create reentrant parser

This fix bin/140309 [1]

PR:		bin/140309 [1]
Submitted by:	Philippe Pepiot <ksh@philpep.org> [1]
Approved by:	des (mentor)
MFC after:	1 month
2012-05-21 13:31:26 +00:00
Kevin Lo
8b0349c836 According to shared memory man pages, advice including <sys/types.h>
instead of <sys/param.h>
2012-05-21 07:52:46 +00:00
Baptiste Daroussin
2b42644bb2 Import m4 regression tests from OpenBSD
Obtained from:	OpenBSD
Approved by:	des (mentor)
2012-04-30 22:00:34 +00:00
David Schultz
afbcb86218 Add some tests from PR 166463. Also make sure that all of the tests,
old and new, check the sign bits of both the remainder and the
quotient.
2012-04-07 04:00:30 +00:00
Jilles Tjoelker
6d2b152f70 sh: Add a test for variables with underscores in arithmetic.
Things like $((_x+1)) are broken in stable/8 sh but work in stable/9 and
head.
2012-03-11 22:12:05 +00:00
Hans Petter Selasky
53accc0452 Add regression test for USB enumeration.
MFC after:	1 week
2012-03-01 20:45:17 +00:00
Christian Brueffer
bb729f8549 Fix order of arguments to lseek().
PR:		160867
Submitted by:	Henning Petersen <henning.petersen@t-online.de>
MFC after:	1 week
2012-02-29 19:50:49 +00:00
Jilles Tjoelker
9901e05690 Check fchmod()/fchown() in fifo_misc test. 2012-02-26 15:32:02 +00:00
Jilles Tjoelker
45ff61e969 libc: Add some tests for fmtmsg(). 2012-02-21 23:46:41 +00:00
Bjoern A. Zeeb
e6f0fd5898 Add regression tests for the setsockopt(2) SO_SETFIB socket option.
Check that the expected domain(9) families all handle the socket option
correctly and do proper bounds checks.  This would catch bugs as fixed
in (r230938,)r230981.

Sponsored by:	Cisco Systems, Inc.
2012-02-17 03:25:26 +00:00
Max Khon
42e4b4f7df Include target names in diagnostic output.
Submitted by:	Garrett Cooper
2012-02-12 05:34:01 +00:00
Jilles Tjoelker
c0b3cf0676 sh: Make 'hash' return 1 if at least one utility is not found.
Reported by:	lme
2012-02-11 21:06:45 +00:00
Edward Tomasz Napierala
276fa791b6 More mdconfig(8) tests. 2012-01-26 18:16:16 +00:00
Edward Tomasz Napierala
7cb6292d52 Move mdconfig(8) tests under regression/sbin/, where they belong.
Submitted by:	jh@
2012-01-25 10:11:54 +00:00
Edward Tomasz Napierala
1aeaf00340 Add some basic regression tests for mdconfig(8). 2012-01-24 13:23:52 +00:00
Jilles Tjoelker
6eff4a75d5 sh: Fix $? in the first command of a 'for'.
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.
2012-01-22 14:00:33 +00:00
David Schultz
b831cdf6b1 These tests check whether the compiler evaluates floating-point
expressions properly.  Some of the tests depend on the compiler
implementing C99's FENV_ACCESS pragma, and only commercial compilers
do; those tests are currently skipped.  If any of the enabled tests
fail, then odds are the libm regression tests will fail also.
This should make it easier to diagnose reported problems on platforms
I don't have.

Currently, gcc passes all the tests that don't depend on FENV_ACCESS
on amd64 and sparc64.  Clang fails a few on amd64 (see clang bug
11406).  Both gcc and clang fare poorly on i386, which has well-known
issues.
2012-01-20 06:57:21 +00:00
Jean-Sébastien Pédron
01a43bcf7b sh: Fix execution of multiple statements in a trap when evalskip is set
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
2012-01-16 11:07:46 +00:00
Jean-Sébastien Pédron
cb1c8e8ced sh: Test EXIT trap with multiple statements in it
Reviewed by:	jilles
MFC after:	2 weeks
2012-01-16 10:59:44 +00:00
Jilles Tjoelker
93fcb2511b sh: Fix some bugs with exit status from case containing ;&.
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 $?.
2012-01-15 21:39:38 +00:00
Jilles Tjoelker
92371efca2 sh: Fix two bugs with case and exit status:
* 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.
2012-01-15 20:04:05 +00:00
Jilles Tjoelker
d0766f8d45 sh: Add testcases that should not be broken by future optimizations. 2012-01-14 23:10:18 +00:00
David Schultz
d302778ed3 Add .t files for tests, missed in prior checkins, so that prove(1) works
in this directory.
2012-01-14 21:38:31 +00:00
David Schultz
5d9e02dba4 Update the tests for arm and other ports where long double is the same
as double, similar to r178141.
2012-01-14 21:09:54 +00:00
David Schultz
3e7ed66b1e Fix a test that doesn't work on architectures where long double is no
wider than double.  Thanks to Ian Lepore for catching the bug.
2012-01-14 08:11:40 +00:00
Jilles Tjoelker
e94e3511bd sh: Properly show "Not a directory" error in cd builtin.
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
2012-01-13 23:32:27 +00:00
Jilles Tjoelker
c6791c926e sh: Avoid possible echo options in a testcase. 2012-01-06 23:20:33 +00:00
Ulrich Spörlein
381edcda1e Convert files over to UTF-8.
These files contained various combinations of Big5, eucJP and KOI8-U
encoded strings. The byte representations of their respective encodings
have been translated to $'...' escape sequences as understood by our sh(1).

With help from:	jilles
2012-01-05 21:36:53 +00:00
Jean-Sébastien Pédron
840fac731b Adapt testsuite following change in Domain Search error handling
In this testsuite, warning() and error() have the same behaviour.

PR:		bin/163431
Sponsored by:	Yakaz (http://www.yakaz.com)
2011-12-30 14:41:47 +00:00
Ulrich Spörlein
8ce070c1b2 Spelling fixes for tools/
Add some $FreeBSD$ tags so svn will allow the commit.
2011-12-30 00:04:11 +00:00
Ulrich Spörlein
47e236b178 Reencode files from latin1 to UTF-8. 2011-12-29 12:33:27 +00:00
Jilles Tjoelker
3a1b9c9e82 sh: Allow quoting ^ and ] in bracket expressions. 2011-12-28 23:51:17 +00:00
Jilles Tjoelker
80cdf644e6 sh: Add some testcases for pasting $*/$@ directly to a literal.
This also passes on stable/8.
2011-12-25 13:24:48 +00:00
Max Khon
548f8e2d41 Fix last-minute typo. 2011-12-15 06:12:43 +00:00
Max Khon
174da58b23 Add job error output test.
make(1) with openpty() currently fails this test: there's a race condition
and error output is sometimes lost.
2011-12-15 06:01:06 +00:00