Commit Graph

7 Commits

Author SHA1 Message Date
d8a81dfa40 tests: extend readlink and readlinkat coverage
* tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros.
(main): Allocate memory for string and buffer passed to the syscall
being tested using tail_alloc mechanism.  Create and cleanup test
symlink.  Test syscall error path output.  Print hexquoted strings
using hexquote_strndup.
* tests/readlinkat.c: Likewise.
* tests/readlink.test: Remove creation and cleanup of test symlinks.
2016-02-04 03:36:25 +00:00
3f6a552e1e tests/readlinkat.c: use libtests
* tests/readlinkat.c: Use SKIP_MAIN_UNDEFINED.
(main): Use perror_msg_and_skip.
2016-01-05 23:27:05 +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
c633188e82 tests: convert readlink.test and readlinkat.test from match_awk to match_diff
* tests/readlink.c (main): Print expected output.
* tests/readlinkat.c (main): Likewise.
* tests/readlink.test: Use match_diff instead of match_awk.
* tests/readlinkat.test: Likewise.
* tests/readlink.awk: Remove.
* tests/readlinkat.awk: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove readlink.awk and readlinkat.awk.
2015-08-28 08:43:57 +00:00
ff6b6f3f72 tests: fix build on systems that lack AT_FDCWD definition
* tests/readlinkat.c: Stop including <fcntl.h>.
(main): Replace AT_FDCWD with -100.
2015-08-26 20:23:31 +00:00
Gleb Fotengauer-Malinovskiy
3af6aabe52 tests: add readlink.test and readlinkat.test
* tests/readlink.c: New file.
* tests/readlink.awk: Likewise.
* tests/readlinkat.c: Likewise.
* tests/readlinkat.awk: Likewise.
* tests/readlink.test: New test.
* tests/readlinkat.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add readlink and readlinkat.
(TESTS): Add readlink.test and readlinkat.test.
(EXTRA_DIST): Add readlink.awk and readlinkat.awk.
* tests/.gitignore: Add readlink and readlinkat.
2015-08-15 02:21:22 +02:00