- some changes in the process of unittest creation
authorJiří Škrábal <nykolas@ics.muni.cz>
Wed, 22 Sep 2004 15:29:06 +0000 (15:29 +0000)
committerJiří Škrábal <nykolas@ics.muni.cz>
Wed, 22 Sep 2004 15:29:06 +0000 (15:29 +0000)
org.glite.lb.common/Makefile
org.glite.lb.common/interface/lb_gss.h
org.glite.lb.common/interface/xml_parse.h
org.glite.lb.common/test/il_int_test.cpp
org.glite.lb.common/test/test_gss.cpp

index dd168dd..ce7c6dc 100644 (file)
@@ -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:
index ae1dc93..af53f4c 100644 (file)
@@ -6,7 +6,7 @@
 #include <gssapi.h>
 
 #ifdef __cplusplus
-extern "C" { 
+extern "C" {
 #endif
 
 enum {
index 62624ee..f89e4de 100644 (file)
@@ -3,6 +3,9 @@
 
 #ident "$Header$"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #include "glite/lb/purge.h"
 #include "glite/lb/dump.h"
index 374f3a0..f00b4c6 100644 (file)
@@ -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() {
index 638c851..5080e81 100644 (file)
@@ -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);