Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamtest Namespace Reference

namespace containing stuff related to the test library More...

Namespaces

namespace  details
 implementation details of the test library

Classes

struct  TestConfig
 Configuration of the test runner. More...

Functions

void _start_test_print (details::Test &test, u32 test_num, u32 test_count)
 print the line in terminal when a test start
void _end_test_print (std::vector< details::TestResult > &rank_results, shambase::Timer &timer)
 print the line in terminal when a test ends
bool is_test_failed (details::TestResult &res)
 check is a test is failed
std::string gen_fail_log (details::TestResult &res)
 Generate a failure log at the end of the tests.
void _print_summary (std::vector< details::TestResult > &results)
 Print summary of the test run.
std::vector< details::TestResultgather_tests (std::vector< details::TestResult > rank_result, usize &gather_bytecount)
 Gather test results from all MPI ranks.
void print_test_list ()
 print all the available tests
void write_json_report (std::vector< details::TestResult > &results, std::string outfile)
 Write the JSON report.
void write_tex_report (std::vector< details::TestResult > &results, bool mark_fail)
 Write the tex report.
std::vector< u32select_print_tests (TestConfig cfg)
int run_all_tests (int argc, char *argv[], TestConfig cfg)
 run all the tests
void gen_test_list (std::string_view outfile)
 output test list to a file
shamtest::details::TestAssertListasserts ()
 current test asserts
shamtest::details::TestDataListtest_data ()
 current test data
std::string & test_tex_out ()
 Get current tex output from a test.

Variables

bool is_run_only = false
 Is in run only mode.
bool is_full_output_mode = false
 Is in full output mode.

Detailed Description

namespace containing stuff related to the test library

namespace for the test system

Function Documentation

◆ _end_test_print()

void shamtest::_end_test_print ( std::vector< details::TestResult > & rank_results,
shambase::Timer & timer )

print the line in terminal when a test ends

Parameters
res
timer

Definition at line 84 of file shamtest.cpp.

Here is the call graph for this function:

◆ _print_summary()

void shamtest::_print_summary ( std::vector< details::TestResult > & results)

Print summary of the test run.

Parameters
results

Definition at line 198 of file shamtest.cpp.

Here is the call graph for this function:

◆ _start_test_print()

void shamtest::_start_test_print ( details::Test & test,
u32 test_num,
u32 test_count )

print the line in terminal when a test start

Parameters
test
test_num
test_count

Definition at line 58 of file shamtest.cpp.

◆ asserts()

shamtest::details::TestAssertList & shamtest::asserts ( )
inline

current test asserts

Returns
shamtest::details::TestAssertList& reference to the test asserts

Definition at line 104 of file shamtest.hpp.

◆ gather_tests()

std::vector< details::TestResult > shamtest::gather_tests ( std::vector< details::TestResult > rank_result,
usize & gather_bytecount )

Gather test results from all MPI ranks.

Definition at line 239 of file shamtest.cpp.

Here is the call graph for this function:

◆ gen_fail_log()

std::string shamtest::gen_fail_log ( details::TestResult & res)

Generate a failure log at the end of the tests.

Parameters
res
Returns
std::string

Definition at line 163 of file shamtest.cpp.

◆ gen_test_list()

void shamtest::gen_test_list ( std::string_view outfile)

output test list to a file

Definition at line 586 of file shamtest.cpp.

◆ is_test_failed()

bool shamtest::is_test_failed ( details::TestResult & res)

check is a test is failed

Parameters
res
Returns
true
false

Definition at line 146 of file shamtest.cpp.

◆ print_test_list()

void shamtest::print_test_list ( )

print all the available tests

Definition at line 274 of file shamtest.cpp.

Here is the call graph for this function:

◆ run_all_tests()

int shamtest::run_all_tests ( int argc,
char * argv[],
TestConfig cfg )

run all the tests

Parameters
argcmain argc
argvmain argv
cfgtest run configuration
Returns
int exit code

Definition at line 486 of file shamtest.cpp.

Here is the call graph for this function:

◆ select_print_tests()

std::vector< u32 > shamtest::select_print_tests ( TestConfig cfg)

Definition at line 378 of file shamtest.cpp.

◆ test_data()

shamtest::details::TestDataList & shamtest::test_data ( )
inline

current test data

Returns
shamtest::details::TestAssertList& reference to the test datas

Definition at line 113 of file shamtest.hpp.

◆ test_tex_out()

std::string & shamtest::test_tex_out ( )
inline

Get current tex output from a test.

Definition at line 118 of file shamtest.hpp.

◆ write_json_report()

void shamtest::write_json_report ( std::vector< details::TestResult > & results,
std::string outfile )

Write the JSON report.

Definition at line 316 of file shamtest.cpp.

Here is the call graph for this function:

◆ write_tex_report()

void shamtest::write_tex_report ( std::vector< details::TestResult > & results,
bool mark_fail )

Write the tex report.

Definition at line 365 of file shamtest.cpp.

Here is the call graph for this function:

Variable Documentation

◆ is_full_output_mode

bool shamtest::is_full_output_mode = false

Is in full output mode.

Definition at line 49 of file shamtest.cpp.

◆ is_run_only

bool shamtest::is_run_only = false

Is in run only mode.

Definition at line 48 of file shamtest.cpp.