about summary refs log tree commit diff
path: root/test-skeleton.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
|
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* Remove "Contributed by" linesSiddhesh Poyarekar2021-09-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | We stopped adding "Contributed by" or similar lines in sources in 2012 in favour of git logs and keeping the Contributors section of the glibc manual up to date. Removing these lines makes the license header a bit more consistent across files and also removes the possibility of error in attribution when license blocks or files are copied across since the contributed-by lines don't actually reflect reality in those cases. Move all "Contributed by" and similar lines (Written by, Test by, etc.) into a new file CONTRIBUTED-BY to retain record of these contributions. These contributors are also mentioned in manual/contrib.texi, so we just maintain this additional record as a courtesy to the earlier developers. The following scripts were used to filter a list of files to edit in place and to clean up the CONTRIBUTED-BY file respectively. These were not added to the glibc sources because they're not expected to be of any use in future given that this is a one time task: https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-021-1/+1
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* support: Introduce new subdirectory for test infrastructureFlorian Weimer2016-12-091-705/+46
| | | | | | | | | | | | | | | The new test driver in <support/test-driver.c> has feature parity with the old one. The main difference is that its hooking mechanism is based on functions and function pointers instead of macros. This commit also implements a new environment variable, TEST_COREDUMPS, which disables the code which disables coredumps (that is, it enables them if the invocation environment has not disabled them). <test-skeleton.c> defines wrapper functions so that it is possible to use existing macros with the new-style hook functionality. This commit changes only a few test cases to the new test driver, to make sure that it works as expected.
* Minor problems exposed by compiling C++ tests under _ISOMAC.Zack Weinberg2016-11-271-0/+1
| | | | | * libio/libio.h: Use __USE_GNU, not _GNU_SOURCE, in a conditional. * test-skeleton.c: Include stdint.h to ensure uintptr_t is available.
* Document do_test in test-skeleton.cSteve Ellcey2016-11-071-1/+16
| | | | * test-skeleton.c: Document do_test usage.
* Consolidate fallocate{64} implementationsAdhemerval Zanella2016-10-071-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the fallocate{64} implementation for Linux in only one (sysdeps/unix/sysv/linux/fallocate{64}.c). It also removes the syscall from the auto-generation using assembly macros. The new macro SYSCALL_LL{64} is used to handle the offset argument. Checked on x86_64, x32, i386, aarch64, and ppc64le. * sysdeps/unix/sysv/linux/Makefile (test): Add tst-fallocate and tst-fallocate64. * sysdeps/unix/sysv/linux/tst-fallocate.c: New file. * sysdeps/unix/sysv/linux/tst-fallocate64.c: Likewise. * sysdeps/unix/sysv/linux/tst-fallocate-common.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c: Remove file. * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c: Likewise. * sysdeps/unix/sysv/linux/fallocate.c (fallocate): Use SYSCALL_LL macro on offset argument. * sysdeps/unix/sysv/linux/fallocate64.c (fallocate64): Use SYSCALL_LL64 on offset argument. * test-skeleton.c (FAIL_RET): Add macro. (FAIL_EXIT): Likewise. (FAIL_EXIT1): Likewise. (_FAIL): Likewise.
* test-skeleton.c: Remove unintended #include <stdarg.h>.Florian Weimer2016-09-231-1/+0
|
* Add test case for O_TMPFILE handling in open, openatFlorian Weimer2016-09-211-0/+15
| | | | | Also put xasprintf into test-skeleton.c (written in such a way that including <stdarg.h> is not needed).
* Fix test-skeleton C99 designed initializationAdhemerval Zanella2016-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | ISO C forbids empty initializer braces (6.7.9 initializer-list must contain at least one initializer). However GCC allows it, generating a warning depending of the version. With GCC 4.8 on ARM I noticed tst-initializers1.c fails to build with: In file included from tst-initializers1.c:60:0: ../test-skeleton.c: In function 'delayed_exit_thread': ../test-skeleton.c:687:10: error: missing initializer for field 'tv_sec' of 'struct timespec' [-Werror=missing-field-initializers] struct timespec remaining = {} While with GCC 5.1 the same warning is just spilled with -pedantic. To be safe this patch just zero initialize the struct as expected. Tested on armhf. * test-skeleton.c (delayed_exit_thread): Add initializer on struct timespec C99 designated initialization.
* nptl: Avoid expected SIGALRM in most tests [BZ #20432]Florian Weimer2016-08-261-0/+157
| | | | | | | | | | Before this change, several tests did not detect early deadlocks because they used SIGALRM as the expected signal, and they ran for the full default TIMEOUT seconds. This commit adds a new delayed_exit function to the test skeleton, along with several error-checking wrappers to pthread functions. Additional error checking is introduced into several tests.
* malloc: Run tests without calling mallopt [BZ #19469]Florian Weimer2016-08-021-0/+2
| | | | | | The compiled tests no longer refer to the mallopt symbol from their main functions. (Some tests still call mallopt explicitly, which is fine.)
* test-skeleton.c (xrealloc): Support realloc-as-freeFlorian Weimer2016-06-231-3/+3
| | | | | | If the requested size is zero, realloc returns NULL, but the deallocation is still successful, unless the pointer is also NULL, when realloc behaves as malloc (0).
* test-skeleton.c: xmalloc, xcalloc, xrealloc are potentially unusedFlorian Weimer2016-06-231-3/+3
| | | | | | | | | | __attribute__ ((used)) means that the function has to be emitted in assembly because it is referenced in ways the compiler cannot detect (such as asm statements, or some post-processing on the generated assembly). The unused attribute needs to come first, otherwise it is applied to the return type and not the function definition.
* test-skeleton.c: Add write_message functionFlorian Weimer2016-06-231-0/+10
|
* 2016-06-09 Paul Pluzhnikov <ppluzhnikov@gmail.com>Paul Pluzhnikov2016-06-081-9/+49
| | | | | | * test-skeleton.c (oom_error, xmalloc, xcalloc, xrealloc): New functions. (add_temp_file): Use them.
* test-skeleton.c: Do not set RLIMIT_DATA [BZ #19648]Florian Weimer2016-03-071-17/+0
| | | | | | | | | With older kernels, it is mostly ineffective because it causes malloc to switch from sbrk to mmap (potentially invalidating malloc testing compared to what real appliations do). With newer kernels which have switched to enforcing RLIMIT_DATA for mmap as well, some test cases will fail in an unintended fashion because the limit which was set previously does not include room for all mmap mappings.
* test-skeleton: increase default TIMEOUT to 20 secondsMike Frysinger2016-02-191-2/+3
| | | | | | | | | | | | | | | | | | | The vast majority of timeouts I've seen w/glibc tests are due to: - slow system (e.g. <1 GHz cpu) - loaded system (e.g. lots of parallelism) Even then, I've seen timeouts on system I don't generally consider slow, or even loaded, and considering TIMEOUT is set to <=10 in ~60 tests (and <=20 in ~75 tests), it seems I'm not alone. I've just gotten in the habit of doing `export TIMEOUTFACTOR=10` on all my setups. In the edge case where there is a bug in the test and the timeout is hit, I think we all agree that's either a problem with the test or a real bug in the library somewhere. In either case, the incident rate should be low, so catering to that seems like the wrong trade-off. Other developers too usually set large timeout factors. Increase the default to 20 seconds to match reality.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* test-skeleton: add usage informationMike Frysinger2015-08-051-0/+36
| | | | | | | | | | I keep trying to run tests with --help and then remembering that does nothing when it throws an error. That means I have to dig into the source when I want to refer to flags or env vars and re-read a good amount of code to find the nested locations. Make this all much more user friendly with a usage screen that gets printed out whenever an unknown option is specified.
* Avoid outputting to TTY after an expected memory corruption in testcaseTulio Magno Quites Machado Filho2015-06-051-11/+17
| | | | | | Protect TTY against an expected memory corruption from testcase tst-malloc-backtrace, which is expected to SIGABRT after a forced memory corruption.
* Ensure `wint_t' is defined before use in include/stdio.hArjun Shankar2015-05-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to get nptl/tst-initializers1.c to include the test skeleton, I came across a couple of speed bumps. Firstly: after making the appropriate changes to the test, running `make check' led to this error: > In file included from ../malloc/malloc.h:24:0, .. > from tst-initializers1.c:60: > ../include/stdio.h:111:1: error: unknown type name `wint_t' > extern wint_t __getwc_unlocked (FILE *__fp); So, `wint_t' is used before being defined. Question: Why did test-skeleton.c not cause this error in any of the other tests that include it? Anyway, I noticed include/stdio.h includes stddef.h, which in turn defines `wint_t', but only if `__need_wint_t' is defined. So I put in a `#define __need_wint_t' before the include to get rid of the error. Is that the correct fix? A subsequent `make && make check' led to this second error: > from tst-initializers1-c89.c:1: > ../test-skeleton.c: In function `main': > ../test-skeleton.c:356:11: error: `for' loop initial declarations are only > allowed in C99 mode > for (struct temp_name_list *n = temp_name_list; Although there seem to be several other C89 no-noes in test-skeleton.c, I needed only to fix this specific one for gcc-4.8.3 to stop complaining.
* test-skeleton: Support temporary files without memory leaks [BZ#18333]Florian Weimer2015-04-271-5/+18
| | | | | | | | | | add_temp_file now makes a copy which is freed by delete_temp_files. Callers to create_temp_file can now free the returned file name to avoid the memory leak. These changes do not affect the leak behavior of existing code. Also address a NULL pointer derefence in tzset after a memoru allocation failure, found during testing.
* Make test-skeleton.c grok TEST_DIRECT magic environment variable.Roland McGrath2015-04-091-5/+46
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Fix tst-strcoll-overflow returning before timeout (BZ #17506)Leonhard Holz2014-11-121-28/+35
| | | | | | | Modifies the test examination in test-skeleton.c so that a test can be successful if it is interrupted or it returns uninterrupted with the expected status. For this both EXPECTED_SIGNAL and EXPECTED_STATUS have to be set, as is done in tst-strcoll-overflow.c.
* test-skeleton: Kill any child process's offspringMaciej W. Rozycki2014-06-301-2/+7
| | | | | | | | | | | This makes sure any subprocesses created by the program being tested get killed as well if their parent times out. Otherwise if they are really stuck, they may remain there running forever after the test case and then the whole test suite has completed, until killed by hand. * test-skeleton.c (signal_handler): Kill the whole process group before killing the child individually. (main): Report any failure on `setpgid'.
* test-skeleton.c: Use stdout for error messagesWill Newton2014-06-231-23/+21
| | | | | | | | | | | | | | | | | | At the moment the test skeleton uses a mixture of stdout and stderr for error message output. Using stdout for all test output keeps all output correctly ordered and properly redirected to the output file. The suggestion to use stdout is also made on the wiki: https://sourceware.org/glibc/wiki/Testing/Testsuite#Writing_a_test_case ChangeLog: 2014-06-23 Will Newton <will.newton@linaro.org> * test-skeleton.c (signal_handler): Use printf and %m rather than perror. Use printf rather than fprintf to stderr. Use puts rather than fputs to stderr. (main): Likewise.
* tests: unify fortification handler logicMike Frysinger2014-02-081-0/+28
| | | | | | | We have multiple tests that copy & paste the same logic for disabling the fortification output. Let's unify this in the test-skeleton instead. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* Improve test-skeleton.c to clean up after dead parent.Ulrich Drepper2009-08-141-3/+12
|
* (timeout_handler): Rewrite ts initialization for C++.Ulrich Drepper2005-12-231-1/+3
|
* * malloc/arena.c (ptmalloc_init): Recognize MALLOC_PERTURB_ and callUlrich Drepper2005-03-081-1/+5
| | | | | | | | | | | | mallopt appropriately. * malloc/malloc.h: Define M_PERTURB. * malloc/malloc.c (perturb_byte): New variable. (alloc_perturb, free_perturb): New macros. (_int_malloc): Before returning, overwrite the memory if this is requested. (_int_free): Overwrite freed memory if requested. (mALLOPt): Handle M_PERTURB. * test-skeleton.c: Add call to mallopt with M_PERTURB command.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-8/+2
|
* 2.5-18.1Jakub Jelinek2007-07-121-2/+8
|
* Update.Ulrich Drepper2004-02-191-2/+16
| | | | | | | 2004-02-18 Carlos O'Donell <carlos@baldric.uwo.ca> * test-skeleton.c (main): If set, use environment variable TIMEOUTFACTOR to scale test TIMEOUT.
* Update.Ulrich Drepper2003-12-311-1/+1
| | | | | | | | | | | | | | * inet/rcmd.c: Provide better error message in case of unknown host. Remove USE_IN_LIBIO. * nscd/nscd.init: Updated version, more conforming with current init file standards. * nscd/nscd-client.h (_PATH_NSCDPID): Move the file into /var/run/nscd directory. (_PATH_NSCDSOCKET): Likewise. * test-skeleton.c (timeout_handler): Fix error message.
* * posix/transbug.c: Include <string.h> for memset and strlen Andreas Jaeger2003-06-251-0/+1
| | | | | | | | | | | | | | | | | | | declarations. * stdio-common/tst-sprintf.c: Include <stdlib.h> for free declaration. * stdlib/tst-strtod.c (main): Pass long double value. * test-skeleton.c: Include <time.h> for nanosleep declaration. 2003-06-25 Andreas Jaeger <aj@suse.de> * posix/transbug.c: Include <string.h> for memset and strlen declarations. * stdio-common/tst-sprintf.c: Include <stdlib.h> for free declaration. * stdlib/tst-strtod.c (main): Pass long double value. * test-skeleton.c: Include <time.h> for nanosleep declaration.
* Update.Ulrich Drepper2003-06-251-2/+15
| | | | | | | | 2003-06-19 Jakub Jelinek <jakub@redhat.com> * test-skeleton.c (timeout_handler): If waitpid returned 0, retry once after a second. If killed == 0, assume WTERMSIG (status) == SIGKILL.
* Update.Ulrich Drepper2003-06-071-0/+11
| | | | | * test-skeleton.c (main): If EXPECTED_STATUS is defined check that returned status from child matches.
* Update.Ulrich Drepper2003-06-071-0/+1
| | | | | | 2003-06-07 Ulrich Drepper <drepper@redhat.com> * Makeconfig (gnulib): Add -lgcc_eh once again.