24 Commits

Author SHA1 Message Date
Nick Mathewson
7afe48aab8 Add a unit test for event_base_dump_events()
This function uses a C program to generate its output, and then uses a
Python program to check it for correctness.  On systems without
Python, we just make sure that the C program doesn't crash.

It's likely that we should be requiring some particular python version.
This is an alpha, though: I'm sure somebody will tell us which.
2012-03-23 17:56:23 -04:00
Ross Lagerwall
2ef92786e3 Add a new test: test-fdleak which tests for fd leaks by creating many sockets.
This test opens a server socket, and forks a child which connects to that
server socket many times. It sets a low number for the max open file limit
to catch any file descriptor leaks.
It would not work on Windows since it uses fork() to be able to create both the
server and the clients.
2012-02-23 21:44:30 +02:00
Nick Mathewson
16bacbc5de Fix a test-call accidentally in the last commit 2011-07-05 14:43:24 -04:00
Nick Mathewson
cd74c4ec3b More abstraction in test.sh 2011-07-05 14:41:46 -04:00
Nick Mathewson
039b9bd0e3 Use %s with printf in test.sh 2011-02-22 00:31:56 -05:00
Dave Hart
49e9bb7fb0 Add configure options to disable installation, regression tests
The main reason for disabling installation is if you're building
libevent as a subpackage for embedding: you want to have your main
package's "make all" build libevent, but you don't want your main
package's "make install" to install libevent.
2011-02-22 00:28:37 -05:00
Dave Hart
b4f89b608a Fix test.sh output on solaris
Solaris echo -n doesn't omit newlines, but printf omits newlines in
more places.
2011-02-01 02:09:49 -05:00
Nick Mathewson
ece974fbba Reorder backends in test.sh to match preference order in event.c 2010-11-22 15:51:45 -05:00
Nick Mathewson
aed7e02979 Make unit tests for epoll-with-changelist pass
The only changes needed were to handle the fact that the methodname
"epoll (with changelist)" matches the environment variable
EVENT_NOEPOLL rather than the imaginary "EVENT_EPOLL (WITH CHANGELIST)".
2010-11-22 15:51:45 -05:00
Nick Mathewson
7c926916b2 Make test/test.sh call test-changelist
Eventually test-changelist should expand to try more cases, maybe
query the status of the actual changelist somehow, and integrate it
with the rest of the unit tests.

Also, add test-changelist to gitignore.
2010-07-19 15:16:29 +02:00
Nick Mathewson
3689bd2d49 Have the unit tests report errors from test.sh
The default behavior of test.sh was to suppress all output from
test/regress, and say nothing but OKAY or FAILED.  This wasn't so good
for getting bugs reported, since lots of people didn't know to set
TEST_OUTPUT_FILE, or re-run ./test/regress on its own.

Now, when you don't specify an output file for test.sh, it runs
regress with the --quiet option.  This option makes the unit tests
only print output on failure, which is what we probably wanted.
2010-05-26 13:43:01 -04:00
Nick Mathewson
faf2a04fa5 Make test.sh exit with nonzero status if tests fail
This behavior makes "make verify" actually fail when the tests fail,
which is what it's supposed to do.
2010-05-26 13:43:01 -04:00
Nick Mathewson
3d9e05b174 Fix test.sh on freebsd
It turns out that in all conformant shells, "unset FOO" removes FOO
both from the shell's variables and from the exported environment.
(I've tested this on msys, opensolaris, linux, osx, and freebsd.)

And in nearly every shell I can find, "unset FOO; export FOO" does
the same as unset FOO... except in my FreeBSD VM, where the "export
FOO" sets the exported value of FOO equal to "".  This broke test.sh
for us.

The fix is simple: remove the needless exports!
2010-05-08 19:56:25 -04:00
Nick Mathewson
0ee6f6ce80 Make test.sh support mingw/msys on win32
This required:
   - Adding another WIN32 section in test.sh
   - not running "touch /dev/null"
   - calling WSAStartup in all the test binaries
   - Fixing a dumb windows-only bug in test-time.c
2010-05-08 19:38:30 -04:00
Nick Mathewson
94131e92b8 Fix test.sh on shells without echo -n
Some systems have a version of /bin/sh whose builtin echo doesn't
support the -n option used in test/test.sh.  /bin/echo, however,
usually does.  This patch makes us use /bin/echo for echo -n whenever
it is present.

Also, our use of echo -n really only made sense when suppressing all
test output.  Since test output isn't suppressed when logging to a
file, this pach makes us stop using echo -n when logging to a file.
2010-01-12 15:58:36 -05:00
Nick Mathewson
0b151a9fa1 Whitespace fixes in test.sh 2009-12-29 18:11:52 -05:00
Nick Mathewson
7dfbe94aa3 Allow test.sh to be run as ./test/test.sh 2009-12-29 18:07:51 -05:00
Nick Mathewson
c382de6421 Allow the user to redirect the verbose output of test/test.sh to a file
By default, the test.sh script still suppresses the output of all the
tests it invokes.  Now, however, you can have that output written to
a file specified in the TEST_OUTPUT_FILE shell variable.
2009-12-29 17:59:55 -05:00
Nick Mathewson
e9564eceb3 r16487@catbus: nickm | 2007-11-06 22:38:44 -0500
Remove rtsig method, as discussed in July.  It hasn't compiled for quite a while, and nobody has seemed to miss it much.  Please let us know if this was a bad call. [Tracker issue 1826539].


svn:r485
2007-11-07 03:40:26 +00:00
Nick Mathewson
3550be9387 r15331@catbus: nickm | 2007-09-25 11:46:52 -0400
Add EVPORT to test.sh script.  Patch from Trond Norbye.


svn:r454
2007-09-25 15:50:50 +00:00
Niels Provos
acafd9942f make it run on older shells; from tor user via Nick Mathewson <nickm@freehaven.net>
svn:r181
2005-09-02 05:34:01 +00:00
Niels Provos
06aaa92fe2 devpoll support
svn:r113
2004-07-30 04:57:21 +00:00
Niels Provos
1d66008bbf make it work with more shells
svn:r86
2003-10-05 22:02:49 +00:00
Niels Provos
ec70653b61 more tests
svn:r81
2003-09-25 17:55:17 +00:00