summaryrefslogtreecommitdiff
path: root/tests/test-getopt_long.h
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* maint: shorten https://lists.gnu.org/archive/html/... linksJim Meyering2017-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each /archive/html/ part can be replace with /r/. Run this to induce the change: git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g' * ChangeLog: Perform that substitution. * Makefile: Likewise. * STATUS-libposix: Likewise. * build-aux/bootstrap: Likewise. * doc/maintain.texi: Likewise. * gnulib-tool: Likewise. * lib/allocator.h: Likewise. * lib/argp-ba.c: Likewise. * lib/argp-pv.c: Likewise. * lib/canon-host.c: Likewise. * lib/canonicalize-lgpl.c: Likewise. * lib/float.in.h: Likewise. * lib/fstat.c: Likewise. * lib/getdelim.c: Likewise. * lib/getprogname.c: Likewise. * lib/glthread/thread.h: Likewise. * lib/intprops.h: Likewise. * lib/mbsrtowcs-state.c: Likewise. * lib/safe-read.c: Likewise. * lib/signal.in.h: Likewise. * lib/stat.c: Likewise. * lib/stdbool.in.h: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdio.in.h: Likewise. * lib/sysexits.in.h: Likewise. * lib/timespec.h: Likewise. * lib/wcsrtombs-state.c: Likewise. * m4/alloca.m4: Likewise. * m4/extern-inline.m4: Likewise. * m4/fstatat.m4: Likewise. * m4/gnulib-common.m4: Likewise. * m4/lib-ignore.m4: Likewise. * m4/printf.m4: Likewise. * m4/regex.m4: Likewise. * m4/stat-size.m4: Likewise. * m4/std-gnu11.m4: Likewise. * m4/stdbool.m4: Likewise. * m4/sys_types_h.m4: Likewise. * m4/threadlib.m4: Likewise. * m4/vararrays.m4: Likewise. * pygnulib/GLImport.py: Likewise. * tests/test-exp.h: Likewise. * tests/test-exp2.h: Likewise. * tests/test-expm1.h: Likewise. * tests/test-fflush2.c: Likewise. * tests/test-getopt_long.h: Likewise. * tests/test-intprops.c: Likewise. * tests/test-log.h: Likewise. * tests/test-log10.h: Likewise. * tests/test-log1p.h: Likewise. * tests/test-log2.h: Likewise. * tests/test-printf-posix.h: Likewise. * tests/test-regex.c: Likewise. * tests/test-snprintf-posix.h: Likewise. * tests/test-sprintf-posix.h: Likewise. * tests/test-stdalign.c: Likewise. * tests/test-stdbool.c: Likewise. * tests/test-vasnprintf-posix.c: Likewise. * tests/test-vasprintf-posix.c: Likewise. * top/maint.mk: Likewise.
* all: Replace many more http URLs by https URLs. Update stale URLs.Bruno Haible2017-09-141-2/+2
| | | | | * users.txt: Remove mention of 'newts'. * lib/localename.c: Update comment about LANG_SOTHO.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* fallthrough: update for GCC 7/8Jim Meyering2017-05-191-1/+1
| | | | | | | | | | | | | | | | * lib/quotearg.c (FALLTHROUGH): New macro. Use it whenever one switch case falls through into the next, replacing "/* Fall through */" comments. This exposed one instance of an unwarranted "fall through" comment: unwarranted because it preceded a "goto" label not a case statement. * lib/freopen-safer.c (freopen_safer): Likewise. * lib/fts.c (leaf_optimization_applies): Likewise. * lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise. * tests/test-getopt_long.h (getopt_long_loop): Likewise. * tests/test-tsearch.c (mangle_tree): Likewise. Also include tests/macros.h for the definition. * tests/test-argp.c (group1_parser): Likewise. * tests/test-getopt.h (getopt_loop): Likewise.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* getopt-gnu: avoid crash in glibc getoptEric Blake2011-07-071-0/+19
| | | | | | | | | | | | | | | Use of "W;" in an option string may be rare, but we might as well avoid crashing on it. * m4/getopt.m4 (gl_GETOPT_CHECK_HEADRS): Detect the problem. * tests/test-getopt.h (test_getopt): Enhance test. * tests/test-getopt_long.h (test_getopt_long): Likewise. * doc/posix-functions/getopt.texi (getopt): Document it. * doc/glibc-functions/getopt_long.texi (getopt_long): Likewise. * doc/glibc-functions/getopt_long_only.texi (getopt_long_only): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* tests: fix compiler warningsEric Blake2010-11-031-1/+1
| | | | | | | | | | | | Detected by icc. The first three files are real test bugs, the last merely silences a warning about mixing an int with an enum type. * tests/test-getopt.h (test_getopt): Fix condition. * tests/test-getopt_long.h (test_getopt_long): Likewise. * tests/test-pipe2.c (main): Likewise. * tests/test-quotearg-simple.c (main): Avoid icc warning. Signed-off-by: Eric Blake <eblake@redhat.com>
* getopt-gnu: match recent glibc fixes and posix rulingEric Blake2010-04-131-6/+11
| | | | | | | | | | | | | | | | | | | | 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.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* test-getopt: enhance testEric Blake2009-12-221-28/+1091
| | | | | | | | | | | | | | | | | | | | Add coverage of optind==0 for getopt_long, since coreutils depends on it. Also test an optstring containing "W;", since that tends to expose corner-case bugs (even in glibc, so the test is weaker than it could be). * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Require that getopt_long supports optind=0. * tests/test-getopt.c (OPTIND_MIN): Move... * tests/test-getopt.h (OPTIND_MIN): ...here. * tests/test-getopt_long.h (test_getopt_long): Add more coverage. Require that optind=0 works, since modern BSD supports it in addition to optreset, and since coreutils expects it. (test_getopt_long_only): New test. * doc/glibc-functions/getopt_long.texi (getopt_long): Document glibc shortcomings with 'W;', and enforcement of optind=0. * doc/glibc-functions/getopt_long_only.texi (getopt_long_only): Likewise.
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-95/+95
|
* getopt-gnu: flush out another BSD bugEric Blake2009-11-271-7/+95
| | | | | | | | | | | | | | | | | | | | | | | | | POSIX requires 'echo foo > bar; m4 -Dfoo=1 bar -Dfoo=2 bar' to output '1' then '2'. To achieve this, m4 relies on the GNU getopt{,_long} extension of a leading '-'. However, BSD getopt fails to honor this extension when POSIXLY_CORRECT. Also, BSD getopt fails to reparse POSIXLY_CORRECT from the environment even when a reset is requested (whether by optreset=1 or by optind=0). * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Test for the bug. * tests/test-getopt.c (main): Check POSIXLY_CORRECT first, to flush out BSD bug. * tests/test-getopt.h (test_getopt): End lists with NULL. * tests/test-getopt_long.h (test_getopt_long): Likewise. (test_getopt_long_posix): Enhance test. * modules/getopt-posix-tests (Depends-on): Add stdbool. * doc/glibc-functions/getopt_long.texi (getopt_long): Mention getopt-gnu. * doc/glibc-functions/getopt_long_only.texi (getopt_long_only): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* tests: avoid several compiler warningsEric Blake2009-10-221-43/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-getcwd.c (main): Avoid buffer underflow. * tests/test-getdate.c (main): String literals are not safe with putenv, so use setenv. Declare unused argument. * modules/getdate-tests (Depends-on): Add setenv. * tests/test-argv-iter.c (main): Declare unused argument. Avoid problems with string literals in char *. * tests/test-hash.c (main): Avoid shadowing declaration. (insert_new): Treat string literals as char const *. * tests/test-getopt.h (test_getopt): Likewise. (getopt_loop): Alter types to minimize casting elsewhere. * tests/test-getopt_long.h (test_getopt_long, getopt_long_loop) (test_getopt_long_posix): Likewise. (do_getopt_long): Add wrapper to minimize casting. * tests/test-atexit.c (clear_temp_file): Use void. * tests/test-areadlink-with-size.c (main): Declare unused arguments. * tests/test-areadlink.c (main): Likewise. * tests/test-areadlinkat-with-size.c (main): Likewise. * tests/test-areadlinkat.c (main): Likewise. * tests/test-canonicalize-lgpl.c (main): Likewise. * tests/test-canonicalize.c (main): Likewise. * tests/test-dirent-safer.c (main): Likewise. * tests/test-dirname.c (main): Likewise. * tests/test-dup2.c (main): Likewise. * tests/test-fchdir.c (main): Likewise. * tests/test-fcntl-h.c (main): Likewise. * tests/test-fcntl-safer.c (main): Likewise. * tests/test-fdopendir.c (main): Likewise. * tests/test-fdutimensat.c (main): Likewise. * tests/test-fflush.c (main): Likewise. * tests/test-filenamecat.c (main): Likewise. * tests/test-filevercmp.c (main): Likewise. * tests/test-fopen-safer.c (main): Likewise. * tests/test-fopen.c (main): Likewise. * tests/test-fpending.c (main): Likewise. * tests/test-fpurge.c (main): Likewise. * tests/test-freading.c (main): Likewise. * tests/test-fstatat.c (main): Likewise. * tests/test-fsync.c (main): Likewise. * tests/test-futimens.c (main): Likewise. * tests/test-getndelim2.c (main): Likewise. * tests/test-gettimeofday.c (main): Likewise. * tests/test-getopt.c (main): Likewise. * tests/test-i-ring.c (main): Likewise. * tests/test-inttypes.c (main): Likewise. * tests/test-link.c (main): Likewise. * tests/test-lstat.c (main): Likewise. * tests/test-math.c (main): Likewise. * tests/test-md5.c (main): Likewise. * tests/test-memchr2.c (main): Likewise. * tests/test-memrchr.c (main): Likewise. * tests/test-mkdir.c (main): Likewise. * tests/test-mkdirat.c (main): Likewise. * tests/test-mkfifoat.c (main): Likewise. * tests/test-open.c (main): Likewise. * tests/test-openat-safer.c (main): Likewise. * tests/test-openat.c (main): Likewise. * tests/test-quotearg.c (main): Likewise. * tests/test-rawmemchr.c (main): Likewise. * tests/test-readlink.c (main): Likewise. * tests/test-remove.c (main): Likewise. * tests/test-rename.c (main): Likewise. * tests/test-renameat.c (main): Likewise. * tests/test-rmdir.c (main): Likewise. * tests/test-sha1.c (main): Likewise. * tests/test-signal.c (main): Likewise. * tests/test-sigaction.c (main): Likewise. * tests/test-stat.c (main): Likewise. * tests/test-stat-time.c (main): Likewise. * tests/test-stddef.c (main): Likewise. * tests/test-stdint.c (main): Likewise. * tests/test-stdio.c (main): Likewise. * tests/test-stdlib.c (main): Likewise. * tests/test-strchrnul.c (main): Likewise. * tests/test-strerror.c (main): Likewise. * tests/test-string.c (main): Likewise. * tests/test-strtod.c (main): Likewise. * tests/test-strverscmp.c (main): Likewise. * tests/test-symlink.c (main): Likewise. * tests/test-symlinkat.c (main): Likewise. * tests/test-sys_stat.c (main): Likewise. * tests/test-sys_time.c (main): Likewise. * tests/test-time.c (main): Likewise. * tests/test-unistd.c (main): Likewise. * tests/test-unlink.c (main): Likewise. * tests/test-unlinkat.c (main): Likewise. * tests/test-utimens.c (main): Likewise. * tests/test-utimensat.c (main): Likewise. * tests/test-version-etc.c (main): Likewise. * tests/test-wchar.c (main): Likewise. * tests/test-wctype.c (main): Likewise. * tests/test-xprintf-posix.c (main): Likewise. * tests/test-posixtm.c (main): Likewise. (STREQ): Delete unused macro. * tests/test-linkat.c (main): Declare unused arguments. Avoid shadowed variables. * tests/test-memchr.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* getopt-gnu: add another testEric Blake2009-10-061-0/+21
| | | | | | | | | | | | | Ensure that POSIXLY_CORRECT does not interfere with optional argument behavior; older BSD implementations botched this. * tests/test-getopt_long.h (test_getopt_long_posix): New test, to guarantee behavior relied on by m4. * tests/test-getopt.c (main): Use it. * modules/getopt-posix-tests (Depends-on): Add setenv. See http://lists.gnu.org/archive/html/bug-m4/2006-09/msg00028.html. Signed-off-by: Eric Blake <ebb9@byu.net>
* Tests for modules 'getopt-posix', 'getopt-gnu'.Bruno Haible2009-08-131-0/+937