From 9e71a5cd236e0b6639f55f2f6520aaa06eac0523 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 26 Apr 2012 11:20:44 -0400 Subject: Define TEST_DATA_DIR so unit tests can be run from any current working directory --- src/makefile.mingw | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/makefile.mingw') diff --git a/src/makefile.mingw b/src/makefile.mingw index 5584df5603..abcdcce675 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -27,6 +27,7 @@ DEFS=-DWIN32 -D_WINDOWS -DNOPCH -DBOOST_THREAD_USE_LIB DEBUGFLAGS=-g CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) +TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) ifdef USE_UPNP INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw" @@ -71,17 +72,16 @@ obj/%.o: %.cpp $(HEADERS) bitcoind.exe: $(OBJS:obj/%=obj/%) g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS) - g++ -c $(CFLAGS) -o $@ test/test_bitcoin.cpp +TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) -test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) - g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) +obj-test/%.o: test/%.cpp $(HEADERS) + g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $< + +test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) + g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS) clean: -del /Q bitcoind test_bitcoin -del /Q obj\* - -del /Q obj\nogui\* - -del /Q obj\test\* - -del /Q test\*.o - -del /Q headers.h.gch + -del /Q obj-test\* -del /Q build.h -- cgit v1.2.3