Skip to content

Commit

Permalink
Option to disable/remove all tests that require IPC.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Apr 26, 2017
1 parent 89bb8cb commit ea6d925
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
4 changes: 3 additions & 1 deletion test/TestHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ Options::Options()
optimize = true;
else if (string(suite.argv[i]) == "--show-messages")
showMessages = true;
else if (string(suite.argv[i]) == "--no-ipc")
disableIPC = true;

if (ipcPath.empty())
if (!disableIPC && ipcPath.empty())
if (auto path = getenv("ETH_TEST_IPC"))
ipcPath = path;
}
1 change: 1 addition & 0 deletions test/TestHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ struct Options: boost::noncopyable
std::string ipcPath;
bool showMessages = false;
bool optimize = false;
bool disableIPC = false;

static Options const& get();

Expand Down
31 changes: 29 additions & 2 deletions test/boostTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
* Original code taken from boost sources.
*/

#define BOOST_TEST_MODULE EthereumTests
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"


#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4535) // calling _set_se_translator requires /EHa
Expand All @@ -36,3 +34,32 @@
#endif

#pragma GCC diagnostic pop

#include <test/TestHelper.h>

using namespace boost::unit_test;

test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] )
{
master_test_suite_t& master = framework::master_test_suite();
master.p_name.value = "SolidityTests";
if (dev::test::Options::get().disableIPC)
{
for (auto suite: {
"SolidityAuctionRegistrar",
"SolidityFixedFeeRegistrar",
"SolidityWallet",
"LLLEndToEndTest",
"GasMeterTests",
"SolidityEndToEndTest",
"SolidityOptimizer"
})
{
auto id = master.get(suite);
assert(id != INV_TEST_UNIT_ID);
master.remove(id);
}
}

return 0;
}

0 comments on commit ea6d925

Please sign in to comment.