Commit Graph

187 Commits

Author SHA1 Message Date
Jilles Tjoelker
6ab1d4d9c3 env: Fix crash when -S string is not empty but no operand follows.
split_spaces() set argc in main() incorrectly, which caused trouble for
getopt().

Examples:
  env -S '\c'
  env -S -i

PR:		197769
MFC after:	1 week
2015-03-08 14:12:43 +00:00
Jilles Tjoelker
aad75bd7db env: Fix testsuite for additional variables set by sh.
MFC after:	1 week
2015-03-07 13:54:44 +00:00
Julio Merino
65c3cfc1aa Migrate tools/regression/usr.bin/pkill to the new tests layout.
Interestingly, the pkill tool lives in bin, not usr.bin.  Haven't bothered
to check if this is because the tool moved or because the tests were
originally added in the wrong place.
2014-03-19 12:46:04 +00:00
Julio Merino
d525bcd959 Migrate tools/regression/usr.bin/make/ to the new tests layout.
Note that these tests are for fmake, not bmake, and thus they are not
installed nor run when bmake is selected (the default).  Yes, I have
wasted a *ton* of time on moving tests for no real reason other than
ensuring they are not left behind.

But maybe, just maybe, it was not work in vain: the majority of these
tests also work with bmake and the few that don't may point at broken
stuff.  For example, the tests for the "archive" feature do not work
with bmake, but bmake's manpage and source tree seem to imply that they
should.  So... to be investigated later; need to poke sjg@.
2014-03-19 12:29:20 +00:00
Julio Merino
3a92d97ff0 Migrate most of tools/regression/usr.bin/ to the new tests layout.
I'm starting with the easy cases.  The leftovers need to be looked at a
bit more closely.

Note that this change _does_ modify the code of the old tests.  This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.

Also note that at least one test is known to be broken here.  Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that.  Will have to be
fixed separately.
2014-03-16 08:04:06 +00:00
Julio Merino
d14afb2adc Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.
This change was originally going to only migrate the usr.sbin tests but, as
it turns out, the usr.sbin/sa/ tests require files from usr.bin/lastcomm/
so it's better to just also migrate the latter at the same time.  The other
usr.bin tests will be moved separately.

To make these tests work within the test suite, some of them have required
changes to prevent modifying the source directory and instead just rely on
the current directory for file manipulation.
2014-03-16 04:09:22 +00:00
Julio Merino
03a7bb948d Only run the make tests when make is fmake.
Because bmake is the default make being built, many of the tests here
fail due to differences between the two.  Just skip the tests for now
when using fmake.
2014-03-12 10:38:32 +00:00
Julio Merino
a6a6c004f9 Fix lastcomm tests under amd64.
Force the use of TZ=UTC and adjust data files accordingly.  I have no means
to verify that the data files for the other architectures are valid.
2014-03-12 10:35:22 +00:00
Julio Merino
6f402eb3cc Fix ncal tests so that they run cleanly with prove.
Basically just make the test plan match what is actually being run.
2014-03-09 22:16:39 +00:00
Julio Merino
fb3e85e1dc Fix pkill tests so that they run cleanly with prove.
This fixes a pgrep test that assumed that PID 2 was named g_event.  This
does not seem to be the case any longer (and I don't know if it ever was
in all possible setups).

Change this test to use the idle loop instead and determine its expected
PID using ps without assuming any specific ID.
2014-03-09 22:14:20 +00:00
Julio Merino
385cd39138 Fix yacc tests so that they run cleanly with prove.
First, change the driver to run the installed yacc instead of the one from
/usr/obj (which might not be there), just as we (intend to) do with all
other tests.

Second, regenerate the expected output files from scratch.  Based on visual
inspection, the differences seem OK.  But this highlights that the tests in
here are too fragile and, possibly, useless: we should be testing the
behavior of the generated program, not the literal output.  Something to be
addressed later.
2014-03-09 22:05:23 +00:00
Julio Merino
e199cf8185 Fix sed tests so that they run cleanly with prove. 2014-03-09 21:56:29 +00:00
Julio Merino
68f5aa61eb Fix printf tests so that they run cleanly with prove. 2014-03-09 19:37:01 +00:00
Julio Merino
a3c2c920d3 Fix m4 tests so that they run cleanly with prove. 2014-03-09 19:25:53 +00:00
Eitan Adler
df8fcc1468 Add regression test for recently added 'i' flag in r259132.
PR:	standards/184641
2013-12-09 19:13:16 +00:00
Stefan Farfeleder
cd5810229d Add a few xargs tests related to -0, -n and quoting. 2013-05-04 16:41:14 +00:00
Gabor Kovesdan
ab3f6b347e - Correct mispellings of the word occurrence
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
2013-04-17 11:40:10 +00:00
Eitan Adler
ad9d6ff06a Add an additional regression tests for other cases to ensure these do not get fixed by accident. 2012-12-18 21:42:45 +00:00
Eitan Adler
2f01c791e9 POSIX requires that non-existent or null arguments be treated as if a
zero argument were supplied.

Add a regression test to catch this case as well.

