unit test skeleton
authorDiane Trout <diane@caltech.edu>
Wed, 22 Feb 2006 00:12:57 +0000 (00:12 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 22 Feb 2006 00:12:57 +0000 (00:12 +0000)
Now we build a unit test binary, though currently there aren't any tests.

Makefile
test/module.mk [new file with mode: 0644]
test/test_flp.cpp [new file with mode: 0644]
test/test_main.cpp [new file with mode: 0644]
test/test_nway.cpp [new file with mode: 0644]

index 2d3dc3b7aac27c0c50c4731b786511d1f5d7cc4c..dd18cf51f77dc3b193bd44d09b82574430130c8c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,9 @@ OBJEXT := .o
 LIBEXT := .a
 
 CXXFLAGS :=  
-LDFLAGS := -lfltk
+LDFLAGS := 
+
+CURDIR := $(shell pwd)
 
 # each module will add to this, .os are derived from it
 TARGETLIBS := 
@@ -18,6 +20,7 @@ all: targets
 
 include alg/module.mk
 include gui/module.mk
+include test/module.mk
 include module.mk
 
 # process what the module.mks defined
@@ -38,6 +41,7 @@ targets: $(TARGETLIBS) $(TARGETBINS)
 include $(DEPS)
 
 clean:
-       -rm $(OBJ) $(DEPS)
+       -rm $(OBJ) $(DEPS) $(TARGETLIBS) $(TARGETBINS)
+       
 
 
diff --git a/test/module.mk b/test/module.mk
new file mode 100644 (file)
index 0000000..adefb34
--- /dev/null
@@ -0,0 +1,17 @@
+CURDIR := $(BASEDIR)test/
+
+SOURCES.cxx := test_main.cpp \
+               test_flp.cpp \
+               test_nway.cpp
+
+TESTSRC := $(addprefix $(CURDIR), $(SOURCES.cxx))
+
+SRC += $(TESTSRC)
+CXXFLAGS += -I$(CURDIR)
+
+TEST := $(BASEDIR)/test_mussa$(BINEXT) 
+TARGETBINS += $(TEST)
+
+$(TEST): $(TESTSRC:.cxx=$(OBJEXT))  $(MUSSA_ALG_LIB)
+       g++ $(CXXFLAGS) -lboost_unit_test_framework -o $@ $?
+
diff --git a/test/test_flp.cpp b/test/test_flp.cpp
new file mode 100644 (file)
index 0000000..a9a89a9
--- /dev/null
@@ -0,0 +1,8 @@
+#include <boost/test/auto_unit_test.hpp>
+
+#include "flp.hh"
+
+BOOST_AUTO_TEST_CASE( flp_test )
+{
+  FLPs flp;
+}
diff --git a/test/test_main.cpp b/test/test_main.cpp
new file mode 100644 (file)
index 0000000..39987f2
--- /dev/null
@@ -0,0 +1,3 @@
+#define BOOST_AUTO_TEST_MAIN
+#include <boost/test/auto_unit_test.hpp>
+
diff --git a/test/test_nway.cpp b/test/test_nway.cpp
new file mode 100644 (file)
index 0000000..efd7889
--- /dev/null
@@ -0,0 +1,5 @@
+#include <boost/test/auto_unit_test.hpp>
+
+BOOST_AUTO_TEST_CASE( nway_test )
+{
+}