-include Makefile.inc
-VPATH=${top_srcdir}/src
+VPATH=${top_srcdir}/src:${top_srcdir}/test
AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
SUFFIXES = .T
+DEBUG:=-g -O0 -Wall
+
GLOBUSINC:= -I${globus_prefix}/include/${nothrflavour}
GLOBUSTHRINC:= -I${globus_prefix}/include/${thrflavour}
-DEBUG:=-g -O0
CFLAGS:=${DEBUG} \
-I${top_srcdir}/src -I${top_srcdir}/interface \
-I${stagedir}/include \
-I${glite_location}/include \
-I${expat_prefix}/include \
- -I${ares_prefix}/include
+ -I${ares_prefix}/include \
+ ${COVERAGE_FLAGS}
+
CXXFLAGS:=${CFLAGS}
ARES_LIBS:=-L${ares_prefix}/lib \
-lares
-LDFLAGS:=-L${stagedir}/lib
-
EXT_LIB:= ${EXPAT_LIBS} \
${ARES_LIBS}
+TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
+TEST_INC:=-I${cppunit_prefix}/include
+
+LDFLAGS:=-L${stagedir}/lib \
+ ${COVERAGE_FLAGS}
+
COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
CXXCOMPILE:=libtool --mode=compile ${CXX} ${CXXFLAGS}
LINK:=libtool --mode=link ${CC} ${LDFLAGS}
+LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
INSTALL:=libtool --mode=install install
LIBOBJS:=connection.o consumer.o notification.o prod_proto.o \
compile all: ${LIB} ${THRLIB} ${TOOLS} logevent ${PLUSLIB} ${THRPLUSLIB}
-check:
- echo No unit tests so far.
+check: check.producer
+
+check.producer: producer_test
+producer_test: producer_test.o prod_proto_test.o
+ ${LINKXX} -o $@ ${LIB} ${TEST_LIBS} $+
+
+producer_test.o: %.o: %.cpp
+ ${CXX} -c ${CXXFLAGS} ${TEST_INC} $<
+
stage: compile
$(MAKE) install PREFIX=${stagedir}
dist: distsrc distbin
Revision history:
$Log$
+ Revision 1.2 2004/07/06 20:47:11 flammer
+ Moved to configure.properties.xml
+
-->
nothrflavour=${with.globus.nothr.flavor}
expat_prefix=${with.expat.prefix}
ares_prefix=${with.ares.prefix}
+cppunit_prefix=${with.cppunit.prefix}
</echo>
</target>
</project>
--- /dev/null
+#define edg_wll_gss_read_full(a,b,c,d,e,f) test_edg_wll_gss_read_full(a,b,c,d,e,f)
+#define edg_wll_gss_write_full(a,b,c,d,e,f) test_edg_wll_gss_write_full(a,b,c,d,e,f)
+#define edg_wll_GssConnection int
+
+#include "prod_proto.h"
+#include "glite/lb/producer.h"
+#include "glite/lb/escape.h"
+#include "glite/lb/lb_gss.h"
+
+int
+test_edg_wll_gss_read_full(int *fd,
+ void *buf,
+ size_t bufsize,
+ struct timeval *timeout,
+ size_t *total,
+ edg_wll_GssStatus *code)
+{
+ return(0);
+}
+
+int
+test_edg_wll_gss_write_full(int *fd,
+ const void *buf,
+ size_t bufsize,
+ struct timeval *timeout,
+ size_t *total,
+ edg_wll_GssStatus *code)
+{
+ *total = write(*fd, buf, bufsize);
+ return(*total < 0 ? *total : 0);
+}
+
+#include "prod_proto.c"
--- /dev/null
+#include <iostream>
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <errno.h>
+#include <assert.h>
+#include <string.h>
+
+extern "C" {
+int edg_wll_log_proto_client(int *,char *,char *,int,int);
+}
+
+class ProducerTest: public CppUnit::TestFixture
+{
+ CPPUNIT_TEST_SUITE(ProducerTest);
+ CPPUNIT_TEST(testProtoClient);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+
+ void setUp() {
+ pipe(pd);
+ }
+
+ void tearDown() {
+ close(pd[0]);
+ close(pd[1]);
+ }
+
+ void testProtoClient() {
+ int ret=0;
+ CPPUNIT_ASSERT( ret == 0 );
+ }
+
+private:
+ int pd[2];
+
+ int log_proto_server(int con, char *logline) {
+ }
+};
+
+
+CPPUNIT_TEST_SUITE_REGISTRATION( ProducerTest );
+
+int
+main (int ac,const char *av[])
+{
+ CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
+ CppUnit::TextUi::TestRunner runner;
+
+ runner.addTest(suite);
+ return runner.run() ? 0 : 1;
+}