From: Jiří Škrábal Date: Wed, 22 Sep 2004 15:29:06 +0000 (+0000) Subject: - some changes in the process of unittest creation X-Git-Tag: glite-lb-common_R_0_2_0~238 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=25c20602b2022f2518e08411c05e4bd9cfc67681;p=jra1mw.git - some changes in the process of unittest creation --- diff --git a/org.glite.lb.common/Makefile b/org.glite.lb.common/Makefile index dd168dd..ce7c6dc 100644 --- a/org.glite.lb.common/Makefile +++ b/org.glite.lb.common/Makefile @@ -18,6 +18,7 @@ expat_prefix=/opt/expat ares_prefix=/opt/ares -include Makefile.inc +-include ../Makefile.inc VPATH=${top_srcdir}/src:${top_srcdir}/test AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3 @@ -104,11 +105,14 @@ ${THRLTLIB}: ${THROBJS} stage: compile $(MAKE) install PREFIX=${stagedir} -check: check.parse check.gss check.il +check: compile check.parse check.gss check.il -check.parse: parse.cpp +check.parse: test_parse + ./test_parse + +test_parse: parse.cpp ${CXX} -c ${CFLAGS} ${TEST_INC} $< - ${LINKXX} -o $@ parse.o ${LTLIB} ${TEST_LIBS} + ${LINKXX} -o test_parse parse.o ${LTLIB} ${TEST_LIBS} check.gss: test_gss # ./test_gss @@ -120,9 +124,14 @@ check.il: il_test test_gss: test_gss.o ${LINKXX} -o $@ test_gss.o ${LTLIB} ${TEST_LIBS} -il_test: il_test.o il_int_test.o il_string_test.o il_string.o il_int.o +il_test: il_test.o il_int_test.o il_string_test.o ${LINKXX} -o $@ ${LTLIB} ${TEST_LIBS} $+ +test_coverage: + -mkdir coverage + cd coverage && $(MAKE) -f ../Makefile top_srcdir=../../ COVERAGE_FLAGS="-fprofile-arcs -ftest-coverage" check + cd coverage && for i in ${OBJS}; do gcov -o .libs/ $$i ; done + dist: distsrc distbin distsrc: diff --git a/org.glite.lb.common/interface/lb_gss.h b/org.glite.lb.common/interface/lb_gss.h index ae1dc93..af53f4c 100644 --- a/org.glite.lb.common/interface/lb_gss.h +++ b/org.glite.lb.common/interface/lb_gss.h @@ -6,7 +6,7 @@ #include #ifdef __cplusplus -extern "C" { +extern "C" { #endif enum { diff --git a/org.glite.lb.common/interface/xml_parse.h b/org.glite.lb.common/interface/xml_parse.h index 62624ee..f89e4de 100644 --- a/org.glite.lb.common/interface/xml_parse.h +++ b/org.glite.lb.common/interface/xml_parse.h @@ -3,6 +3,9 @@ #ident "$Header$" +#ifdef __cplusplus +extern "C" { +#endif #include "glite/lb/purge.h" #include "glite/lb/dump.h" diff --git a/org.glite.lb.common/test/il_int_test.cpp b/org.glite.lb.common/test/il_int_test.cpp index 374f3a0..f00b4c6 100644 --- a/org.glite.lb.common/test/il_int_test.cpp +++ b/org.glite.lb.common/test/il_int_test.cpp @@ -29,6 +29,7 @@ public: int d; get_int("17\n", &d); CPPUNIT_ASSERT(d == 17); + CPPUNIT_ASSERT(get_int("17 \n", &d) == NULL); } void testLenInt() { diff --git a/org.glite.lb.common/test/test_gss.cpp b/org.glite.lb.common/test/test_gss.cpp index 638c851..5080e81 100644 --- a/org.glite.lb.common/test/test_gss.cpp +++ b/org.glite.lb.common/test/test_gss.cpp @@ -61,12 +61,13 @@ void GSSTest::setUp(void) { edg_wll_GssStatus stat; struct sockaddr_in a; socklen_t alen = sizeof(a); - char * cred_file = getenv("X509_USER_PROXY"); + char * cred_file = NULL; timeout.tv_sec = 10; timeout.tv_usec = 0; - CPPUNIT_ASSERT(cred_file); + cred_file = getenv("X509_USER_PROXY"); + CPPUNIT_ASSERT_MESSAGE("credential file", cred_file); if (edg_wll_gss_acquire_cred_gsi(cred_file, &my_cred, &my_subject, &stat)) CPPUNIT_ASSERT_MESSAGE("gss_acquire_cred", 0);