Commit dceb401e authored by jehan's avatar jehan
Browse files

FIX CU_get_suite detection to take care of pkg-config

parent 6e3806a0
......@@ -123,14 +123,9 @@ if test "$found_cunit" = "no" ; then
found_cunit=yes
CUNIT_LIBS+=" -lcunit"
])
AC_CHECK_LIB(cunit,CU_get_suite,[
AC_DEFINE(HAVE_CU_GET_SUITE,1,[defined when CU_get_suite is available])
])
])
fi
case "$target_os" in
*darwin*)
#hack for macport
......@@ -138,12 +133,12 @@ case "$target_os" in
;;
esac
#AC_SUBST(CUNIT_CFLAGS)
#AC_SUBST(CUNIT_LIBS)
if test "$found_cunit" = "no" ; then
AC_MSG_WARN([Could not find cunit framework, tests are not compiled.])
else
AC_CHECK_LIB(cunit,CU_get_suite,[
AC_DEFINE(HAVE_CU_GET_SUITE,1,[defined when CU_get_suite is available])
],[foo=bar],[$CUNIT_LIBS])
fi
AM_CONDITIONAL(BUILD_TESTS,test x$found_cunit = xyes)
......
......@@ -78,13 +78,14 @@ int main (int argc, char *argv[]) {
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
if (suite_name){
#ifdef HAVE_CU_GET_SUITE
CU_pSuite suite;
suite=CU_get_suite(suite_name))) {
suite=CU_get_suite(suite_name);
CU_basic_run_suite(suite);
#else
fprintf(stderr,"Your CUnit version does not support suite selection.\n");
fprintf(stderr,"Your CUnit version does not support suite selection.\n");
#endif
} else
CU_basic_run_tests();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment