summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* priv-set: Don't assume that priv.h exists merely because getppriv does.Paul Eggert2010-06-141-2/+2
| | | | | | | | | See Jan Andersen's bug report about AIX 5L in http://lists.gnu.org/archive/html/bug-tar/2010-06/msg00019.html * m4/priv-set.m4 (gl_PRIV_SET): Check for priv.h. * lib/priv-set.c: Do nothing unless HAVE_PRIV_H. * lib/priv-set.h: Likewise. * tests/test-priv-set.c: Likewise.
* test-inttostr: avoid spurious failure on Solaris 9Jim Meyering2010-06-121-6/+18
| | | | | * tests/test-inttostr.c (main): Skip the test when snprintf fails to accept "%ju". Reported by Bruno Haible.
* test-sys_socket: mark variables as used more readablyJim Meyering2010-06-111-1/+5
| | | | | | | * tests/test-sys_socket.c (main): Mark otherwise unused variables as "used" explicitly via (void) statement casts. This is more readable than using them in an artificial return expression. Suggestion from Bruno Haible.
* Avoid some more warnings from "gcc -Wwrite-strings".Bruno Haible2010-06-118-17/+17
|
* init.sh: change framework_failure_ to fail with status 99, not 1Ralf Wildenhues2010-06-111-1/+1
| | | | | | * tests/init.sh (framework_failure_): Exit 99, not 1. This informs automake's parallel-tests rule that this is an unexpected failure, even if the test is listed in XFAIL_TESTS.
* test-inttostr: avoid warnings about 4-6KB literal stringsJim Meyering2010-06-111-8/+9
| | | | | | | * tests/test-inttostr.c: Don't use <assert.h>. Instead, ... Include "macros.h", for its definition of ASSERT. (CK): s/assert/ASSERT/ * modules/inttostr-tests (Files): Add macros.h.
* init.sh: don't use $ME_ or skip_ before they are definedJim Meyering2010-06-111-21/+22
| | | | | | | * tests/init.sh: Hoist definitions of $ME_ and skip_ to precede their first uses. Also hoist their companions: warn_, fail_, framework_failure_, $stderr_fileno. Prompted by a patch from Stefano Lattarini.
* test-sys_socket: avoid set-but-not-used warnings from gccJim Meyering2010-06-111-1/+1
| | | | | * tests/test-sys_socket.c (main): Use "i" and "x", in order to avoid warning about set-but-not-used variables.
* test-xvasprintf: avoid 'const' discard warningsJim Meyering2010-06-111-3/+3
| | | | | | | * tests/test-xvasprintf.c (test_xvasprintf, test_xasprintf): Use "const" when assigning from literal strings. (test_xasprintf): Add "void" in function argument list to placate -Wstrict-prototypes and to be consistent with test_xvasprintf above.
* tests: avoid compilation warnings in argmatch and exclude tests...Jim Meyering2010-06-112-0/+22
| | | | | | | in packages that define ARGMATCH_DIE_DECL, like coreutils. * tests/test-exclude.c [ARGMATCH_DIE_DECL]: Also declare the function. Since it always exits, declare with the "noreturn" attribute. * tests/test-argmatch.c: Likewise.
* tests: avoid 'const' discard warnings in mbsstr testsJim Meyering2010-06-112-4/+4
| | | | | * tests/test-mbsstr1.c (main): Add "const" to avoid trivial warning. * tests/test-mbsstr2.c (main): Likewise.
* test-verify: avoid warning from gcc's -Wmissing-declarationsJim Meyering2010-06-111-1/+2
| | | | * tests/test-verify.c (function): Declare to be static.
* test-inttostr.c: include <string.h> for use of strcmpJim Meyering2010-06-111-0/+1
| | | | * tests/test-inttostr.c: Include <string.h> for strcmp declaration.
* test-linkat: avoid failed assertion on "other" architecturesJim Meyering2010-06-111-0/+1
| | | | | | * tests/test-linkat.c: Include <sys/stat.h>, for declarations of stat, lstat, mkdir. Patch by John Rigby, to fix FTBFS on armel, powerpc, sparc: https://bugs.launchpad.net/bugs/591968
* inttostr: add a new function, inttostr, and testsJim Meyering2010-06-101-0/+72
| | | | | | | | | | | | | | | | | The namesake function was not available. The existence of the template file, inttostr.c makes its addition nontrivial. * lib/anytostr.c: Rename from inttostr.c. (anytostr): Rename from inttostr. * lib/inttostr.c: New file. * modules/inttostr (Files): Add anytostr.c. (Makefile.am): Set lib_SOURCES instead of ... * m4/inttostr.m4: Remove uses of AC_LIBOBJ. * lib/imaxtostr.c: Update use. s/inttostr/anytostr/ * lib/offtostr.c: Likewise. * lib/uinttostr.c: Likewise. * lib/umaxtostr.c: Likewise. * modules/inttostr-tests: New file. * tests/test-inttostr.c: New file. Test these functions.
* Reduce dependencies.Bruno Haible2010-06-033-370/+437
|
* Add missing include in test-pwrite.c.Ralf Wildenhues2010-05-251-0/+1
| | | | * tests/test-pwrite.c: Include string.h, for strcmp.
* Avoid a test failure on NetBSD 5.0.Bruno Haible2010-05-241-0/+4
|
* test-renameat.c: include <sys/stat.h>Jim Meyering2010-05-231-0/+1
| | | | | * tests/test-renameat.c: Include <sys/stat.h>; required for definition of S_IS* macros.
* test-pwrite: do not leave behind a test file named "out"Jim Meyering2010-05-231-0/+7
| | | | | | | | | Revert commit d8fa18472a54c1cb2674c296b3d82443f234d5f7. The trivial-looking use of init.sh is really necessary. It ensures that the temporary file, "out", is created in a temporary directory, and removed upon termination. * tests/test-pwrite.sh: Re-add file. * modules/pwrite-tests: Reference it.
* Fix output redirection buglet in init.sh.Ralf Wildenhues2010-05-231-2/+2
| | | | * tests/init.sh: Fix redirection of stderr.
* init.sh: fix an error in the previous change; add more commentsJim Meyering2010-05-161-2/+6
| | | | | | | * tests/init.sh: Compare exit code in loop against 9, not 2. Patch by Bruno Haible. Make the two tests more similar by adding an empty "then" clause. Add comments.
* init.sh: avoid unnecessary shell re-execJim Meyering2010-05-161-14/+27
| | | | | | | | | | * tests/init.sh: Improve the re-exec-required check to first test the current shell. If it passes the test, do not search for a shell that does pass, and do not re-exec. This test is particularly contorted to avoid triggering misbehavior in Solaris 10's /bin/sh whereby any use of $(...) evokes a syntax error and causes immediate shell exit with status 2. Bruno Haible reported that the re-exec made it impossible to single-step through any init.sh-using script.
* verify: Avoid skipping the test on openSUSE 11.0.Bruno Haible2010-05-161-0/+4
|
* test-pwrite.c: Remove unused variable declaration.Peter O'Gorman2010-05-111-1/+0
|
* Remove useless test-pwrite.sh file.Peter O'Gorman2010-05-111-7/+0
|
* init.sh: fix a typoPeter O'Gorman2010-05-101-1/+1
| | | | * tests/init.sh: Correct typo in MALLOC_PERTURB_ initialization.
* init.sh: enable MALLOC_PERTURB_Jim Meyering2010-05-091-0/+7
| | | | * tests/init.sh: Enable glibc's malloc-perturbing option.
* acl: Avoid test failure on Cygwin-hosted mingw.Bruno Haible2010-05-091-0/+6
|
* init.sh: improve commentsJim Meyering2010-05-071-2/+7
| | | | | | | * tests/init.sh: Recommend the one-line init.sh-sourcing idiom: . "${srcdir=.}/init.sh"; path_prepend_ . Add a note about path_prepend_ and the alternative of using TESTS_ENVIRONMENT.
* exclude: Unescape hashed patterns in wildcard mode.Sergey Poznyakoff2010-05-061-0/+40
| | | | | | | * lib/exclude.c (add_exclude): Unescape the pattern before adding it to the hash list. * tests/test-exclude8.sh: New test case. * modules/exclude-tests: Add new test.
* verify: automate testsEric Blake2010-05-052-3/+43
| | | | | | | | | | | | Had we automated this sooner, we would have caught the issue with gcc -Werror -Wredundant-decls sooner. * modules/verify-tests: New module. * tests/test-verify.sh: New file. * tests/test-verify.c: Guard each negative test with a unique id. Also avoid warning about unused left hand of comma expressions. Signed-off-by: Eric Blake <eblake@redhat.com>
* Tests for module pwrite.Peter O'Gorman2010-05-052-0/+87
|
* New module pwrite.Peter O'Gorman2010-05-051-0/+5
|
* test-xalloc-die: avoid unwarranted test failure on OpenSolaris 5.11Jim Meyering2010-05-031-1/+1
| | | | | | | | * tests/test-xalloc-die.sh: Redirect stdout before stderr, (i.e., "> out 2> err", rather than "2> err > out"). Otherwise, with /bin/sh on OpenSolaris 5.11 snv_134, we would end up with a stray "1> out" line in the "err2" output file when running "make check" in verbose mode (i.e., with set -x enabled).
* fpurge: Sharper test.Bruno Haible2010-05-011-0/+2
|
* ftello: Another test.Bruno Haible2010-05-011-0/+78
|
* ftell: Another test.Bruno Haible2010-05-011-0/+78
|
* lseek test: Fix failure on Solaris.Bruno Haible2010-05-011-2/+2
|
* init.sh: ensure a more reliable exit status when exiting via trapJim Meyering2010-04-281-3/+5
| | | | | | * tests/init.sh (setup_): Don't rely on $? in signal handler. Inspired by patches from Dmitry V. Levin. Also trap on signal 3 (SIGQUIT).
* Work around a MacOS X 10.4 bug with openpty.Simon Josefsson2010-04-251-0/+4
|
* Avoid a gcc warning.Bruno Haible2010-04-241-2/+2
|
* vc-list-files tests: convert to use init.shJim Meyering2010-04-232-25/+9
| | | | | | | | | | * tests/test-vc-list-files-cvs.sh: Invoke "$srcdir/init.sh" and path_prepend_. Use Exit, not exit. Use skip_ rather than open coding it. Remove trap set-up and compare definitions. * tests/test-vc-list-files-git.sh: Likewise. * modules/vc-list-files-tests (Files): Add tests/init.sh.
* tests/test-vasprintf.c: Test %08lx.Simon Josefsson2010-04-211-0/+20
|
* tests: be robust to ignored SIGPIPEEric Blake2010-04-202-2/+4
| | | | | | | | | | Noticed during a libvirt test run with trap '' SIGPIPE. * tests/test-select-in.sh: Consume all output. * tests/test-lseek.sh: Check correct exit status, while avoiding EPIPE. Signed-off-by: Eric Blake <eblake@redhat.com>
* test-stdbool: skip test that fails with Solaris CCEric Blake2010-04-161-2/+3
| | | | | | | | | | | | | | | Solaris 9 CC has a bug; it allows (int)0.0 and (bool)0 in constant expressions, but not (bool)0.0. Our replacement stdbool cannot provide that guarantee of C99 for this particular compiler, but since use of that feature causes compilation failure rather than silent mis-compilation, we just skip the test. * tests/test-stdbool.c (f): Skip test that causes compilation error under buggy C++ compiler. * lib/stdbool.in.h: Document the limitation. * doc/posix-headers/stdbool.texi (stdbool.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* stdint: allow test to pass with C++Eric Blake2010-04-161-0/+1
| | | | | | | | __STDC_LIMIT_MACROS is only half the battle. * tests/test-stdint.c: Define __STDC_CONSTANT_MACROS, for glibc. Signed-off-by: Eric Blake <eblake@redhat.com>
* test-forkpty: fix expected signatureEric Blake2010-04-151-2/+2
| | | | | | | * tests/test-forkpty.c (SIGNATURE_CHECK): Add appropriate const. Reported by Simon Josefsson. Signed-off-by: Eric Blake <eblake@redhat.com>
* getopt-gnu: match recent glibc fixes and posix rulingEric Blake2010-04-132-15/+121
| | | | | | | | | | | | | | | | | | | | The POSIX folks admitted that codifying the behavior of GNU getopt on a leading '+' in optstring is worthwhile, for writing programs such as env(1) even when POSIXLY_CORRECT is not defined. http://austingroupbugs.net/view.php?id=191 However, the ruling is an enhancement request for the next version of POSIX, and is not binding on platforms that comply with POSIX 2008, so it should only be enforced for getopt-gnu. * tests/test-getopt.h (test_getopt): Strengthen tests of leading '+' handling, when requesting extensions. * tests/test-getopt_long.h (test_getopt_long): Strengthen test of 'W;' handling. * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Detect glibc 2.11 bug. * doc/posix-functions/getopt.texi (getopt): Document this. * doc/glibc-functions/getopt_long.texi (getopt_long): Likewise. * doc/glibc-functions/getopt_long_only.texi (getopt_long_only): Likewise.
* vasnprintf: Add more tests.Bruno Haible2010-04-101-0/+41
|