summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* stdlib tests: Avoid code duplication.Bruno Haible2010-09-263-52/+64
| | | | | | | | | | * modules/stdlib-tests (Files): Add tests/test-sys_wait.h. * modules/sys_wait-tests (Files): Likewise. * tests/test-sys_wait.h: New file, extracted from tests/test-stdlib.c. * tests/test-stdlib.c: Include test-sys_wait.h. (main): Invoke test_sys_wait_macros. * tests/test-sys_wait.c: Include test-sys_wait.h. (main): Invoke test_sys_wait_macros.
* getaddrinfo: Initialize sockets, to make it work under Windows.Simon Josefsson2010-09-251-19/+0
|
* Tests for module 'regex-quote'.Bruno Haible2010-09-251-0/+78
| | | | | * modules/regex-quote-tests: New file. * tests/test-regex-quote.c: New file.
* unistr/u8-strchr: Fix a test failure on i586 glibc systems.Bruno Haible2010-09-241-0/+7
| | | | * tests/unistr/test-strchr.h (test_strchr): Disable an invalid check.
* Fix endless loop in mbmemcasecoll.Bruno Haible2010-09-221-0/+6
| | | | | | * lib/mbmemcasecoll.c (apply_towlower): When mbrtowc returns 0, copy 1 byte. * tests/test-mbmemcasecmp.h (test_ascii): Test embedded NULs.
* Tests for module 'memcoll'.Bruno Haible2010-09-221-0/+52
| | | | | * modules/memcoll-tests: New file. * tests/test-memcoll.c: New file, based on tests/test-memcmp.c.
* Tests for module 'memcasecmp'.Bruno Haible2010-09-221-0/+70
| | | | | * modules/memcasecmp-tests: New file. * tests/test-memcasecmp.c: New file, based on tests/test-memcmp.c.
* net_if: enhance testsEric Blake2010-09-211-16/+18
| | | | | | | | | * tests/test-net_if.c (main): Move signature checks earlier. Print failures to stderr. * doc/posix-functions/if_freenameindex.texi (if_freenameindex): Document the bug that we do not yet fix. Signed-off-by: Eric Blake <eblake@redhat.com>
* New module to test <net/if.h> interfaces.Simon Josefsson2010-09-211-0/+83
|
* init.sh: correct an outdated commentJim Meyering2010-09-181-1/+1
| | | | * tests/init.sh (create_exe_shims_): s/function/alias/
* init.sh: don't let an ephemeral "*.exe" make us skip all dir entriesJim Meyering2010-09-181-3/+5
| | | | | | | | | | | Not that it's likely to happen, but if I were to remove from a PATH directory a file named "*.exe" (yes, starting with an asterisk), at just the right moment, it would have made init.sh ignore all remaining .exe-suffixed names in that directory. * tests/init.sh (find_exe_basenames_): Don't give up on a directory if a file named "*.exe" is removed between the glob expansion and the processing of that oddly named file.
* tests: fix unportable assumption on sys/wait.hEric Blake2010-09-172-5/+29
| | | | | | | * tests/test-sys_wait.c (main): Relax test. * tests/test-stdlib.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* init.sh: accomodate directory with no .exesEric Blake2010-09-171-0/+3
| | | | | | | | | | | | | | Cygwin was failing test-vc-list-files-{cvs,git}.sh, because of spurious output on stderr. ../../tests/test-vc-list-files-cvs.sh (exe_shim): skipping directory: /home/eblake/m4-branch/build-aux All because build-aux was a directory containing just scripts, and no .exe extensions. This fixes it. * tests/init.sh: Accomodate directory containing only scripts. Signed-off-by: Eric Blake <eblake@redhat.com>
* tests: avoid compiler warningEric Blake2010-09-171-1/+1
| | | | | | * tests/test-stdlib.c (main): Use the variable. Signed-off-by: Eric Blake <eblake@redhat.com>
* fdutimens, fdutimensat: update signature, againEric Blake2010-09-173-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | In general, merging: f<act>(fd,args) and <act>at(dir,name,args) should produce: fd<act>at(fd,dir,name,args) * lib/utimens.h (gl_futimens): Delete, and move signature... (fdutimens): ...here. (fdutimensat): Rearrange signature. (lutimensat): Rename variable for clarity. * lib/fdutimensat.c (fdutimensat): Update signature. * lib/utimens.c (fdutimens): Likewise. (gl_futimens): Delete. (utimens, lutimens): Update callers. * lib/futimens.c (futimens): Likewise. * tests/test-fdutimensat.c: Likewise. * tests/test-utimens.c: Likewise. * tests/test-futimens.h: Update comment. * NEWS: Mention this. Suggested by Paul Eggert. Signed-off-by: Eric Blake <eblake@redhat.com>
* fdutimensat: drop atflag validationEric Blake2010-09-171-3/+1
| | | | | | | | | | | * lib/fdutimensat.c (fdutimensat): Allow AT_SYMLINK_NOFOLLOW even with valid fd, to close a race scenario where futimens is unsupported and FILE was replaced by a symlink. * tests/test-fdutimensat.c (do_fdutimens, main): Adjust test accordingly. Suggested by Paul Eggert. Signed-off-by: Eric Blake <eblake@redhat.com>
* login_tty: Stricter unit test.Bruno Haible2010-09-171-0/+22
| | | | | | | * modules/login_tty-tests (Depends-on): Add tcgetsid. * tests/test-login_tty.c (main): Also check the results of tcgetpgrp() and tcgetsid() after login_tty. Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.
* New module 'tcgetsid'.Bruno Haible2010-09-171-0/+5
| | | | | | | | | | | | | | | * lib/tcgetsid.c: New file. * m4/tcgetsid.m4: New file. * modules/tcgetsid: New file. * modules/termios (Depends-on): Add c++defs, warn-on-use. (Makefile.am): Ensure c++defs.h, warn-on-use.h get included. Substitute GNULIB_TCGETSID, HAVE_TCGETSID. * lib/termios.in.h: Include <sys/types.h>. (tcgetsid): New declaration. * m4/termios_h.m4 (gl_TERMIOS_H): Check whether tcgetsid is declared. (gl_TERMIOS_H_DEFAULTS): Initialize GNULIB_TCGETSID, HAVE_TCGETSID. * doc/posix-functions/tcgetsid.texi: Mention the new module. * tests/test-termios-c++.cc: Check GNULIB_NAMESPACE::tcgetsid.
* Tests for module 'termios'.Bruno Haible2010-09-172-0/+57
| | | | | | | * modules/termios-c++-tests: New file. * modules/termios-tests: New file. * tests/test-termios-c++.cc: New file. * tests/test-termios.c: New file.
* fdutimensat: add an atflag parameterEric Blake2010-09-161-6/+18
| | | | | | | | | | * lib/fdutimensat.c (fdutimensat): Add new parameter. * lib/utimens.h (fdutimensat): Update prototype. * tests/test-fdutimensat.c: Adjust test to match. * NEWS: Document the change. Suggested by Paul Eggert. Signed-off-by: Eric Blake <eblake@redhat.com>
* stdlib: work around MirBSD WEXITSTATUS bugEric Blake2010-09-152-7/+48
| | | | | | | | | | * lib/stdlib.in.h (includes): Guarantee WEXITSTATUS. * modules/stdlib (Depends-on): Add sys_wait. * tests/test-sys_wait.c (main): Enhance test. * tests/test-stdlib.c (main): Likewise. * doc/posix-headers/stdlib.texi (stdlib.h): Document the bug. Signed-off-by: Eric Blake <eblake@redhat.com>
* strnlen: add testsEric Blake2010-09-151-0/+68
| | | | | | | * modules/strnlen-tests: New file. * tests/test-strnlen.c: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* test-rawmemchr: make more robustEric Blake2010-09-142-0/+17
| | | | | | | | | | | | * modules/rawmemchr-tests (Files): Add zerosize-ptr.h, mmap-anon.m4. (Depends-on, configure.ac): Add needed prerequisites to use it. * modules/memchr-tests (Files, Depends-on, configure.ac): Likewise, to avoid implicit reliance on memchr module prereqs. * tests/test-memchr.c (main): Ensure proper masking. * tests/test-rawmemchr.c (main): Likewise. Detect oversized reads. Signed-off-by: Eric Blake <eblake@redhat.com>
* memchr: detect glibc Alpha bugEric Blake2010-09-141-3/+15
| | | | | | | | | | | | Avoids http://sourceware.org/bugzilla/show_bug.cgi?id=12019. * m4/memchr.m4 (gl_FUNC_MEMCHR): Detect glibc 2.11.2 failure on Alpha. * doc/posix-functions/memchr.texi (memchr): Tweak wording. * tests/test-memchr.c (main): Enhance test. Reported by Nelson H. F. Beebe. Signed-off-by: Eric Blake <eblake@redhat.com>
* fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new definesPaul Eggert2010-09-104-12/+4
| | | | | | | | | | | | | | | | * doc/posix-headers/fcntl.texi (fcntl.h): Document that O_CLOEXEC is now defined to 0 if it is not defined, like other flags. Also, O_EXEC is now defined to be O_RDONLY if O_EXEC is not defined. Similarly for O_SEARCH; this last was already true, but not documented. * lib/fcntl.in.h (O_CLOEXEC): Define to 0 if not defined. * lib/dup-safer-flag.c (O_CLOEXEC): Remove now-useless #define. * lib/dup3.c, lib/pipe2.c, tests/test-dup-safer.c, tests/test-fcntl.c: Likewise. * lib/popen-safer.c (open_noinherit): Check whether O_CLOEXEC is zero, not whether it is defined. * tests/test-dup3.c, tests/test-pipe2.c (main): Likewise. * lib/progreloc.c (find_executable): Use O_EXEC rather than O_RDONLY. * lib/open.c (open): Check for O_SEARCH as well as for O_RDONLY.
* init.sh: penalize a set-x-impaired shell; don't disqualify itJim Meyering2010-09-091-29/+76
| | | | | | | | | | | | | | * tests/init.sh: Too many shells corrupt application stderr when you set -x, so we can't afford to disqualify them, since at least on Irix-6.5, that would disqualify all bourne shells. Instead, use a more discerning approach. When iterating through candidate shells, give each a score of 10 for perfect, 9 if corrupts stderr upon set -x but passes all other tests, and some other value if it is unacceptable. Use the first shell that gets a score of 10. If no shell scores 10, use the first that scored 9. Finally, when VERBOSE=yes is requested and set -x might cause trouble, simply issue a warning and refrain from enabling debug output.
* strtod: work around IRIX 6.5 bugEric Blake2010-09-081-0/+30
| | | | | | | | | | | | | IRIX mis-parses "1e 1" as 10.0 and "" instead of 1.0 and "e 1". Because the original parse may differ from the reparse in terms of whether the value overflows, we have to do an errno dance. * lib/strtod.c (strtod): Reparse number on shorter string if exponent parse was invalid. * tests/test-strtod.c (main): Add check for "0x1p 2". Reported by Tom G. Christensen. Signed-off-by: Eric Blake <eblake@redhat.com>
* init.sh: disqualify shells for which set -x corrupts stderrJim Meyering2010-09-081-0/+4
| | | | | | | | * tests/init.sh: Add a test to disqualify /bin/sh from SunOS 5.11 and OpenBSD 4.7. They make it so with "set -x", environment settings appear in stderr output. For example, this command: /bin/sh -c 'set -x; P=1 true 2> err' 2>/dev/null; cat err prints "P=1" on those two systems:
* avoid coreutils "make distcheck" failureJim Meyering2010-09-042-2/+2
| | | | | | | Coreutils tests with an absolute build directory name that contains a space. Not quoting this directory name caused a failure. * tests/test-vc-list-files-git.sh: Quote PATH dir name. * tests/test-vc-list-files-cvs.sh: Likewise.
* update-copyright test: Improve output when perl is missing or too old.Bruno Haible2010-09-041-4/+7
| | | | | | * tests/test-update-copyright.sh: Move test of Perl version down after the test whether Perl exists. Provide an explanation relating Perl's error message to Automake's SKIP: message.
* Don't augment PATH in TESTS_ENVIRONMENT.Bruno Haible2010-09-043-2/+5
| | | | | | | | | | * modules/update-copyright-tests (Makefile.am): In TESTS_ENVIRONMENT, set abs_aux_dir instead of augmenting PATH. * modules/vc-list-files-tests (Makefile.am): Likewise. * tests/test-update-copyright.sh: Augment PATH here. * tests/test-vc-list-files-cvs.sh: Augment PATH here, through path_prepend_. * tests/test-vc-list-files-git.sh: Likewise.
* tests: init.sh improvements for re-exec'ing with zshEric Blake2010-09-021-2/+21
| | | | | | | | | | | | Tom's IRIX setup had a broken bash, and proceeded to run zsh outside of POSIX mode. But trying to trace that setup proved difficult, since the re-exec lost tracing. * tests/init.sh: Borrow autoconf POSIX-mode sanitization. Pass -vx through shell re-exec. Reported by Tom G. Christensen. Signed-off-by: Eric Blake <eblake@redhat.com>
* test-update-copyright.sh: require perl 5.8.0Jim Meyering2010-09-021-3/+3
| | | | | | * tests/test-update-copyright.sh: Require 5.8.0, which Tom G. Christensen has confirmed is adequate, while 5.6.1 is not.
* test-update-copyright.sh: skip test if Perl is too oldJim Meyering2010-09-021-0/+4
| | | | | * tests/test-update-copyright.sh: Exit 77 if Perl is too old. Reported by Tom G. Christensen.
* tests: silence clang warningEric Blake2010-08-301-1/+1
| | | | | | * tests/test-malloca.c (do_allocation): Avoid dead store. Signed-off-by: Eric Blake <eblake@redhat.com>
* Tests for module 'realloc-gnu'.Ralf Wildenhues2010-08-281-0/+29
| | | | | * modules/realloc-gnu-tests: New file. * tests/test-realloc-gnu.c: New file.
* Tests for module 'calloc-gnu'.Ralf Wildenhues2010-08-281-0/+34
| | | | | * modules/calloc-gnu-tests: New file. * tests/test-calloc-gnu.c: New file.
* Tests for module 'malloc-gnu'.Ralf Wildenhues2010-08-281-0/+29
| | | | | * modules/malloc-gnu-tests: New file. * tests/test-malloc-gnu.c: New file.
* sys_socket, netdb: Ensure socklen_t gets defined.Bruno Haible2010-08-282-2/+8
|
* Fix test-unlinkat, test-rmdir failure on AIX 5.3.Ralf Wildenhues2010-08-251-1/+1
| | | | | | | * tests/test-rmdir.h (test_rmdir_func): Also accept EEXIST for rmdir ("dir/.//"), unlinkat. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* stdbool: avoid rejecting clangEric Blake2010-08-231-26/+25
| | | | | | | | | | * m4/stdbool.m4 (AC_HEADER_STDBOOL): Resync with autoconf. * tests/test-stdbool.c: Enable more tests if using the system <stdbool.h> instead of the gnulib replacement. (main): Move xlc bug test to a runtime test for all compilers. Reported by Anders Kaseorg. Signed-off-by: Eric Blake <eblake@redhat.com>
* test-stddef: test for (some) offsetof bugsEric Blake2010-08-171-0/+14
| | | | | | | | | | | | See the mailing list for a more comprehensive patch that works around the Solaris bug. * tests/test-stddef.c: Enhance test to ensure correct type of offsetof. * doc/posix-headers/stddef.texi (stddef.h): Document a Solaris bug that we are not fixing at this time. Signed-off-by: Eric Blake <eblake@redhat.com>
* Tests for module 'astrxfrm'.Bruno Haible2010-08-151-0/+97
|
* readlinkat: split into its own moduleEric Blake2010-08-092-47/+110
| | | | | | | | | | | | | | | | | | | * modules/symlinkat: Split readlinkat... * modules/readlinkat: ...into separate module. * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Move readlinkat check... * m4/readlinkat.m4 (gl_FUNC_READLINAT): ...to new file. * lib/symlinkat.c (readlinkat): Move... * lib/readlinkat.c: ...into new file. * modules/symlinkat-tests: Split readlinkat test... * modules/readlinkat-tests: ...into separate module. * tests/test-symlinkat.c: Split... * tests/test-readlinkat.c: ...into new file. * NEWS: Document the split. * doc/posix-functions/readlinkat.texi (readlinkat): Likewise. * lib/unistd.in.h (readlinkat): Likewise. Suggested by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>
* readlink, areadlink: Relax test a bit.Bruno Haible2010-07-312-2/+2
|
* More tests for unistr/u8-strchr.Bruno Haible2010-07-314-7/+164
|
* readlink: Relax test a bit.Bruno Haible2010-07-311-1/+1
|
* strtod: next round of AIX fixesEric Blake2010-07-301-0/+41
| | | | | | | | | | * lib/strtod.c (strtod): Work around AIX bug of parsing p with no exponent. * tests/test-strtod.c (main): Enhance tests. * doc/posix-functions/strtod.texi (strtod): Document next bug. Reported by Rainer Tammer. Signed-off-by: Eric Blake <eblake@redhat.com>
* strtod: fix bug in replacement function on AIXEric Blake2010-07-301-15/+15
| | | | | | | | | | * lib/strtod.c (strtod): Special case broken "0x" parse in underlying strtod. * tests/test-strtod.c (main): Document AIX 7.1 bugs. * doc/posix-functions/strtod.texi (strtod): Likewise. Reported by Rainer Tammer. Signed-off-by: Eric Blake <eblake@redhat.com>
* init.sh: work around trap limitation of some shellsPeter O'Gorman2010-07-291-3/+6
| | | | | | | | This limitation is already documented in the Autoconf manual. * tests/init.sh (setup_): Move exit trap outside of shell function. Signed-off-by: Eric Blake <eblake@redhat.com>