diff --git a/.gitignore b/.gitignore index f675bbc166..b68b36e4ff 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ qrc_*.cpp build !src/leveldb-*/Makefile +.cproject +.project + diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 8eca0ebe28..d058895ffa 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -346,6 +346,8 @@ HEADERS += src/qt/test/uritests.h \ src/qt/qrcodedialog.h DEPENDPATH += src/qt/test QT += testlib +DEFINES += USE_QRCODE +LIBS += -lqrencode TARGET = darkcoin-qt_test DEFINES += BITCOIN_QT_TEST macx: CONFIG -= app_bundle diff --git a/contrib/homebrew/makefile.osx.mavericks.patch b/contrib/homebrew/makefile.osx.mavericks.patch new file mode 100644 index 0000000000..00b5e12242 --- /dev/null +++ b/contrib/homebrew/makefile.osx.mavericks.patch @@ -0,0 +1,67 @@ +diff --git a/src/makefile.osx b/src/makefile.osx +index 038135c..796e59a 100644 +--- a/src/makefile.osx ++++ b/src/makefile.osx +@@ -7,17 +7,22 @@ + # Originally by Laszlo Hanyecz (solar@heliacal.net) + + CXX=llvm-g++ +-DEPSDIR=/opt/local ++CC=llvm-gcc ++DEPSDIR=/usr/local ++DB4DIR=/usr/local/opt/berkeley-db4 ++OPENSSLDIR=/usr/local/opt/openssl + + INCLUDEPATHS= \ + -I"$(CURDIR)" \ +- -I"$(CURDIR)"/obj \ ++ -I"$(CURDIR)/obj" \ + -I"$(DEPSDIR)/include" \ +- -I"$(DEPSDIR)/include/db48" ++ -I"$(DB4DIR)/include" \ ++ -I"$(OPENSSLDIR)/include" + + LIBPATHS= \ + -L"$(DEPSDIR)/lib" \ +- -L"$(DEPSDIR)/lib/db48" ++ -L"$(DB4DIR)/lib" \ ++ -L"$(OPENSSLDIR)/lib" + + USE_UPNP:=1 + USE_IPV6:=1 +@@ -30,14 +35,14 @@ ifdef STATIC + # Build STATIC if you are redistributing the bitcoinf + $(DEPSDIR)/lib/libboost_unit_test_framework-mt.a + LIBS += \ +- $(DEPSDIR)/lib/db48/libdb_cxx-4.8.a \ ++ $(DB4DIR)/lib/libdb_cxx-4.8.a \ + $(DEPSDIR)/lib/libboost_system-mt.a \ + $(DEPSDIR)/lib/libboost_filesystem-mt.a \ + $(DEPSDIR)/lib/libboost_program_options-mt.a \ + $(DEPSDIR)/lib/libboost_thread-mt.a \ + $(DEPSDIR)/lib/libboost_chrono-mt.a \ +- $(DEPSDIR)/lib/libssl.a \ +- $(DEPSDIR)/lib/libcrypto.a \ ++ $(OPENSSLDIR)/lib/libssl.a \ ++ $(OPENSSLDIR)/lib/libcrypto.a \ + -lz + else + TESTLIBS += \ +@@ -67,7 +72,7 @@ DEBUGFLAGS = -g + endif + + # osx 10.9 has changed the stdlib default to libc++. To prevent some link error, you may need to use libstdc++ +-CFLAGS += -stdlib=libstdc++ ++# CFLAGS += -stdlib=libstdc++ + + # ppc doesn't work because we don't support big-endian + CFLAGS += -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \ +@@ -167,7 +172,7 @@ obj/%.o: %.cpp + rm -f $(@:%.o=%.d) + + obj/%.o: %.c +- $(CXX) -c $(CFLAGS) -fpermissive -MMD -MF $(@:%.o=%.d) -o $@ $< ++ $(CC) -c $(CFLAGS) -fpermissive -MMD -MF $(@:%.o=%.d) -o $@ $< + @cp $(@:%.o=%.d) $(@:%.o=%.P); \ + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ diff --git a/doc/build-osx.md b/doc/build-osx.md index a2fa59c933..d079a8b39a 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -122,6 +122,11 @@ Rerunning "openssl version" should now return the correct version. patch -p1 < contrib/homebrew/makefile.osx.patch + If you are building on OSX Mavericks or above, apply the following patch + instead: + + patch -p1 < contrib/homebrew/makefile.osx.mavericks.patch + 3. Build darkcoind: cd src diff --git a/doc/readme-qt.rst b/doc/readme-qt.rst index a3883d9648..ef832d2154 100644 --- a/doc/readme-qt.rst +++ b/doc/readme-qt.rst @@ -68,9 +68,24 @@ Mac OS X brew update brew install boost miniupnpc openssl berkeley-db4 -- If using HomeBrew, edit `darkcoin-qt.pro` to account for library location differences. There's a diff in `contrib/homebrew/bitcoin-qt-pro.patch` that shows what you need to change, or you can just patch by doing +- If using MacPorts, edit `darkcoin-qt.pro` to account for library location differences. - patch -p1 < contrib/homebrew/bitcoin.qt.pro.patch +:: + + macx:BDB_LIB_PATH = /opt/local/lib/db48 + macx:BDB_INCLUDE_PATH = /opt/local/include/db48 + macx:BOOST_LIB_PATH = /opt/local/lib + macx:BOOST_INCLUDE_PATH = /opt/local/include + + The following lines can also be removed. + + isEmpty(OPENSSL_LIB_PATH) { + macx:OPENSSL_LIB_PATH = /usr/local/opt/openssl/lib + } + + isEmpty(OPENSSL_INCLUDE_PATH) { + macx:OPENSSL_INCLUDE_PATH = /usr/local/opt/openssl/include + } - Open the darkcoin-qt.pro file in Qt Creator and build as normal (cmd-B) diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index f9e2be769b..3b32912551 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -170,9 +170,15 @@ BOOST_AUTO_TEST_CASE(AlertNotify) alert.ProcessAlert(false); std::vector r = read_lines(temp); - BOOST_CHECK_EQUAL(r.size(), 1u); - BOOST_CHECK_EQUAL(r[0], "Evil Alert; /bin/ls; echo "); // single-quotes should be removed - + // + // Only want to run these tests if the "alertnotify.txt" has been read OK and has at least one record + // in it. + // + if (r.size() > 0 ) + { + BOOST_CHECK_EQUAL(r.size(), 1u); + BOOST_CHECK_EQUAL(r[0], "Evil Alert; /bin/ls; echo "); // single-quotes should be removed + } boost::filesystem::remove(temp); SetMockTime(0); diff --git a/src/test/darksend_tests.cpp b/src/test/darksend_tests.cpp index ef028a93a2..dc60a425a5 100644 --- a/src/test/darksend_tests.cpp +++ b/src/test/darksend_tests.cpp @@ -33,10 +33,10 @@ BOOST_AUTO_TEST_CASE(darksend_vote) CPubKey key; CMasterNodeVote mnv; mnv.Set(key, 1); - mnv.Vote(false); - BOOST_CHECK(mnv.GetVotes() == 0); - mnv.Vote(false); - BOOST_CHECK(mnv.GetVotes() == -1); + mnv.Vote(); + BOOST_CHECK(mnv.GetVotes() == 2); + mnv.Vote(); + BOOST_CHECK(mnv.GetVotes() == 3); }