From d7e8d48a8ac026c356e25198616b381efb22b9dc Mon Sep 17 00:00:00 2001 From: Pappy Van Winkle Date: Sat, 3 Feb 2018 19:42:17 -0600 Subject: [PATCH] Creating additional C-interface routines for UnitTest. #511 --- include/trick/trick_tests.h | 7 +++++++ .../sim_services/UnitTest/UnitTest_c_intf.cpp | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/trick/trick_tests.h b/include/trick/trick_tests.h index 268df9bb..0e6a6a53 100644 --- a/include/trick/trick_tests.h +++ b/include/trick/trick_tests.h @@ -80,6 +80,13 @@ #ifdef __cplusplus extern "C" { #endif + +int trick_test_enable() ; + +int trick_test_set_file_name( const char * in_file_name ) ; + +int trick_test_set_test_name( const char * in_test_name ) ; + int trick_test_add_parent(const char * in_test_suite_name, const char * in_test_case, const char * par_num ) ; diff --git a/trick_source/sim_services/UnitTest/UnitTest_c_intf.cpp b/trick_source/sim_services/UnitTest/UnitTest_c_intf.cpp index dffc4cab..784ca603 100644 --- a/trick_source/sim_services/UnitTest/UnitTest_c_intf.cpp +++ b/trick_source/sim_services/UnitTest/UnitTest_c_intf.cpp @@ -6,6 +6,21 @@ extern Trick::UnitTest * the_unit_test_output ; +extern "C" int trick_test_enable() { + the_unit_test_output->enable() ; + return(0) ; +} + +extern "C" int trick_test_set_file_name( const char * in_file_name ) { + the_unit_test_output->set_file_name(in_file_name) ; + return(0) ; +} + +extern "C" int trick_test_set_test_name( const char * in_test_name ) { + the_unit_test_output->set_test_name(in_test_name) ; + return(0) ; +} + extern "C" int add_test_result( const char * in_test_suite_name , const char * in_test_case , const char * in_failure_string ) { if ( in_failure_string == NULL ) { in_failure_string = "" ;