head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.8 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.6 pkgsrc-2012Q4-base:1.6 pkgsrc-2011Q4:1.6.0.4 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q2:1.6.0.2 pkgsrc-2011Q2-base:1.6 pkgsrc-2010Q2:1.5.0.32 pkgsrc-2010Q2-base:1.5 pkgsrc-2010Q1:1.5.0.30 pkgsrc-2010Q1-base:1.5 pkgsrc-2009Q4:1.5.0.28 pkgsrc-2009Q4-base:1.5 pkgsrc-2009Q3:1.5.0.26 pkgsrc-2009Q3-base:1.5 pkgsrc-2009Q2:1.5.0.24 pkgsrc-2009Q2-base:1.5 pkgsrc-2009Q1:1.5.0.22 pkgsrc-2009Q1-base:1.5 pkgsrc-2008Q4:1.5.0.20 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.18 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.16 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.14 pkgsrc-2008Q2-base:1.5 cwrapper:1.5.0.12 pkgsrc-2008Q1:1.5.0.10 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.8 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.6 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.4 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.2 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.4.0.4 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.2 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.3.0.6 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.4 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.2 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.2.0.6 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.4 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.2 pkgsrc-2005Q1-base:1.2; locks; strict; comment @# @; 1.6 date 2010.08.18.04.36.13; author obache; state dead; branches; next 1.5; 1.5 date 2007.03.09.16.25.56; author rillig; state Exp; branches; next 1.4; 1.4 date 2006.09.24.10.30.41; author rillig; state Exp; branches; next 1.3; 1.3 date 2005.11.07.19.44.58; author tv; state dead; branches; next 1.2; 1.2 date 2005.03.14.14.19.01; author rillig; state Exp; branches; next 1.1; 1.1 date 2005.03.11.22.20.49; author rillig; state Exp; branches; next ; desc @@ 1.6 log @Update check to 0.9.8. Based on PR#43757 by Kamel Derouiche. Tue, Sep 22, 2009: Released Check 0.9.8 based on r559 (2009-09-23 21:00). * Fix CHECK_MICRO_VERSION, left at 6 in 0.9.7 by mistake. Tue, Sep 22, 2009: Released Check 0.9.7 based on r552 (2009-09-22 09:26). * Added CK_SUBUNIT support for outputting test information in the subunit wire protocol. See the check manual for more information. (Contributed by Robert Collins). * Added code and tests for timeout scaling via environment variable. Feature requested in tracker item #1549835 on sourceforge. * Added documentation for testing exit values with tcase_add_exit_test(). * Add make_macros perl script from somebody (who?) * add type to check_type error message * add contrib dir with xslt transform * function exist testing support (patch #1726574). * introduce HAVE_WORKING_SETENV to protect tc_timeout_env usage * support running tests with multiple pthreads (Daniel Gollub, closes 1391527) * partial MSYS/MinGW support Mon, Dec 29, 2008: Released Check 0.9.6 based on r453 (2008-12-01 22:14:15). * 'make distcheck' does not work out of the box. Disable the two top lines in doc/Makefile.am and it shall pass. Will have to be fixed later. * add call to AC_REPLACE_FUNCS([strsignal]) * add new rpl_strsignal following rpl_(re)malloc template, body of function due to Roland Illig -- hopefully closes 1629755 * add missing NULL argument to fail* varargs macro calls * define incorrect tests for __GNUC__ only -- both per Roland Illig in bug 1677391 * define CK_ATTRIBUTE_UNUSED for GCC >= 2.95, closing: [ 1674626 ] compile error with non defined __attribute__ compiler * Fixed error in documentation example Makefile.am, bug #1888237 * Fixed spelling (patch #1652630) * Handle NULL in srunner_add_suite(). Fixes #1624887 * add CK_FORK_GETENV to enum fork_status and delete CK_FORK_UNSPECIFIED * call strdup on result from strsignal to avoid clobbering it * add Torok Edwin to AUTHORS * add CK_TEST_RESULT_INVALID to enum test_result * add CK_CTX_INVALID to ck_result_ctx and don't use -1 anymore * count checks in setup() as well; patch due to Roland Stigge * use int __attribute__((unused)) _i instead of int _i __attribute__((unused)) per gcc-3.3.5 request from Sebastian Trahm * rename signal to _signal in _tcase_add_test to avoid a symbol clash with /usr/include/sys/signal.h on OS X. * define rpl_malloc and rpl_realloc for platforms where !malloc(0) and !realloc(0,0), such as AIX, because configure goes and redefines malloc/realloc in this case... * SVNChangeLog patch from Robert Collins * Incorporated patch from Debian for debian bug #395466. This fixes 'AM_PATH_CHECK causes "possibly undefined macro" errors'. * Added new Check fail API. Implemented on top of fail_unless. Future versions will reverse this so fail_unless is implemented on top of the ck_assert API. This API is not documented yet, will probably not be fully released until 0.9.8, when it will be possible to choose API. @ text @$NetBSD: patch-ab,v 1.5 2007/03/09 16:25:56 rillig Exp $ Too few arguments to varargs macro. --- tests/check_check_sub.c.orig Tue Nov 21 18:19:15 2006 +++ tests/check_check_sub.c Fri Mar 9 11:06:47 2007 @@@@ -58,12 +58,13 @@@@ } END_TEST - +#if defined(__GNUC__) START_TEST(test_fail_no_msg) { fail_unless(4 == 5); } END_TEST +#endif START_TEST(test_fail_if_null_msg) { @@@@ -71,12 +72,13 @@@@ } END_TEST - +#if defined(__GNUC__) START_TEST(test_fail_if_no_msg) { fail_if(4 != 5); } END_TEST +#endif START_TEST(test_fail_vararg_msg_1) { @@@@ -102,11 +104,13 @@@@ } END_TEST +#if defined(__GNUC__) START_TEST(test_fail_empty) { fail(); } END_TEST +#endif START_TEST(test_segv) /* line 111 */ { @@@@ -201,7 +205,7 @@@@ if((pid = fork()) < 0) { fail("Failed to fork new process"); } else if (pid > 0) { - fail_unless(1); + fail_unless(1, NULL); kill(pid, SIGKILL); } else { for (;;) { @@@@ -237,7 +241,7 @@@@ } else if (pid > 0) { check_waitpid_and_exit(pid); } else { - fail_unless(1); + fail_unless(1, NULL); check_waitpid_and_exit(0); } } @@@@ -268,7 +272,7 @@@@ if((pid2 = check_fork()) < 0) { fail("Failed to fork new process"); } else if (pid2 == 0) { - fail_unless(1); + fail_unless(1, NULL); check_waitpid_and_exit(0); } check_waitpid_and_exit(pid2); @@@@ -361,13 +365,19 @@@@ tcase_add_test (tc_simple, test_fail_if_pass); tcase_add_test (tc_simple, test_fail_if_fail); tcase_add_test (tc_simple, test_fail_null_msg); +#if defined(__GNUC__) tcase_add_test (tc_simple, test_fail_no_msg); +#endif tcase_add_test (tc_simple, test_fail_if_null_msg); +#if defined(__GNUC__) tcase_add_test (tc_simple, test_fail_if_no_msg); +#endif tcase_add_test (tc_simple, test_fail_vararg_msg_1); tcase_add_test (tc_simple, test_fail_vararg_msg_2); tcase_add_test (tc_simple, test_fail_vararg_msg_3); +#if defined(__GNUC__) tcase_add_test (tc_simple, test_fail_empty); +#endif tcase_add_test (tc_signal, test_segv); tcase_add_test_raise_signal (tc_signal, test_segv, 11); /* pass */ @ 1.5 log @Portability fixes for IRIX with MIPSpro. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.4 2006/09/24 10:30:41 rillig Exp $ @ 1.4 log @Added a patch for SunPro. @ text @d1 1 a1 1 $NetBSD$ d3 16 a18 3 --- tests/check_check_sub.c.orig 2005-07-19 14:46:26.000000000 +0200 +++ tests/check_check_sub.c 2006-09-24 12:28:24.848798552 +0200 @@@@ -104,7 +104,10 @@@@ END_TEST d20 22 a43 2 +#if !defined(__SUNPRO_C) +/* SunPro does not support the gcc-style __VA_ARGS__ use. */ d45 2 d48 20 d69 26 a94 1 END_TEST d96 2 @ 1.3 log @Update to 0.9.3. Abbreviated changes: + * src/check.h.in: Added include of stddef.h for NULL definition + * doc/tutorial.sgml: Fixed sourceforge bug #1216502 + Refactored messaging to use the new tmpfile() method all the way, + removing the message keys, pipes, pipe entries and pipe list. This + makes the messaging work with forking tests, and also with threading + tests on linux 2.4 (on 2.6 it already worked). Added check_fork and + check_waitpid_and_exit to be used for forking tests. + * src/check.h.in: Fixed compatibility with gcc 2.95.3 according + to sourceforge patch #1161654. + * src/check_run.c, tests/check_check_master.c: Changed timeout + error message according to sourceforge feature request #1121452. + * tests/ex_xml_output.c, tests/ex_log_output.c, tests/ex_output.c, + src/check_log.c: + Fixed memory leaks. + * check.m4, config.h.in, configure.in, src/check_pack.c: Fixed + quoting and added configure test for stdint.h. + * src/check_run.c, tests/check_check_master.c: Use strsignal + to print describing text for signals. + * doc/tutorial.sgml: Documented signals handling and timeouts. + * tests/check_check_master.c src/check.h.in: + Changed failure message for fail_if. + * src/check.c, src/check.h.in, src/check_impl.h, src/check_run.c, + tests/check_check_master.c, tests/check_check_sub.c: + Added support for timeouts on tests, enabling detection of + eternal loops as errors. + * src/check.c, src/check.h.in, src/check_impl.h, src/check_run.c, + tests/check_check_master.c, tests/check_check_sub.c: + Added support for testing on expected signals. Implementation + courtesy of Lucas Di Pentima and Cesar Ballardini. Also cleaned + up the test verification to simplify merging of new tests. + * src/check.c, src/check_list.c, src/check_list.h, src/check_log.c, + src/check_msg.c, tests/check_list.c: + Changed name on function list_create to check_list_create to avoid + name clash. + * src/check.c, src/check.h.in, tests/check_check_master.c, + tests/check_check_sub.c: Applied ANSI C99 patch (#1047014) @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.2 2005/03/14 14:19:01 rillig Exp $ d3 3 a5 19 This patch makes check compile with cpp-2.95.3. The bug which it fixes is quite subtile. When fail_if(x) is expanded, the preprocessor deletes the last token before the ##. For cpp-2.95, this token starts with the "f" of failed. Later versions of cpp just remove the comma. --- src/check.h.in.orig Wed Aug 18 14:03:46 2004 +++ src/check.h.in Mon Mar 14 13:29:49 2005 @@@@ -157,15 +157,15 @@@@ static void __testname (void)\ /* Fail the test case unless expr is true */ #define fail_unless(expr, msg, args...)\ _fail_unless(expr, __FILE__, __LINE__,\ - msg ? msg : "Assertion '"#expr"' failed", ##args) + msg ? msg : "Assertion '"#expr"' failed" , ##args) /* Fail the test case if expr is true */ #define fail_if(expr, msg, args...)\ _fail_unless(!(expr), __FILE__, __LINE__,\ - msg ?msg :"Assertion '"#expr"' failed", ##args) + msg ?msg :"Assertion '"#expr"' failed" , ##args) d7 8 a14 3 /* Always fail */ -#define fail(msg, args...) _fail_unless(0, __FILE__, __LINE__, msg, ##args) +#define fail(msg, args...) _fail_unless(0, __FILE__, __LINE__, msg , ##args) a15 2 /* Non macro version of #fail_unless, with more complicated interface */ void _fail_unless (int result, const char *file, @ 1.2 log @Replaced the last patch. It had been for check-0.9.2, but we currently only have check-0.9.1. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Added a patch to make check compile with cpp-2.95.3. Approved by wiz. @ text @d6 1 a6 1 "o" of occured. Later versions of cpp just remove the comma. d8 9 a16 3 --- src/check.h.in.orig Tue Nov 9 14:22:16 2004 +++ src/check.h.in Fri Mar 11 22:08:46 2005 @@@@ -168,7 +168,7 @@@@ static void __testname (void)\ d18 1 a18 1 #define fail_if(expr, ...)\ d20 2 a21 2 - "Failure '"#expr"' occured", ## __VA_ARGS__, NULL) + "Failure '"#expr"' occured" , ## __VA_ARGS__, NULL) d24 5 a28 1 #define fail(...) _fail_unless(0, __FILE__, __LINE__, "Failed" , ## __VA_ARGS__, NULL) @