Simon Ruderich
a685b825aa
tests: Add example_stdio.c and test_stdio.sh.
2013-06-22 18:21:10 +02:00
Simon Ruderich
e3234d6c08
tests/Makefile.am: Fix for BSD's make.
2013-06-22 00:43:48 +02:00
Simon Ruderich
219a9882ba
tests: Check return values of write() and dup2().
2013-06-21 23:03:12 +02:00
Simon Ruderich
0d7f306898
Overwrite tracked file descriptors when exporting COLORED_STDERR_FDS.
...
If the list of tracked file descriptors is modified to contain unwanted
values (e.g. when a parent process closes or redirects stderr), this
makes it possible to set the tracked file descriptors back to a given
list.
This problem occurred with startx which somehow closes or redirects
stderr. As COLORED_STDERR_FDS was set in the shell running startx, this
disabled coloring stderr for all processes started in the X11 session.
This is no longer an issue. As COLORED_STDERR_FDS is set in the shell
configuration file, it automatically sets the list to the correct value
when a shell is opened in the terminal emulator once X11 is running.
2013-06-21 23:03:12 +02:00
Simon Ruderich
ba2283bd37
Remove invalid assert() in tracked_fds_find().
2013-06-20 23:17:03 +02:00
Simon Ruderich
d78910e363
tests/Makefile.am: Remove unnecessary *_SOURCES variables.
...
They are only required if more than one source file (or one with a
different name) is used.
2013-06-20 22:02:30 +02:00
Simon Ruderich
1fb32dbd84
tests: Remove test_symbols.sh.
...
It's useless as different systems provide/require different symbols.
Will be replaced by a better test.
2013-06-20 20:46:06 +02:00
Simon Ruderich
85699d0263
tests/example.c: Use errno = ENOMEM.
...
The output from errno = 0 is less portable.
2013-06-17 23:28:07 +02:00
Simon Ruderich
34b3b93136
tests/example_error.c: Fix typo in function name.
2013-06-15 03:41:06 +02:00
Simon Ruderich
941370dda9
Hook BSD err(), errx(), warn(), warnx(), etc. functions.
...
err(), errx(), warn(), warnx(), verr(), verrx(), vwarn(), vwarnx() are
hooked.
2013-06-15 02:39:52 +02:00
Simon Ruderich
6ae629bef0
tests/Makefile.am: Enable parallel and colored test runs.
...
Necessary for automake < 1.13.
2013-06-14 21:24:53 +02:00
Simon Ruderich
d5b84811d2
tests/lib.sh: Fix tests for dash.
2013-06-13 22:35:42 +02:00
Simon Ruderich
3c2b4bf9f6
tests/lib.sh: Minor cleanup.
2013-06-13 22:11:15 +02:00
Simon Ruderich
59375c2b79
Fix possible memory overwrite in init_from_environment().
...
It was possible for a user to overwrite memory at a relative location
with 1 by passing a negative file descriptor.
2013-06-13 22:08:08 +02:00
Simon Ruderich
37cb5686de
Handle invalid arguments to close()/fclose() better.
2013-06-13 21:19:15 +02:00
Simon Ruderich
7adfbfd2cf
Fix hook for putc_unlocked() with glibc.
...
putc_unlocked() is a macro which expands to __overflow() in some cases.
2013-06-13 12:59:12 +02:00
Simon Ruderich
d8be625da9
tests/test_symbols.sh: Add.
2013-06-13 02:32:27 +02:00
Simon Ruderich
5e8be10581
tests/Makefile.am: Sort dist_check_DATA.
2013-06-13 02:29:55 +02:00
Simon Ruderich
04ac66863a
tests: Split run.sh in multiple test files.
...
Allows parallel test runs and simplifies optional tests.
2013-06-13 01:26:25 +02:00
Simon Ruderich
05aefe25ba
tests: Rename example-* to example_* for consistency.
2013-06-13 01:05:06 +02:00
Simon Ruderich
8a58e07a5b
tests: Fix tests when running under coloredstderr.
2013-06-10 22:49:58 +02:00
Simon Ruderich
237251ae9c
Hook execvpe(), a GNU extension.
2013-06-10 17:10:44 +02:00
Simon Ruderich
afca2864dc
tests: Fix warnings about unused parameters.
2013-06-10 15:22:17 +02:00
Simon Ruderich
2f1aa1cdd3
Only run vfork() tests if it's available.
2013-06-10 15:16:21 +02:00
Simon Ruderich
06f483dbee
Fix a few strict compiler warnings.
2013-06-07 02:01:23 +02:00
Simon Ruderich
c2097785e7
Use static list of descriptors to reduce mallocs.
...
Only if file descriptors with a value > 255 occur, the list
implementation is used.
2013-06-07 01:27:58 +02:00
Simon Ruderich
5c8b5233fb
tests: Run tests under valgrind if it's available.
2013-06-07 01:17:42 +02:00
Simon Ruderich
7f9856c5da
Hook error() and error_at_line() if available.
...
They are used by some GNU programs to display error messages.
2013-06-05 23:57:05 +02:00
Simon Ruderich
7ea72c40db
Hook execve() and the other exec*() functions.
...
Prevents programs from removing our environment variables during the
exec.
Also reduces unnecessary calls to update_environment() by calling it
only once before the exec.
2013-06-05 01:40:56 +02:00
Simon Ruderich
374b11a314
tests: Also run tests in subshell with LD_PRELOAD set.
2013-06-05 01:06:10 +02:00
Simon Ruderich
7108005fff
tests: Use <STDERR< and >STDERR> as markers.
...
Increases contrast to "stderr" output string.
2013-06-02 23:41:31 +02:00
Simon Ruderich
e091b977de
tests: Use bash to get consistent test results.
2013-06-02 23:39:14 +02:00
Simon Ruderich
1c5441c26a
Hook vfork() and replace it with fork().
2013-06-02 18:25:49 +02:00
Simon Ruderich
ad50ad9c54
Hook perror(3).
2013-06-01 22:08:45 +02:00
Simon Ruderich
fb9548453f
Add simple test suite.
2013-06-01 21:51:28 +02:00