aboutsummaryrefslogtreecommitdiff
path: root/src/makefile.mingw
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-04-26 11:20:44 -0400
committerGavin Andresen <gavinandresen@gmail.com>2012-04-26 11:20:44 -0400
commit9e71a5cd236e0b6639f55f2f6520aaa06eac0523 (patch)
treedd2cd93d14ce0df5798ab6d539eedc016e768d53 /src/makefile.mingw
parent08e663d7e2fa194efbffef41cffe9626b71acdaa (diff)
downloadbitcoin-9e71a5cd236e0b6639f55f2f6520aaa06eac0523.tar.xz
Define TEST_DATA_DIR so unit tests can be run from any current working directory
Diffstat (limited to 'src/makefile.mingw')
-rw-r--r--src/makefile.mingw16
1 files changed, 8 insertions, 8 deletions
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