Skip to content

Commit

Permalink
Merge pull request #1938 from vogel/disable-tests
Browse files Browse the repository at this point in the history
Disable tests

Reviewed-by: graydon
  • Loading branch information
latobarita authored Mar 6, 2019
2 parents 8d180be + 43bd5ec commit b8077bf
Show file tree
Hide file tree
Showing 86 changed files with 400 additions and 340 deletions.
138 changes: 69 additions & 69 deletions Builds/VisualStudio/stellar-core.vcxproj.filters

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ AM_CPPFLAGS += -isystem "$(top_srcdir)/lib" \
if USE_POSTGRES
AM_CPPFLAGS += -DUSE_POSTGRES=1 $(libpq_CFLAGS)
endif # USE_POSTGRES
if BUILD_TESTS
AM_CPPFLAGS += -DBUILD_TESTS=1
endif # BUILD_TESTS
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ if test x"$enable_postgres" != xno; then
fi
AM_CONDITIONAL(USE_POSTGRES, [test -n "$have_postgres"])

AC_ARG_ENABLE(tests,
AS_HELP_STRING([--disable-tests],
[Disable building test suite]))
AM_CONDITIONAL(BUILD_TESTS, [test x$enable_tests != xno])

# Need this to pass through ccache for xdrpp, libsodium
esc() {
out=
Expand Down
8 changes: 5 additions & 3 deletions make-mks
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ message="# This file was generated by make-mks; don't edit it by hand."
# must run "git add -N foo.cpp" before running this script.
(cd src
echo "$message"
echo "SRC_H_FILES" = $(git ls-files '*.h' '*.[ih]pp')
echo "SRC_CXX_FILES" = $(git ls-files '*.cpp')
echo "SRC_X_FILES" = $(git ls-files '*.x')
echo "SRC_H_FILES" = $(git ls-files '*.h' '*.[ih]pp' | tr " " "\n" | sort | uniq | egrep -v '(test|simulation)/' | tr "\n" " ")
echo "SRC_CXX_FILES" = $(git ls-files '*.cpp' | tr " " "\n" | sort | uniq | egrep -v '(test|simulation)/' | tr "\n" " ")
echo "SRC_X_FILES" = $(git ls-files '*.x' | tr " " "\n" | sort | uniq | tr "\n" " ")
echo "SRC_TEST_H_FILES" = $(git ls-files '*.h' '*.[ih]pp' | tr " " "\n" | egrep '(test|simulation)/' | tr "\n" " ")
echo "SRC_TEST_CXX_FILES" = $(git ls-files '*.cpp' | tr " " "\n" | sort | uniq | egrep '(test|simulation)/' | tr "\n" " ")
) > src/src.mk


Expand Down
7 changes: 6 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ include $(srcdir)/src.mk

noinst_HEADERS = $(SRC_H_FILES)

if BUILD_TESTS
stellar_core_SOURCES = main/StellarCoreVersion.cpp $(SRC_CXX_FILES) $(SRC_TEST_CXX_FILES)
else # !BUILD_TESTS
stellar_core_SOURCES = main/StellarCoreVersion.cpp $(SRC_CXX_FILES)
endif # !BUILD_TESTS

stellar_core_LDADD = $(soci_LIBS) $(libmedida_LIBS) \
$(top_builddir)/lib/lib3rdparty.a $(sqlite3_LIBS) \
$(libpq_LIBS) $(xdrpp_LIBS) $(libsodium_LIBS)
Expand Down Expand Up @@ -54,7 +59,7 @@ endif # !USE_POSTGRES

if USE_CLANG_FORMAT
format: always
cd $(srcdir) && $(CLANG_FORMAT) -style=file -i $(SRC_CXX_FILES) $(SRC_H_FILES)
cd $(srcdir) && $(CLANG_FORMAT) -style=file -i $(SRC_CXX_FILES) $(SRC_H_FILES) $(SRC_TEST_CXX_FILES) $(SRC_TEST_H_FILES)
endif # USE_CLANG_FORMAT

if USE_AFL_FUZZ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include "database/Database.h"
#include "herder/LedgerCloseData.h"
#include "ledger/LedgerManager.h"
#include "ledger/LedgerTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "medida/meter.h"
Expand Down
1 change: 0 additions & 1 deletion src/catchup/CatchupWork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "historywork/VerifyBucketWork.h"
#include "ledger/LedgerManager.h"
#include "main/Application.h"
#include "test/TestPrinter.h"
#include "util/Logging.h"
#include <lib/util/format.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "catchup/CatchupWorkTests.h"
#include "catchup/test/CatchupWorkTests.h"
#include "catchup/CatchupConfiguration.h"
#include "catchup/CatchupWork.h"
#include "ledger/CheckpointRange.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "herder/LedgerCloseData.h"
#include "herder/Upgrades.h"
#include "history/HistoryArchiveManager.h"
#include "history/HistoryTestsUtils.h"
#include "history/test/HistoryTestsUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/LedgerTxnEntry.h"
#include "ledger/LedgerTxnHeader.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "FileTransferInfo.h"
#include "bucket/BucketManager.h"
#include "catchup/CatchupWorkTests.h"
#include "catchup/test/CatchupWorkTests.h"
#include "history/FileTransferInfo.h"
#include "history/HistoryArchiveManager.h"
#include "history/HistoryManager.h"
#include "history/HistoryTestsUtils.h"
#include "history/test/HistoryTestsUtils.h"
#include "historywork/GetHistoryArchiveStateWork.h"
#include "historywork/GunzipFileWork.h"
#include "historywork/GzipFileWork.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "history/HistoryTestsUtils.h"
#include "FileTransferInfo.h"
#include "history/test/HistoryTestsUtils.h"
#include "bucket/BucketManager.h"
#include "crypto/Hex.h"
#include "crypto/Random.h"
#include "herder/TxSetFrame.h"
#include "history/FileTransferInfo.h"
#include "history/HistoryArchiveManager.h"
#include "ledger/CheckpointRange.h"
#include "ledger/LedgerRange.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "FileTransferInfo.h"
#include "bucket/BucketList.h"
#include "catchup/VerifyLedgerChainWork.h"
#include "crypto/Hex.h"
#include "herder/LedgerCloseData.h"
#include "history/FileTransferInfo.h"
#include "history/HistoryArchive.h"
#include "historywork/GzipFileWork.h"
#include "historywork/MakeRemoteDirWork.h"
#include "historywork/PutRemoteFileWork.h"
#include "ledger/LedgerRange.h"
#include "ledger/LedgerTestUtils.h"
#include "ledger/test/LedgerTestUtils.h"
#include "main/Application.h"
#include "main/Config.h"
#include "util/Timer.h"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include "invariant/AccountSubEntriesCountIsValid.h"
#include "invariant/InvariantDoesNotHold.h"
#include "invariant/InvariantManager.h"
#include "invariant/InvariantTestUtils.h"
#include "ledger/LedgerTestUtils.h"
#include "invariant/test/InvariantTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "test/TestUtils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include "bucket/BucketOutputIterator.h"
#include "catchup/ApplyBucketsWork.h"
#include "ledger/LedgerHashUtils.h"
#include "ledger/LedgerTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/LedgerTxnEntry.h"
#include "ledger/LedgerTxnHeader.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "test/TestUtils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "invariant/ConservationOfLumens.h"
#include "invariant/InvariantDoesNotHold.h"
#include "invariant/InvariantManager.h"
#include "invariant/InvariantTestUtils.h"
#include "invariant/test/InvariantTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/LedgerTxnHeader.h"
#include "lib/catch.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "invariant/InvariantTestUtils.h"
#include "invariant/test/InvariantTestUtils.h"
#include "invariant/InvariantDoesNotHold.h"
#include "invariant/InvariantManager.h"
#include "ledger/LedgerManager.h"
#include "ledger/LedgerTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/LedgerTxnEntry.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "transactions/TransactionUtils.h"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "invariant/Invariant.h"
#include "invariant/InvariantDoesNotHold.h"
#include "invariant/InvariantManager.h"
#include "ledger/LedgerTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "test/TestUtils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

#include "invariant/InvariantDoesNotHold.h"
#include "invariant/InvariantManager.h"
#include "invariant/InvariantTestUtils.h"
#include "invariant/LiabilitiesMatchOffers.h"
#include "ledger/LedgerTestUtils.h"
#include "invariant/test/InvariantTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/LedgerTxnHeader.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "test/TestUtils.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "ledger/LedgerTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/LedgerTxnEntry.h"
#include "ledger/LedgerTxnHeader.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "test/TestUtils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "ledger/LedgerTestUtils.h"
#include "ledger/LedgerTxn.h"
#include "ledger/LedgerTxnEntry.h"
#include "ledger/LedgerTxnHeader.h"
#include "ledger/test/LedgerTestUtils.h"
#include "lib/catch.hpp"
#include "main/Application.h"
#include "test/TestUtils.h"
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion src/main/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ class InvariantManager;
class OverlayManager;
class Database;
class PersistentState;
class LoadGenerator;
class CommandHandler;
class WorkManager;
class BanManager;
class StatusManager;
class LedgerTxnRoot;

#ifdef BUILD_TESTS
class LoadGenerator;
#endif

class Application;
void validateNetworkPassphrase(std::shared_ptr<Application> app);

Expand Down Expand Up @@ -241,6 +244,7 @@ class Application
// true. Otherwise return false. This method exists only for testing.
virtual bool manualClose() = 0;

#ifdef BUILD_TESTS
// If config.ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING=true, generate some load
// against the current application.
virtual void generateLoad(bool isCreate, uint32_t nAccounts,
Expand All @@ -249,6 +253,7 @@ class Application

// Access the load generator for manual operation.
virtual LoadGenerator& getLoadGenerator() = 0;
#endif

// Execute any administrative commands written in the Config.COMMANDS
// variable of the config file. This permits scripting certain actions to
Expand Down
11 changes: 8 additions & 3 deletions src/main/ApplicationImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@
#include "process/ProcessManager.h"
#include "scp/LocalNode.h"
#include "scp/QuorumSetUtils.h"
#include "simulation/LoadGenerator.h"
#include "util/GlobalChecks.h"
#include "util/LogSlowExecution.h"
#include "util/Logging.h"
#include "util/StatusManager.h"
#include "util/TmpDir.h"
#include "work/WorkManager.h"

#include "util/Logging.h"
#include "util/TmpDir.h"
#ifdef BUILD_TESTS
#include "simulation/LoadGenerator.h"
#endif

#include <set>
#include <string>
#include <util/format.h>

static const int SHUTDOWN_DELAY_SECONDS = 1;

Expand Down Expand Up @@ -466,6 +469,7 @@ ApplicationImpl::manualClose()
return false;
}

#ifdef BUILD_TESTS
void
ApplicationImpl::generateLoad(bool isCreate, uint32_t nAccounts,
uint32_t offset, uint32_t nTxs, uint32_t txRate,
Expand All @@ -485,6 +489,7 @@ ApplicationImpl::getLoadGenerator()
}
return *mLoadGenerator;
}
#endif

