test/tinytest.c


Log

Author Commit Date CI Message
Azat Khuzhin 207ea62b 2023-02-12T16:46:40 test: handle -v as --verbose for regress
Thomas Perrot 3daebf30 2021-09-29T13:50:35 test: retriable tests are marked failed only when all attempts have failed Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Azat Khuzhin 90846c30 2021-09-19T13:18:40 test: add --retries-delay (and set to 1 second by default) In attemp to address failures of dns/tcp_* tests under windows [1]. [1]: https://github.com/azat/libevent/runs/3644218468?check_suite_focus=true
Azat Khuzhin d7d6af75 2021-09-19T13:15:02 test: add --retries argument
Azat Khuzhin 6754740f 2020-06-25T21:01:53 test: detect test failures if atexit handler calls _exit(!0) (sanitizers) tinytest uses another way of detecting test failures, it uses pipe between child and parent, and if the test function in child returns OK it writes OK flag into pipe, and reads it in parent. However sanitizers uses atexit handlers to detect leaks, and this will not detect failures in case of exit() will be called from the atexit handlers, fix this by checking status after waitpid().
yuangongji 8d5c5650 2019-09-26T21:47:51 tinytest: support timeout on Windows
Azat Khuzhin 8a674243 2019-03-24T20:36:16 tinytest: fix parsing --timeout argument Fixes: 15b2f41d ("tinytest: implement per-test timeout (via alarm() under !win32 only)")
Azat Khuzhin 15b2f41d 2019-03-24T16:44:56 tinytest: implement per-test timeout (via alarm() under !win32 only)
Azat Khuzhin 63b065be 2018-11-20T01:06:04 regress: introduce TT_RETRIABLE We have some tests that has false-positive due to real/CPU time bound, but they are pretty generic and we do not want to skip them by default. TT_RETRIABLE is the flag that will indicate tinytest to retry the test in case of failure, use it to avoid next possible false-positives: - real time-related - CPU time-related Since I guess it is better to see/grepping RETRYING messages over ignoring completely failed builds. No configuration switch for number of retries was done on purpose (only 3 retries and no more). And this is how it looks BTW: $ gcc ../test/tinytest_demo.c ../test/tinytest.c $ ./a.out --verbose --no-fork demo/timeout_retry demo/timeout_retry: FAIL ../test/tinytest_demo.c:201: assert(i != 1): 1 vs 1 [timeout_retry FAILED] [RETRYING timeout_retry (3)] demo/timeout_retry: OK ../test/tinytest_demo.c:201: assert(i != 1): 2 vs 1 OK ../test/tinytest_demo.c:213: assert(t2-t1 >= 4): 5 vs 4 OK ../test/tinytest_demo.c:215: assert(t2-t1 <= 6): 5 vs 6 1 tests ok. (0 skipped)
Nick Mathewson 7a804767 2014-03-06T18:09:00 Update to the latest version of tinytest This brings us up to tinytest 709a36ba63ff16d8
Nick Mathewson ef7c4f79 2012-06-28T12:58:46 Update to latest tinytest (911b4f0349377)
Nick Mathewson b3887cdf 2012-04-11T21:33:27 Work-around a stupid gcov-breaking bug in OSX 10.6 This only affects the unit tests. Fix found at http://rachelbythebay.com/w/2011/07/12/forkcrash/ (Backport from 2.1)
Nick Mathewson b62b31f1 2012-04-11T21:33:27 Work-around a stupid gcov-breaking bug in OSX 10.6 This only affects the unit tests. Fix found at http://rachelbythebay.com/w/2011/07/12/forkcrash/
Nick Mathewson 6c81be74 2012-02-13T17:49:17 Synchronize with upstream tinytest
Nick Mathewson 539466e5 2012-02-10T17:33:50 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: Makefile.am WIN32-Code/event2/event-config.h configure.in
Nick Mathewson e49e2891 2012-02-10T17:29:53 Update copyright notices to 2012
Nick Mathewson 95e2455c 2012-01-24T16:08:00 When including an -internal.h header outside the main tree, do so early Some of our unit tests and sample code need functions and structures defined in an -internal.h header. But that can freak out OpenSolaris, where stdio.h wants to define _FILE_OFFSET_BITS unless it's already defined, and then evconfig-internal.h defines it. Regular users should never ever use our -internal.h headers, so the solution is to make sure that if we're going to use them ourselves, we do so before system headers.
Nick Mathewson 0cb70e33 2011-10-26T10:17:21 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 3c824bd3 2011-10-24T13:18:09 Update copyright dates to 2011.
Nick Mathewson e9d095d4 2011-06-11T01:41:19 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: test/tinytest.c
Nick Mathewson 812d42e8 2011-06-11T01:26:54 Simplify windows commandname logic in tinytest Instead of using a dup'd pointer, let's use a static array, so we don't need to free it. This patch also makes tinytest build on non-windows again.
Ed Day 57def346 2011-06-11T00:49:24 Fix tinytest invocation from windows shell Original post: This post is in response to a posting last December on a Windows regression fork failure ([Libevent-users] Re: Libevent 2.0.10-stable is released by Dongsheng Song). I noticed the question was not answered and I recently experienced the same error myself when trying to run the Windows regression tests myself. I checked the return status from the CreateProcess call and found it was "file not found". This led me to look at the command-line I was using which was .\regress in a Visual Studio 2008 command prompt window. Windows could not find the file because it did not have the .exe extension on the end. The code that builds the command should be modified to ensure the extension is present.
Nick Mathewson 9f560bfa 2011-05-25T19:50:56 Use "_WIN32", not WIN32: it's standard and we don't need to fake it This patch was automatically generated with perl. Based on a patch by Peter Rosin.
Nick Mathewson 7bcace2d 2010-11-22T21:02:34 Fix some irix compilation warnings spotted by Kevin Bowling
Nick Mathewson 4ebf9509 2010-10-14T14:40:40 Fixes for MSVC compilation
Nick Mathewson f0bd83ea 2010-09-09T16:13:09 Bump to the latest version of tinytest This lets us do without libevent-specific code in tinytest.c, and lets us add a feature to skip individual tests from the command line.
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Nick Mathewson e5bbd40a 2010-02-18T17:41:15 Clean up formatting: use tabs, not 8-spaces, to indent.
Nick Mathewson a7a94310 2010-02-03T23:49:22 Fix some additional -DUNICODE issues on win32. Brodie's patch didn't catch the ones that were new since 1.4.
Nick Mathewson 5b5b880b 2009-07-28T19:41:39 Various MSVC cleanups from Brodie Thiesfield. svn:r1385
Nick Mathewson 61f2a45d 2009-07-17T20:23:05 Add a tinytest flag to initialize threading. svn:r1357
Nick Mathewson 043515bc 2009-07-14T18:50:06 Stop using C++ style comments. svn:r1343
Nick Mathewson 1ad03264 2009-04-23T18:04:50 Fix win32 compilation issues. svn:r1234
Nick Mathewson b3460387 2009-04-17T06:58:18 Even _more_ recent tinytest, designed to give better help output. svn:r1192
Nick Mathewson 81280062 2009-04-17T06:57:52 Add the latest tinytest. This one supports a --terse flag and a --no-fork flag, and outputs nicer. svn:r1190
Nick Mathewson e6ba208b 2009-01-31T07:32:00 Tinytest update: mostly just to allow test skipping. svn:r1080
Nick Mathewson a8203b34 2009-01-29T23:19:57 Refactor unit tests using my spiffy new "tinytest" framework. The big win here is that we can get process-level isolation. This has been tested to work okay on at least Linux and Win32. Only the tests in regress.c have been converted wrapped in the new wrapper functions; the others are still on the old system. svn:r1073