diff --git a/configure.ac b/configure.ac index 2cf308b87..092b41129 100644 --- a/configure.ac +++ b/configure.ac @@ -863,6 +863,10 @@ AM_CONDITIONAL([BUILD_CUNIT_TESTS], [test x$found_cunit = xyes && test x$tests_e 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]) + AC_CHECK_LIB(cunit,CU_curses_run_tests,[ AC_DEFINE(HAVE_CU_CURSES,1,[defined when CU_curses_run_tests is available]) ],[foo=bar],[$CUNIT_LIBS]) diff --git a/tester/tester.c b/tester/tester.c index 268a0f302..475d2c90f 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -387,6 +387,11 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name) run_test_suite(test_suite[i]); } +#if !HAVE_CU_GET_SUITE + if( suite_name ){ + ms_warning("Tester compiled without CU_get_suite() function, running all tests instead of suite '%s'\n", suite_name); + } +#else if (suite_name){ CU_pSuite suite; CU_basic_set_mode(CU_BRM_VERBOSE); @@ -409,7 +414,9 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name) } else { CU_basic_run_suite(suite); } - } else + } + else +#endif { #if HAVE_CU_CURSES if (curses) {