void
ApplicationImpl::applyCfgCommands()
Expand Down
8 changes: 6 additions & 2 deletions src/main/ApplicationImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class HistoryManager;
class ProcessManager;
class CommandHandler;
class Database;
class LoadGenerator;
class LedgerTxnRoot;

class ApplicationImpl : public Application
Expand Down Expand Up @@ -96,11 +95,13 @@ class ApplicationImpl : public Application

virtual bool manualClose() override;

#ifdef BUILD_TESTS
virtual void generateLoad(bool isCreate, uint32_t nAccounts,
uint32_t offset, uint32_t nTxs, uint32_t txRate,
uint32_t batchSize, bool autoRate) override;

virtual LoadGenerator& getLoadGenerator() override;
#endif

virtual void applyCfgCommands() override;

Expand Down Expand Up @@ -150,11 +151,14 @@ class ApplicationImpl : public Application
std::unique_ptr<CommandHandler> mCommandHandler;
std::shared_ptr<WorkManager> mWorkManager;
std::unique_ptr<PersistentState> mPersistentState;
std::unique_ptr<LoadGenerator> mLoadGenerator;
std::unique_ptr<BanManager> mBanManager;
std::unique_ptr<StatusManager> mStatusManager;
std::unique_ptr<LedgerTxnRoot> mLedgerTxnRoot;

#ifdef BUILD_TESTS
std::unique_ptr<LoadGenerator> mLoadGenerator;
#endif

std::vector<std::thread> mWorkerThreads;

asio::signal_set mStopSignals;
Expand Down
Loading

0 comments on commit b8077bf

Please sign in to comment.