Commit 3ce3139b authored by Simon Morlat's avatar Simon Morlat

fix build for ubuntu

parent 8db2b21f
......@@ -119,9 +119,15 @@ PKG_CHECK_MODULES(CUNIT, cunit, [found_cunit=yes],[found_cunit=no])
if test "$found_cunit" = "no" ; then
AC_CHECK_HEADERS(CUnit/CUnit.h,
[
found_cunit=yes
CUNIT_LIBS="-lcunit"
AC_CHECK_LIB(cunit,CU_add_suite,[
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
......
......@@ -15,6 +15,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include "CUnit/Basic.h"
#include <belle-sip/belle-sip.h>
......@@ -32,7 +36,6 @@ extern int belle_sip_dialog_test_suite();
int main (int argc, char *argv[]) {
int i;
char *suite_name;
CU_pSuite suite;
const char *env_domain=getenv("TEST_DOMAIN");
if (env_domain)
test_domain=env_domain;
......@@ -74,8 +77,15 @@ int main (int argc, char *argv[]) {
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
if (suite_name && (suite=CU_get_suite(suite_name))) {
if (suite_name){
#ifdef HAVE_CU_GET_SUITE
CU_pSuite suite;
suite=CU_get_suite(suite_name))) {
CU_basic_run_suite(suite);
#else
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