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.linux-mingw | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/makefile.linux-mingw') diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index 1ea65cd2e5..8e4e638176 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -31,6 +31,7 @@ DEFS=-D_MT -DWIN32 -D_WINDOWS -DNOPCH -DBOOST_THREAD_USE_LIB DEBUGFLAGS=-g CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) +TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) ifdef USE_UPNP LIBPATHS += -L"$(DEPSDIR)/miniupnpc" @@ -78,20 +79,19 @@ obj/%.o: %.cpp $(HEADERS) bitcoind.exe: $(OBJS:obj/%=obj/%) i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) +TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) -obj/test/%.o: obj/test/%.cpp $(HEADERS) - i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $< +obj-test/%.o: test/%.cpp $(HEADERS) + i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $< -test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) - i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s +test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) + i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS) clean: -rm -f obj/*.o - -rm -f obj/test/*.o - -rm -f test/*.o - -rm -f headers.h.gch -rm -f bitcoind.exe + -rm -f obj-test/*.o -rm -f test_bitcoin.exe -rm -f src/build.h -- cgit v1.2.3