main.ch

Declarations

Public Only
Publicstruct TestFunction
struct TestFunction
struct TestEnvImpl
struct TestEnvImpl : TestEnv
Publicfunction get_test_id
func get_test_id(self : &TestEnvImpl) : int
Publicfunction get_group_name
func get_group_name(self : &TestEnvImpl) : string_view
Publicfunction logIt
func logIt(self : &TestEnvImpl, type : LogType, msgData : *char, lineNum : uint, charNum : uint) : void
Publicfunction quit_current_group
func quit_current_group(self : &TestEnvImpl, reason : *char) : void
Publicfunction quit_all_tests
func quit_all_tests(self : &TestEnvImpl, reason : *char) : void
function get_tests
func get_tests() : TestFunction[]
struct TestDisplayConfig
struct TestDisplayConfig
function make
func make() : TestDisplayConfig
struct TestRunnerConfig
struct TestRunnerConfig
function make
func make() : TestRunnerConfig
function delete
func delete(self : *TestRunnerConfig) : void
function run_single_test
func run_single_test(tfn : *TestFunction, config : &TestRunnerConfig) : void
struct TestLog
struct TestLog
function make
func make() : TestLog
function delete
func delete(self : *TestLog) : void
struct TestFunctionState
struct TestFunctionState
Publicfunction make
func make(t_fn : *TestFunction) : TestFunctionState
function delete
func delete(self : *TestFunctionState) : void
enum MessageCommandType
enum MessageCommandType { None, QuitGroup, Log, QuitAll }
function to_msg_cmd_type
func to_msg_cmd_type(str : *char) : MessageCommandType
function read_msg_type
func read_msg_type(msg_ptr : **char) : MessageCommandType
function parse_int_w_end
func parse_int_w_end(s : *char, out : *int, endPtrPtr : **char) : int
return codes: 0 = success (out filled) -1 = bad arguments (null pointers) 1 = no digits found (nothing converted) 2 = trailing non-space characters after number 3 = out of range for int (overflow/underflow)
function parse_int_from_str
func parse_int_from_str(pstr : **char) : int
function read_char
func read_char(msg_ptr : **char, c : char) : bool
function read_str
func read_str(msg_ptr : **char, into : &string) : void
function parseLog
func parseLog(msg_ptr : **char, log : &TestLog) : void
function process_message
func process_message(state : &TestFunctionState, msg : *char) : void
Message format examples: $log,0,10,20,this is a normal log message $log,1,10,20,this is an error log message $log,2,10,20,this is a warning log message $log,3,10,20,this is a info log message $log,4,10,20,this is a success log message $quit_group $quit_all
struct TestRunnerState
struct TestRunnerState
function make
func make() : TestRunnerState
function delete
func delete(self : *TestRunnerState) : void
function append_integer
func append_integer(str : &string, dig : int) : void
function launch_test_with_retries
func launch_test_with_retries(exe_path : *char, id : int, state : &TestFunctionState, tries : int, timeout_ms : uint) : void
typealias TestFunctionPtr
type TestFunctionPtr = func(&TestEnv) : void
function run_tests
func run_tests(tests_view : &span<TestFunction>, exe_path : *char, config : &TestRunnerConfig) : void
function parse_int
func parse_int(s : *char, out : *int) : int
return codes: 0 = success (out filled) -1 = bad arguments (null pointers) 1 = no digits found (nothing converted) 2 = trailing non-space characters after number 3 = out of range for int (overflow/underflow)
function parseCommand
func parseCommand(config : &TestRunnerConfig, args : **char, end : **char) : *char
Publicfunction run_test_runner
func run_test_runner(tests_view : span<TestFunction>, argc : int, argv : **char) : int
Publicfunction test_runner
func test_runner(argc : unknown, argv : unknown) : int