-
Notifications
You must be signed in to change notification settings - Fork 9
Configuring the TestFramework (ADVANCED)
To configure advanced functionality of the test framework, you can refer to the frameworkSetup script. This script is responsible for defining default configurations utilized by the different classes and constructors within the various modules.
Within the frameworkSetup script, you can make use of the config_set(...) function, which is part of the configuration manager. This function allows you to configure specific properties associated with the test framework.
The Test constructor allows these default properties:
-
test_end_hook{Function} Hook function that will be executed at the end of the test. -
test_start_hook{Function} Hook function that will be executed at the start of the test. -
test_filter{Function} Predicate function that determines whether the test should run or not. -
test_timeout_millis{Function} The number of milliseconds to wait until the test timeout.
Note
An alternative option is to utilize a config.json file to provide all the aforementioned configurations. This approach is commonly employed by the framework launcher tool to streamline the configuration process.
Important
It is important to note that function callbacks and delegates cannot be defined directly within the external config.json file. This limitation exists because functions cannot be stored in JSON format.
The TestSuite constructor allows these default properties:
-
suite_end_hook{Function} Hook function that will be executed at the end of the suite. -
suite_start_hook{Function} Hook function that will be executed at the start of the suite. -
suite_filter{Function} Predicate function that determines whether the suite should run or not. -
suite_timeout_millis{Function} The number of millis to wait until the suite timesout. -
suite_bail_on_fail{Bool} Should the suite bail execution after the first failed suite. -
suite_delay_seconds{Real} The number of seconds to wait between tests.
Note
An alternative option is to utilize a config.json file to provide all the aforementioned configurations. This approach is commonly employed by the framework launcher tool to streamline the configuration process.
Important
It is important to note that function callbacks and delegates cannot be defined directly within the external config.json file. This limitation exists because functions cannot be stored in JSON format.
The TestFramework constructor allows these default properties:
-
framework_end_hook{Function} Hook function that will be executed at the end of the framework. -
framework_start_hook{Function} Hook function that will be executed at the start of the framework. -
framework_filter{Function} Predicate function that determines whether the framework should run or not. -
framework_timeout_millis{Function} The number of millis to wait until the framework timesout. -
framework_bail_on_fail{Bool} Should the suite bail execution after the first failed framework. -
framework_delay_seconds{Real} The number of seconds to wait between suites.
Note
An alternative option is to utilize a config.json file to provide all the aforementioned configurations. This approach is commonly employed by the framework launcher tool to streamline the configuration process.
Important
It is important to note that function callbacks and delegates cannot be defined directly within the external config.json file. This limitation exists because functions cannot be stored in JSON format.
The Assert constructor allows these default properties:
-
assert_failed_hook{Function} Hook function that will be executed on every failed assertion. -
assert_passed_hook{Function} Hook function that will be executed on every passed assertion. -
assert_stack_base_depth{Real} The value used to specify the base depth for the stack (number of function calls from theassertcall until thedebug_get_callstackcall) -
assert_stack_depth{Real} The number of stack entries to show in the assert information.
Note
An alternative option is to utilize a config.json file to provide all the aforementioned configurations. This approach is commonly employed by the framework launcher tool to streamline the configuration process.
Important
It is important to note that function callbacks and delegates cannot be defined directly within the external config.json file. This limitation exists because functions cannot be stored in JSON format.
The Logger constructor allows these default properties:
-
logger_level{Real} The filter level for showing log messages (seeLoggerLevelenum) -
logger_time_format{String} The format used for the time (ie.:"{H}:{M}:{S}"). Allows the following:-
{Y}for displaying the year in a XXXX format -
{m}for displaying the month -
{d}for displaying the day -
{H}for displaying the hours -
{M}for displaying the minutes -
{S}for displaying the seconds
-
-
logger_message_format{String} The format used for the message (ie.:"[{level}] {message}"). Allows for following:-
{message}displays the actual message) -
{time}displays the time (seelogger_time_formatabove) -
{level}displays the string representation of the current log type (INFO, WARNING, ERROR, ...)
-
Note
An alternative option is to utilize a config.json file to provide all the aforementioned configurations. This approach is commonly employed by the framework launcher tool to streamline the configuration process.