aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@gmail.com>2011-07-31 20:00:38 +0200
committerGavin Andresen <gavinandresen@gmail.com>2011-08-08 14:31:08 -0400
commite707d29dd601bbe691175b72686caeaea29b1cbc (patch)
tree81f0d487000519207776a75b9d679ee0f36aa41f
parent02962ba848d1f7d58fe0f12a783400fc15e7260b (diff)
Fix testing setup
There were some problems with the existing testing setup: - Makefile rules for test-file compilation used CFLAGS instead of CXXFLAGS in makefile.unix
-rw-r--r--src/makefile.linux-mingw2
-rw-r--r--src/makefile.mingw2
-rw-r--r--src/makefile.osx2
-rw-r--r--src/makefile.unix6
-rw-r--r--src/test/test_bitcoin.cpp10
-rw-r--r--src/test/uint160_tests.cpp2
-rw-r--r--src/test/uint256_tests.cpp2
7 files changed, 20 insertions, 6 deletions
diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw
index 59ff03c48d..e2ef4213aa 100644
--- a/src/makefile.linux-mingw
+++ b/src/makefile.linux-mingw
@@ -90,7 +90,7 @@ bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
obj/test/%.o: obj/test/%.cpp $(HEADERS)
i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
-test_bitcoin.exe: obj/test/test_bitcoin.o
+test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s
diff --git a/src/makefile.mingw b/src/makefile.mingw
index 16a0540094..96f81b3067 100644
--- a/src/makefile.mingw
+++ b/src/makefile.mingw
@@ -86,7 +86,7 @@ bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
obj/test/%.o: obj/test/%.cpp $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
-test_bitcoin: obj/test/test_bitcoin.o
+test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
clean:
diff --git a/src/makefile.osx b/src/makefile.osx
index 89788562c3..699911d4e6 100644
--- a/src/makefile.osx
+++ b/src/makefile.osx
@@ -79,7 +79,7 @@ bitcoind: $(OBJS:obj/%=obj/nogui/%)
obj/test/%.o: test/%.cpp $(HEADERS)
$(CXX) -c $(CFLAGS) -o $@ $<
-test_bitcoin: obj/test/test_bitcoin.o
+test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework
clean:
diff --git a/src/makefile.unix b/src/makefile.unix
index 0567f8b75e..ba9d0ca11d 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -78,10 +78,10 @@ bitcoind: $(OBJS:obj/%=obj/nogui/%)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
obj/test/%.o: test/%.cpp $(HEADERS)
- $(CXX) -c $(CFLAGS) -o $@ $<
+ $(CXX) -c $(CXXFLAGS) -o $@ $<
-test_bitcoin: obj/test/test_bitcoin.o
- $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework
+test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
+ $(CXX) $(CXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LIBS)
clean:
-rm -f bitcoin bitcoind test_bitcoin
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index 3b7d2d2f2c..3d7ee9084e 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -1,6 +1,16 @@
#define BOOST_TEST_MODULE uint160
#include <boost/test/unit_test.hpp>
+#include "../main.h"
+#include "../wallet.h"
+
#include "uint160_tests.cpp"
#include "uint256_tests.cpp"
+
+CWallet* pwalletMain;
+
+void Shutdown(void* parg)
+{
+ exit(0);
+}
diff --git a/src/test/uint160_tests.cpp b/src/test/uint160_tests.cpp
index 66ffd285b8..e85a9488e8 100644
--- a/src/test/uint160_tests.cpp
+++ b/src/test/uint160_tests.cpp
@@ -1,3 +1,5 @@
+#include <boost/test/unit_test.hpp>
+
#include "../uint256.h"
BOOST_AUTO_TEST_SUITE(uint160_tests)
diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp
index cbae9bf6d2..f13b34944c 100644
--- a/src/test/uint256_tests.cpp
+++ b/src/test/uint256_tests.cpp
@@ -1,3 +1,5 @@
+#include <boost/test/unit_test.hpp>
+
#include "../uint256.h"
BOOST_AUTO_TEST_SUITE(uint256_tests)