PR:		bin/174521
Submitted by:	Daniel Shahaf <danielsh@elego.de> (pr)
Submitted by:	Mark Johnston <markjdb@gmail.com> (initial patch)
Reviewed by:	jilles
Approved by:	cperciva (implicit)
MFC after:	3 weeks
2012-12-18 21:02:38 +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
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
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
Baptiste Daroussin
2b42644bb2 Import m4 regression tests from OpenBSD
Obtained from:	OpenBSD
Approved by:	des (mentor)
2012-04-30 22:00:34 +00:00
Max Khon
42e4b4f7df Include target names in diagnostic output.
Submitted by:	Garrett Cooper
2012-02-12 05:34:01 +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
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
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
Max Khon
df62aec1a0 Add three execution tests for make(1):
- plus: execute "+command" when run with -jX -n
- ellipsis: ellipsis ("...") from variable
- empty: empty command (from variable)

Currently make(1) fails all three tests:
- plus: segmentation fault due to incorrect command list handling
- ellipsis: works in compat mode but fails in job (-jX) mode
- empty:
        - compat mode: prints error message
	- job mode: works but prints empty string
2011-11-30 05:49:17 +00:00
Jilles Tjoelker
98102dabd3 printf: Allow multibyte characters for '<char> form, avoid negative codes.
Examples:
  LC_ALL=en_US.UTF-8 printf '%d\n' $(printf \'\\303\\244)
  LC_ALL=en_US.ISO8859-1 printf '%d\n' $(printf \'\\344)
Both of these should print 228.

Like some other shells, incomplete or invalid multibyte characters yield the
value of the first byte without a warning.

Note that there is no general way to go back from the character code to the
character.
2011-05-28 11:37:47 +00:00
Jilles Tjoelker
e916b99243 sed: Add test for r217133 (-i race).
PR:		bin/153261
MFC after:	2 weeks
2011-01-08 00:06:22 +00:00
Jilles Tjoelker
1c95cbaf9b printf: Test that the "--" option terminator works. 2010-12-08 22:54:18 +00:00
Jilles Tjoelker
88deede54a tr: Fix '[=]=]' equivalence class.
A closing bracket immediately after '[=' should not be treated as special.

Different from the submitted patch, a string ending with '[=' does not cause
access beyond the terminating '\0'.

PR:		bin/150384
Submitted by:	Richard Lowe
MFC after:	2 weeks
2010-09-29 22:24:18 +00:00
Maxim Konovalov
4a509b9cbf o The typo was intended as it stated in the comment. Revert last.
Spotted by:	dfr
2010-06-04 14:22:49 +00:00
Maxim Konovalov
1accefb1e1 o Fix typo: .uudef -> .undef.
PR:		misc/147462
Submitted by:	Erik Cederstrand
2010-06-04 08:14:30 +00:00
Brian Somers
9c24af3d15 Fix stuttering sequences and reverse ranges
PR:		123635
Submitted by:	Ulrich Spörlein, uqs at spoerlein dot net
2010-06-02 07:47:29 +00:00
Edwin Groothuis
531a1a4b2c Replace -b with -C and -B (as proposed by Alexander).
Add -3, -A and -B to the usage.
Update regression test for the new parameters.
2010-03-21 21:33:21 +00:00
Edwin Groothuis
3d7b0d842d Create regression tests for ncal:
- A couple of tests to check if the layout of the generated calenders
  is correct.

- A couple of tests to see if impossible combinations for -3, -A,
  -m, -y etc properly abort.

- A couple of test to confirm that the order of -A, -B, -3 etc give
  the right number of months.
2010-03-14 10:24:03 +00:00
Jaakko Heinonen
12794df244 - Use errx(3) instead of err(3) when checking if snprintf(3) succeeded.
snprintf(3) doesn't set errno in the tested cases.
- If the same argument reference (for example %1) was specified more than
  once, the command didn't necessarily fit to the final command buffer. Fix
  this using a dynamic sbuf buffer. Add a few regression tests for the case.

PR:		bin/95079
No objections:	freebsd-hackers
2010-03-05 15:23:01 +00:00
Ulrich Spörlein
54673381cd Add missing newline in last line of file.
Uncovered via:	fromcvs vs. svn
Approved by:	ed (co-mentor)
2010-02-16 09:10:21 +00:00
Pawel Jakub Dawidek
7b0706f670 - Implement -q option for pgrep(1).
- Add regression test to test -q option.
2010-02-12 18:52:24 +00:00
David E. O'Brien
290dac20e6 Add ability to search up the directory hierarchy for the system directory.
Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable.

Reviewed by:	<sjg@NetBSD.org>
Obtained from:	NetBSD (+ embellishment by me, sent back to NetBSD)
2010-01-04 18:57:22 +00:00
David E. O'Brien
19d43a4c5f Fix formatting. 2010-01-04 11:11:37 +00:00
David E. O'Brien
107994f781 There are actually 129 tests here. 2010-01-04 11:00:12 +00:00
David E. O'Brien
adcda09cbc Catch up with UNIX98-style PTY's. 2010-01-04 10:59:14 +00:00
David E. O'Brien
41f83263a5 'prove -r' isn't as smart as grog thought. 2010-01-04 10:58:08 +00:00
David E. O'Brien
72cef5b74f You need to be root to run this test. 2010-01-04 09:59:18 +00:00