From b7cfa499b0bd674b59284821e33349726cbc4299 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 5 Dec 2018 12:02:49 +0100 Subject: Add tests. --- test/boostTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/boostTest.cpp') diff --git a/test/boostTest.cpp b/test/boostTest.cpp index 7cb0c143..ff443d11 100644 --- a/test/boostTest.cpp +++ b/test/boostTest.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -146,6 +147,12 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) "yulOptimizerTests", yul::test::YulOptimizerTest::create ) > 0, "no Yul Optimizer tests found"); + solAssert(registerTests( + master, + dev::test::Options::get().testPath / "libyul", + "objectCompiler", + yul::test::ObjectCompilerTest::create + ) > 0, "no Yul Object compiler tests found"); if (!dev::test::Options::get().disableSMT) { solAssert(registerTests( -- cgit v1.2.3 From 55d7d327c4d71eacb4bc2ec48c047fbf2407668c Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Wed, 5 Dec 2018 18:00:23 +0100 Subject: Have only one source where testsuits are defined --- test/boostTest.cpp | 58 +++++++++++++++++------------------------------------- 1 file changed, 18 insertions(+), 40 deletions(-) (limited to 'test/boostTest.cpp') diff --git a/test/boostTest.cpp b/test/boostTest.cpp index ff443d11..034aaef3 100644 --- a/test/boostTest.cpp +++ b/test/boostTest.cpp @@ -35,16 +35,13 @@ #pragma GCC diagnostic pop +#include #include -#include -#include -#include -#include -#include #include #include #include +#include using namespace boost::unit_test; using namespace dev::solidity::test; @@ -129,46 +126,26 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) master_test_suite_t& master = framework::master_test_suite(); master.p_name.value = "SolidityTests"; dev::test::Options::get().validate(); - solAssert(registerTests( - master, - dev::test::Options::get().testPath / "libsolidity", - "syntaxTests", - SyntaxTest::create - ) > 0, "no syntax tests found"); - solAssert(registerTests( - master, - dev::test::Options::get().testPath / "libsolidity", - "ASTJSON", - ASTJSONTest::create - ) > 0, "no JSON AST tests found"); - solAssert(registerTests( - master, - dev::test::Options::get().testPath / "libyul", - "yulOptimizerTests", - yul::test::YulOptimizerTest::create - ) > 0, "no Yul Optimizer tests found"); - solAssert(registerTests( - master, - dev::test::Options::get().testPath / "libyul", - "objectCompiler", - yul::test::ObjectCompilerTest::create - ) > 0, "no Yul Object compiler tests found"); - if (!dev::test::Options::get().disableSMT) + + // Include the interactive tests in the automatic tests as well + for (auto const& ts: g_interactiveTestsuites) { - solAssert(registerTests( - master, - dev::test::Options::get().testPath / "libsolidity", - "smtCheckerTests", - SyntaxTest::create - ) > 0, "no SMT checker tests found"); + auto const& options = dev::test::Options::get(); + + if (ts.smt && options.disableSMT) + continue; + + if (ts.ipc && options.disableIPC) + continue; solAssert(registerTests( master, - dev::test::Options::get().testPath / "libsolidity", - "smtCheckerTestsJSON", - SMTCheckerTest::create - ) > 0, "no SMT checker JSON tests found"); + options.testPath / ts.path, + ts.subpath, + ts.testCaseCreator + ) > 0, std::string("no ") + ts.title + " tests found"); } + if (dev::test::Options::get().disableIPC) { for (auto suite: { @@ -188,6 +165,7 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) }) removeTestSuite(suite); } + if (dev::test::Options::get().disableSMT) removeTestSuite("SMTChecker"); -- cgit v1.2.3 From d80d324de7fa7eb79e21d1e6d7cbca4ba3eebcd0 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 6 Dec 2018 15:59:58 +0100 Subject: Tests for gas costs. --- test/boostTest.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'test/boostTest.cpp') diff --git a/test/boostTest.cpp b/test/boostTest.cpp index ff443d11..cff0f5c0 100644 --- a/test/boostTest.cpp +++ b/test/boostTest.cpp @@ -183,6 +183,7 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) "LLLEndToEndTest", #endif "GasMeterTests", + "GasCostTests", "SolidityEndToEndTest", "SolidityOptimizer" }) -- cgit v1.2.3