mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Modularise CMakeLists files and integrate tests.
This commit is contained in:
1 parent
4c8b220257
commit
8d9eb68307
8 files changed
+34
-1369
No files matched your search
@@ -25,68 +25,9 @@
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
//#define BOOST_DISABLE_WIN32 //disables SEH warning
|
||||
#define BOOST_TEST_NO_MAIN
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <test/TestHelper.h>
|
||||
using namespace boost::unit_test;
|
||||
|
||||
//Custom Boost Initialization
|
||||
test_suite* init_func( int argc, char* argv[] )
|
||||
{
|
||||
if (argc == 0)
|
||||
argv[1]=(char*)"a";
|
||||
|
||||
dev::test::Options::get();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Custom Boost Unit Test Main
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
try
|
||||
{
|
||||
framework::init( init_func, argc, argv );
|
||||
|
||||
if( !runtime_config::test_to_run().is_empty() )
|
||||
{
|
||||
test_case_filter filter( runtime_config::test_to_run() );
|
||||
|
||||
traverse_test_tree( framework::master_test_suite().p_id, filter );
|
||||
}
|
||||
|
||||
framework::run();
|
||||
|
||||
results_reporter::make_report();
|
||||
|
||||
return runtime_config::no_result_code()
|
||||
? boost::exit_success
|
||||
: results_collector.results( framework::master_test_suite().p_id ).result_code();
|
||||
}
|
||||
catch (framework::nothing_to_test const&)
|
||||
{
|
||||
return boost::exit_success;
|
||||
}
|
||||
catch (framework::internal_error const& ex)
|
||||
{
|
||||
results_reporter::get_stream() << "Boost.Test framework internal error: " << ex.what() << std::endl;
|
||||
|
||||
return boost::exit_exception_failure;
|
||||
}
|
||||
catch (framework::setup_error const& ex)
|
||||
{
|
||||
results_reporter::get_stream() << "Test setup error: " << ex.what() << std::endl;
|
||||
|
||||
return boost::exit_exception_failure;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
results_reporter::get_stream() << "Boost.Test framework internal error: unknown reason" << std::endl;
|
||||
|
||||
return boost::exit_exception_failure;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user