reworkes test infrastructure and tests

This commit is contained in:
2022-10-02 11:39:06 +02:00
parent 6516244afe
commit aa58ec0fa7
9 changed files with 121 additions and 154 deletions

View File

@ -2,3 +2,4 @@ project (test_util)
add_library(${PROJECT_NAME} factory.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries (${PROJECT_NAME} PUBLIC scc Catch2::Catch2)

31
src/sc_main.cpp Normal file
View File

@ -0,0 +1,31 @@
/*
* sc_main.cpp
*
* Created on:
* Author:
*/
#include "factory.h"
#include <catch2/catch_session.hpp>
#include <scc/report.h>
#include <scc/trace.h>
#include <scc/tracer.h>
#include <util/ities.h>
using namespace scc;
using namespace sc_core;
int sc_main(int argc, char* argv[]) {
scc::init_logging(LogConfig().logLevel(log::INFO).logAsync(false));
auto token = util::split(argv[0], '/');
auto trc = scc::create_fst_trace_file(token.back().c_str());
scc::tracer trace(token.back(), scc::tracer::file_type::NONE, trc);
factory::get_instance().create();
int result = Catch::Session().run( argc, argv );
factory::get_instance().destroy();
scc::close_fst_trace_file(trc);
return result + sc_report_handler::get_count(SC_ERROR) + sc_report_handler::get_count(SC_WARNING);
}