Rework unit tests so test_bitcoin.cpp does not #include them all

This commit is contained in:
Gavin Andresen
2011-10-11 19:50:06 -04:00
parent 7e55c1ab65
commit 1466b8b78a
12 changed files with 34 additions and 33 deletions

View File

@@ -10,6 +10,7 @@ CXX=llvm-g++
DEPSDIR=/opt/local
INCLUDEPATHS= \
-I"$(CURDIR)" \
-I"$(DEPSDIR)/include" \
-I"$(DEPSDIR)/include/db48"
@@ -112,6 +113,8 @@ obj/nogui/%.o: %.cpp
bitcoind: $(OBJS:obj/%=obj/nogui/%)
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
TESTOBJS := $(patsubst test/%.cpp,obj/test/%.o,$(wildcard test/*.cpp))
obj/test/%.o: test/%.cpp
$(CXX) -c $(CFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
@@ -119,7 +122,7 @@ obj/test/%.o: test/%.cpp
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
test_bitcoin: $(TESTOBJS) $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) $(DEPSDIR)/lib/libboost_unit_test_framework-mt.a
clean: