diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2004-07-29 08:23:55 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2004-07-29 08:23:55 +0000 |
| commit | fdd646ede29f996b65d987e1fc12e1794cb5c9d6 (patch) | |
| tree | 539696893f31e4245e1385dcfaf0747c839c53ba | |
| parent | 5efb84ca502a65258915b4213c12d5e23bc5d0ba (diff) | |
| download | lasso-fdd646ede29f996b65d987e1fc12e1794cb5c9d6.tar.gz lasso-fdd646ede29f996b65d987e1fc12e1794cb5c9d6.tar.xz lasso-fdd646ede29f996b65d987e1fc12e1794cb5c9d6.zip | |
had detection of a patched (with XML support) check; only use srunner_set_xml
if it is available.
| -rw-r--r-- | configure.ac | 4 | ||||
| -rw-r--r-- | tests/tests.c | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 31aafad3..c348d21a 100644 --- a/configure.ac +++ b/configure.ac @@ -217,8 +217,10 @@ AC_ARG_ENABLE(tests, no) tests_val=false;; esac], tests_val=true) +AC_DEFINE([CHECK_IS_XML], [], [Define if check available with XML support]) if $tests_val ; then - AM_PATH_CHECK(0.9.0) + AM_PATH_CHECK + AC_CHECK_LIB(check, srunner_set_xml, [AC_DEFINE(CHECK_IS_XML)]) fi AM_CONDITIONAL(WITH_TESTS, $tests_val) diff --git a/tests/tests.c b/tests/tests.c index d96cbde8..dbe9c840 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <string.h> +#include <config.h> #include <check.h> #include <lasso.h> @@ -61,14 +62,16 @@ main(int argc, char *argv[]) if (dont_fork) { srunner_set_fork_status(sr, CK_NOFORK); } +#ifdef CHECK_IS_XML srunner_set_xml(sr, "result.xml"); +#endif srunner_run_all (sr, CK_VERBOSE); rc = srunner_ntests_failed(sr); srunner_free(sr); - /*suite_free(s);*/ - - /*lasso_destroy();*/ + /*suite_free(s); */ + /* no longer available in check 0.9.0; it will leak a + * bit with previous versions */ return (rc == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } |
