SystemC-Components-Test/src/sc_main.cpp

32 lines
823 B
C++

/*
* 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);
}