diff options
Diffstat (limited to 'test/boostTest.cpp')
-rw-r--r-- | test/boostTest.cpp | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/test/boostTest.cpp b/test/boostTest.cpp index 145be6e4..34eeaec9 100644 --- a/test/boostTest.cpp +++ b/test/boostTest.cpp @@ -28,7 +28,7 @@ #pragma warning(push) #pragma warning(disable:4535) // calling _set_se_translator requires /EHa #endif -#include <boost/test/included/unit_test.hpp> +#include <boost/test/unit_test.hpp> #if defined(_MSC_VER) #pragma warning(pop) #endif @@ -36,7 +36,9 @@ #pragma GCC diagnostic pop #include <test/Options.h> +#include <test/libsolidity/ASTJSONTest.h> #include <test/libsolidity/SyntaxTest.h> +#include <test/libyul/YulOptimizerTest.h> #include <boost/algorithm/string.hpp> #include <boost/algorithm/string/predicate.hpp> @@ -131,6 +133,25 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) "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", + dev::yul::test::YulOptimizerTest::create + ) > 0, "no Yul Optimizer tests found"); + if (!dev::test::Options::get().disableSMT) + solAssert(registerTests( + master, + dev::test::Options::get().testPath / "libsolidity", + "smtCheckerTests", + SyntaxTest::create + ) > 0, "no SMT checker tests found"); if (dev::test::Options::get().disableIPC) { for (auto suite: { @@ -153,3 +174,18 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) return 0; } + +// BOOST_TEST_DYN_LINK should be defined if user want to link against shared boost test library +#ifdef BOOST_TEST_DYN_LINK + +// Because we want to have customized initialization function and support shared boost libraries at the same time, +// we are forced to customize the entry point. +// see: https://www.boost.org/doc/libs/1_67_0/libs/test/doc/html/boost_test/adv_scenarios/shared_lib_customizations/init_func.html + +int main(int argc, char* argv[]) +{ + auto init_unit_test = []() -> bool { init_unit_test_suite(0, nullptr); return true; }; + return boost::unit_test::unit_test_main(init_unit_test, argc, argv); +} + +#endif |