Commit Graph

8 Commits

Author SHA1 Message Date
b6edea5ce7 tests/times.c: fix clang compilation warning
* tests/times.c (main): Initialize dummy variable.
2016-01-12 05:06:10 +00:00
6a641fce5d tests/times.c: use libtests
* tests/times.c (main): Use perror_msg_and_fail and perror_msg_and_skip.
2016-01-05 23:44:59 +00:00
0c8853c3c3 tests: include tests.h instead of config.h
Automatically edit tests/*.c files using the following perl one-liner:

perl -0777 -pi -e \
's/#ifdef HAVE_CONFIG_H\n# include "config\.h"\n#endif\n*/#include "tests.h"\n/' \
tests/*.c
2016-01-05 23:17:11 +00:00
38a34c9349 Add copyright headers to some files which lack them
Before this change, all files that exist since 20th century had
copyright headers, while most files that appeared later didn't.  This
change fixes the inconsistency by adding missing copyright headers.

It doesn't mean that copyright headers became maintained.  In my view,
git history provides much better information on this subject and is much
more accurate than copyright headers.
2015-12-17 17:56:48 +00:00
b6b38fa73b tests/times.test: workaround libc bug on x32
As glibc times wrapper on x32 is known to wrongly truncate and then sign
extend the syscall return value, invoke the syscall directly on x32.

* tests/times.c (main) [__NR_times && __x86_64__ && __ILP32__]:
Invoke times syscall using inline asm.
2015-12-15 23:34:03 +00:00
4bbed305da times.test: workaround buggy libc
* tests/times.c: Include <sys/syscall.h>.
(main): On systems where user's and kernel's long types are the same,
prefer direct times syscall over libc's times function because
the latter is more prone to return value truncation.
2015-12-06 07:59:20 +00:00
fc0a22d40b times.test: reduce cpu time consumption, increase struct tms diversity
* tests/times.c (main): Reduce cpu time consumption fourfold,
make the parent process consume less cpu time than the child process
so that members of the structure returned by times syscall would be
more likely to contain different values.
2015-12-06 07:24:16 +00:00
Eugene Syromyatnikov
7a036055af tests: add times.test
* tests/times.c: New file.
* tests/times.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add times.
(TESTS): Add times.test.
(times_LDADD): Define.
* tests/.gitignore: Add times.
2015-08-28 08:46:24 +00:00