Commit bfc86a4a authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI
Browse files

Check for CU_get_suite presence in the configure script and disable per-suite...

Check for CU_get_suite presence in the configure script and disable per-suite tester when not present.
parent e28bd61d
...@@ -863,6 +863,10 @@ AM_CONDITIONAL([BUILD_CUNIT_TESTS], [test x$found_cunit = xyes && test x$tests_e ...@@ -863,6 +863,10 @@ AM_CONDITIONAL([BUILD_CUNIT_TESTS], [test x$found_cunit = xyes && test x$tests_e
if test "$found_cunit" = "no" ; then if test "$found_cunit" = "no" ; then
AC_MSG_WARN([Could not find cunit framework, tests are not compiled.]) AC_MSG_WARN([Could not find cunit framework, tests are not compiled.])
else 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_CHECK_LIB(cunit,CU_curses_run_tests,[
AC_DEFINE(HAVE_CU_CURSES,1,[defined when CU_curses_run_tests is available]) AC_DEFINE(HAVE_CU_CURSES,1,[defined when CU_curses_run_tests is available])
],[foo=bar],[$CUNIT_LIBS]) ],[foo=bar],[$CUNIT_LIBS])
......
...@@ -387,6 +387,11 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name) ...@@ -387,6 +387,11 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name)
run_test_suite(test_suite[i]); 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){ if (suite_name){
CU_pSuite suite; CU_pSuite suite;
CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_set_mode(CU_BRM_VERBOSE);
...@@ -409,7 +414,9 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name) ...@@ -409,7 +414,9 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name)
} else { } else {
CU_basic_run_suite(suite); CU_basic_run_suite(suite);
} }
} else }
else
#endif
{ {
#if HAVE_CU_CURSES #if HAVE_CU_CURSES
if (curses) { if (curses) {
......
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