From 22febe2bf594757ec52173cdb38a9ae7ecc7362a Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 11 Dec 2014 04:18:13 +0300 Subject: [PATCH 1/2] fix test_bitcoin -> test_darkcoin --- Makefile.am | 26 +++++++++++++------------- contrib/debian/rules | 4 ++-- contrib/devtools/README.md | 8 ++++---- doc/unit-tests.md | 2 +- qa/pull-tester/build-tests.sh.in | 4 ++-- src/test/README | 4 ++-- src/test/README.md | 4 ++-- src/test/test_darkcoin.cpp | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Makefile.am b/Makefile.am index c72db2c986041..a4c16d5a5cdb2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,9 +29,9 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ $(top_srcdir)/contrib/macdeploy/DS_Store COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \ - leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \ + leveldb_baseline.info test_darkcoin_filtered.info total_coverage.info \ baseline_filtered.info block_test_filtered.info \ - leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info + leveldb_baseline_filtered.info test_darkcoin_coverage.info test_darkcoin.info dist-hook: -$(MAKE) -C $(top_distdir)/src/leveldb clean @@ -119,16 +119,16 @@ leveldb_baseline_filtered.info: leveldb_baseline.info baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@ -test_bitcoin.info: baseline_filtered_combined.info +test_darkcoin.info: baseline_filtered_combined.info $(MAKE) -C src/ check - $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@ + $(LCOV) -c -d $(abs_builddir)/src -t test_darkcoin -o $@ $(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src/leveldb -test_bitcoin_filtered.info: test_bitcoin.info +test_darkcoin_filtered.info: test_darkcoin.info $(LCOV) -r $< "/usr/include/*" -o $@ -block_test.info: test_bitcoin_filtered.info +block_test.info: test_darkcoin_filtered.info $(MKDIR_P) qa/tmp -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0 $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@ @@ -138,13 +138,13 @@ block_test.info: test_bitcoin_filtered.info block_test_filtered.info: block_test.info $(LCOV) -r $< "/usr/include/*" -o $@ -test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info - $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@ +test_darkcoin_coverage.info: baseline_filtered_combined.info test_darkcoin_filtered.info + $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_darkcoin_filtered.info -o $@ -total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info - $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt +total_coverage.info: baseline_filtered_combined.info test_darkcoin_filtered.info block_test_filtered.info + $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_darkcoin_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt -test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info +test_darkcoin.coverage/.dirstamp: test_darkcoin_coverage.info $(GENHTML) -s $< -o $(@D) @touch $@ @@ -152,7 +152,7 @@ total.coverage/.dirstamp: total_coverage.info $(GENHTML) -s $< -o $(@D) @touch $@ -cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp +cov: test_darkcoin.coverage/.dirstamp total.coverage/.dirstamp endif @@ -169,4 +169,4 @@ CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) .INTERMEDIATE: $(COVERAGE_INFO) clean-local: - rm -rf test_bitcoin.coverage/ total.coverage/ $(OSX_APP) + rm -rf test_darkcoin.coverage/ total.coverage/ $(OSX_APP) diff --git a/contrib/debian/rules b/contrib/debian/rules index 52b357cf01a50..692d283323c7a 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -1,9 +1,9 @@ #!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- -#DEB_MAKE_CHECK_TARGET = test_bitcoin +#DEB_MAKE_CHECK_TARGET = test_darkcoin #build/bitcoind:: -# $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_bitcoin) +# $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_darkcoin) DEB_INSTALL_EXAMPLES_bitcoind += debian/examples/* DEB_INSTALL_MANPAGES_bitcoind += debian/manpages/* diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md index a57b4e561e618..e440a534c4d2b 100644 --- a/contrib/devtools/README.md +++ b/contrib/devtools/README.md @@ -64,10 +64,10 @@ If only supported symbols are used the return value will be 0 and the output wil If there are 'unsupported' symbols, the return value will be 1 a list like this will be printed: - .../64/test_bitcoin: symbol memcpy from unsupported version GLIBC_2.14 - .../64/test_bitcoin: symbol __fdelt_chk from unsupported version GLIBC_2.15 - .../64/test_bitcoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15 - .../64/test_bitcoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15 + .../64/test_darkcoin: symbol memcpy from unsupported version GLIBC_2.14 + .../64/test_darkcoin: symbol __fdelt_chk from unsupported version GLIBC_2.15 + .../64/test_darkcoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15 + .../64/test_darkcoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15 update-translations.py ======================= diff --git a/doc/unit-tests.md b/doc/unit-tests.md index f1d3a8bc50646..fe4104a18cb73 100644 --- a/doc/unit-tests.md +++ b/doc/unit-tests.md @@ -6,7 +6,7 @@ and tests weren't explicitly disabled. After configuring, they can be run with 'make check'. -To run the bitcoind tests manually, launch src/test/test_bitcoin . +To run the bitcoind tests manually, launch src/test/test_darkcoin . To add more bitcoind tests, add `BOOST_AUTO_TEST_CASE` functions to the existing .cpp files in the test/ directory or add new .cpp files that diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in index ebf377a489c20..23098f1194b99 100755 --- a/qa/pull-tester/build-tests.sh.in +++ b/qa/pull-tester/build-tests.sh.in @@ -59,11 +59,11 @@ if [ -d "$OUT_DIR" -a -w "$OUT_DIR" ]; then set +e # Windows: cp @abs_top_srcdir@/win32-build/src/bitcoind.exe $OUT_DIR/bitcoind.exe - cp @abs_top_srcdir@/win32-build/src/test/test_bitcoin.exe $OUT_DIR/test_bitcoin.exe + cp @abs_top_srcdir@/win32-build/src/test/test_darkcoin.exe $OUT_DIR/test_darkcoin.exe cp @abs_top_srcdir@/win32-build/src/qt/bitcoind-qt.exe $OUT_DIR/bitcoin-qt.exe # Linux: cp @abs_top_srcdir@/linux-build/src/bitcoind $OUT_DIR/bitcoind - cp @abs_top_srcdir@/linux-build/src/test/test_bitcoin $OUT_DIR/test_bitcoin + cp @abs_top_srcdir@/linux-build/src/test/test_darkcoin $OUT_DIR/test_darkcoin cp @abs_top_srcdir@/linux-build/src/qt/bitcoind-qt $OUT_DIR/bitcoin-qt set -e fi diff --git a/src/test/README b/src/test/README index 77f7faa815232..4f89aaa680a98 100644 --- a/src/test/README +++ b/src/test/README @@ -4,9 +4,9 @@ sense to simply use this framework rather than require developers to configure some other framework (we want as few impediments to creating unit tests as possible). -The build system is setup to compile an executable called "test_bitcoin" +The build system is setup to compile an executable called "test_darkcoin" that runs all of the unit tests. The main source file is called -test_bitcoin.cpp, which simply includes other files that contain the +test_darkcoin.cpp, which simply includes other files that contain the actual unit tests (outside of a couple required preprocessor directives). The pattern is to create one test file for each class or source file for which you want to create unit tests. The file naming diff --git a/src/test/README.md b/src/test/README.md index 7efce6f0522f2..894a54144f607 100644 --- a/src/test/README.md +++ b/src/test/README.md @@ -5,9 +5,9 @@ sense to simply use this framework rather than require developers to configure some other framework (we want as few impediments to creating unit tests as possible). -The build system is setup to compile an executable called "test_bitcoin" +The build system is setup to compile an executable called "test_darkcoin" that runs all of the unit tests. The main source file is called -test_bitcoin.cpp, which simply includes other files that contain the +test_darkcoin.cpp, which simply includes other files that contain the actual unit tests (outside of a couple required preprocessor directives). The pattern is to create one test file for each class or source file for which you want to create unit tests. The file naming diff --git a/src/test/test_darkcoin.cpp b/src/test/test_darkcoin.cpp index a0137aac9fe50..7c30bfa360844 100644 --- a/src/test/test_darkcoin.cpp +++ b/src/test/test_darkcoin.cpp @@ -36,7 +36,7 @@ struct TestingSetup { #ifdef ENABLE_WALLET bitdb.MakeMock(); #endif - pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); + pathTemp = GetTempPath() / strprintf("test_darkcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); boost::filesystem::create_directories(pathTemp); mapArgs["-datadir"] = pathTemp.string(); pblocktree = new CBlockTreeDB(1 << 20, true); From b9dbcb45e9c7409f5b015311ad9f26baf7b9caf0 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 11 Dec 2014 04:48:23 +0300 Subject: [PATCH 2/2] fix test_bitcoin -> test_darkcoin - remove test_bitcoin.cpp --- src/test/test_bitcoin.cpp | 65 --------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 src/test/test_bitcoin.cpp diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp deleted file mode 100644 index 8ae77eac53d69..0000000000000 --- a/src/test/test_bitcoin.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#define BOOST_TEST_MODULE DarkCoin Test Suite -#include -#include - -#include "db.h" -#include "txdb.h" -#include "main.h" -#include "wallet.h" -#include "util.h" - -CClientUIInterface uiInterface; - -extern bool fPrintToConsole; -extern void noui_connect(); - -struct TestingSetup { - CCoinsViewDB *pcoinsdbview; - boost::filesystem::path pathTemp; - boost::thread_group threadGroup; - - TestingSetup() { - fPrintToDebugger = true; // don't want to write to debug.log file - noui_connect(); - bitdb.MakeMock(); - pathTemp = GetTempPath() / strprintf("test_darkcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); - boost::filesystem::create_directories(pathTemp); - mapArgs["-datadir"] = pathTemp.string(); - pblocktree = new CBlockTreeDB(1 << 20, true); - pcoinsdbview = new CCoinsViewDB(1 << 23, true); - pcoinsTip = new CCoinsViewCache(*pcoinsdbview); - InitBlockIndex(); - bool fFirstRun; - pwalletMain = new CWallet("wallet.dat"); - pwalletMain->LoadWallet(fFirstRun); - RegisterWallet(pwalletMain); - nScriptCheckThreads = 3; - for (int i=0; i < nScriptCheckThreads-1; i++) - threadGroup.create_thread(&ThreadScriptCheck); - } - ~TestingSetup() - { - threadGroup.interrupt_all(); - threadGroup.join_all(); - delete pwalletMain; - pwalletMain = NULL; - delete pcoinsTip; - delete pcoinsdbview; - delete pblocktree; - bitdb.Flush(true); - boost::filesystem::remove_all(pathTemp); - } -}; - -BOOST_GLOBAL_FIXTURE(TestingSetup); - -void Shutdown(void* parg) -{ - exit(0); -} - -void StartShutdown() -{ - exit(0); -} -