xtd 0.2.0
Loading...
Searching...
No Matches
xtd::tunit::settings Class Referencefinal

Definition

The settings class contains xtd.tunit settings.

Namespace
xtd::tunit
Library
xtd.tunit

Public Constructors

 settings ()=default
 Creates new instance of settings.
 

Public Properties

bool also_run_ignored_tests () const noexcept
 Gets also run ignored test.
 
void also_run_ignored_tests (bool also_run_ignored_tests) noexcept
 Sets also run ignored test.
 
bool break_on_failure () const noexcept
 Gets break immediatly on failure.
 
void break_on_failure (bool break_on_failure) noexcept
 Sets break immediatly on failure.
 
bool brief () const noexcept
 Gets brief.
 
void brief (bool brief) noexcept
 Sets brief.
 
bool count_tests () const noexcept
 Gets count tests.
 
void count_tests (bool count_tests) noexcept
 Sets count tests.
 
bool enable_stack_trace () const noexcept
 Gets stack trace enabled.
 
void enable_stack_trace (bool enable_stack_trace) noexcept
 Sets stack trace enabled.
 
const xtd::date_timeend_time () const noexcept
 Gets unit test end time.
 
int32 exit_status () const noexcept
 Gets exit status.
 
void exit_status (int32 exit_status) noexcept
 Sets exit status.
 
const std::vector< string > & filter_tests () const noexcept
 Gets filter tests.
 
void filter_tests (const std::vector< string > &filter_tests) noexcept
 Sets filter tests.
 
bool gtest_compatibility () const noexcept
 Gets google test comaptibility.
 
void gtest_compatibility (bool gtest_compatibility) noexcept
 Sets google test comaptibility.
 
bool is_match_test_name (const xtd::string &test_class_name, const xtd::string &test_name) const noexcept
 Return true if a specified test class name and specified test name match with the current filter tests.
 
bool list_tests () const noexcept
 Gets list tests.
 
void list_tests (bool list_tests) noexcept
 Sets list tests.
 
bool output_color () const noexcept
 Gets output color.
 
void output_color (bool output_color) noexcept
 Sets output color.
 
bool output_json () const noexcept
 Gets output xml.
 
void output_json (bool output_json) noexcept
 Sets output json.
 
xtd::string output_json_path () const noexcept
 Gets output json path.
 
void output_json_path (const xtd::string &output_json_path) noexcept
 Sets output sjon path.
 
bool output_xml () const noexcept
 Gets output xml.
 
void output_xml (bool output_xml) noexcept
 Sets output xml.
 
xtd::string output_xml_path () const noexcept
 Gets output xml path.
 
void output_xml_path (const xtd::string &output_xml_path) noexcept
 Sets output xml path.
 
uint32 random_seed () const noexcept
 Gets random seed value.
 
void random_seed (uint32 random_seed) noexcept
 Sets random seed value.
 
int32 repeat_test () const noexcept
 Gets repeat tests count.
 
void repeat_tests (int32 repeat_tests) noexcept
 Sets repeat tests count.
 
bool show_duration () const noexcept
 Gets if show duration for each test.
 
void show_duration (bool show_duration) noexcept
 Sets if show duration for each test.
 
bool shuffle_test () const noexcept
 Gets shuffle tests.
 
void shuffle_test (bool shuffle_test) noexcept
 Sets shuffle tests.
 
const xtd::date_timestart_time () const noexcept
 Gets unit test start time.
 
bool throw_on_failure () const noexcept
 Gets throw on failure.
 
void throw_on_failure (bool break_on_failure) noexcept
 Sets throw on failure.
 

Public Static Properties

static xtd::tunit::settingsdefault_settings () noexcept
 Gets default settings instance.
 

Constructor & Destructor Documentation

◆ settings()

xtd::tunit::settings::settings ( )
default

Creates new instance of settings.

Remarks
The following table shows the default value for properties :
Property Default value
also_run_ignored_tests false
break_on_failure false
brief false
count_tests false
enable_stack_trace false
exit_status EXIT_SUCCESS
filter_tests {"*.*"}
gtest_compatibility false
list_tests false
output_color true
output_json false
output_json_path ""
output_xml false
output_xml_path ""
random_seed 0
repeat_test 1
show_duration true
shuffle_test false
throw_on_failure false

Member Function Documentation

◆ also_run_ignored_tests() [1/2]

bool xtd::tunit::settings::also_run_ignored_tests ( ) const
noexcept

Gets also run ignored test.

Returns
true if also run ignored test; otherwise false. The default value is false.

◆ also_run_ignored_tests() [2/2]

void xtd::tunit::settings::also_run_ignored_tests ( bool  also_run_ignored_tests)
noexcept

Sets also run ignored test.

Parameters
also_run_ignored_teststrue if also run ignored test; otherwise false. The default value is false.

◆ break_on_failure() [1/2]

bool xtd::tunit::settings::break_on_failure ( ) const
noexcept

Gets break immediatly on failure.

Returns
true if break immediatly on failure; otherwise false. The default value is false.

◆ break_on_failure() [2/2]

void xtd::tunit::settings::break_on_failure ( bool  break_on_failure)
noexcept

Sets break immediatly on failure.

Parameters
break_on_failuretrue if break immediatly on failure; otherwise false. The default value is false.

◆ brief() [1/2]

bool xtd::tunit::settings::brief ( ) const
noexcept

Gets brief.

Returns
true if brief; otherwise false. The default value is false.

◆ brief() [2/2]

void xtd::tunit::settings::brief ( bool  brief)
noexcept

Sets brief.

Parameters
brieftrue if brief; otherwise false. The default value is false.

◆ count_tests() [1/2]

bool xtd::tunit::settings::count_tests ( ) const
noexcept

Gets count tests.

Returns
true if count tests; otherwise false. The default value is false.

◆ count_tests() [2/2]

void xtd::tunit::settings::count_tests ( bool  count_tests)
noexcept

Sets count tests.

Parameters
count_teststrue if count tests; otherwise false. The default value is false.

◆ enable_stack_trace() [1/2]

bool xtd::tunit::settings::enable_stack_trace ( ) const
noexcept

Gets stack trace enabled.

Returns
true if stack trace enabled; otherwise false. The default value is false.
Warning
If the valueur is set to true, unit test execution time will increase sharply.

◆ enable_stack_trace() [2/2]

void xtd::tunit::settings::enable_stack_trace ( bool  enable_stack_trace)
noexcept

Sets stack trace enabled.

Parameters
enable_stack_tracetrue if stack trace enabled; otherwise false. The default value is false.
Warning
If the valueur is set to true, unit test execution time will increase sharply.

◆ end_time()

const xtd::date_time & xtd::tunit::settings::end_time ( ) const
noexcept

Gets unit test end time.

Returns
Unit test end time.

◆ exit_status() [1/2]

int32 xtd::tunit::settings::exit_status ( ) const
noexcept

Gets exit status.

Returns
exit status. The value by default is EXIT_SUCCESS.
Remarks
When an error occurred in unit test the value is set to EXIT_FAILURE.

◆ exit_status() [2/2]

void xtd::tunit::settings::exit_status ( int32  exit_status)
noexcept

Sets exit status.

Parameters
exit_statusexit status. The value by default is EXIT_SUCCESS.
Remarks
When an error occurred in unit test the value is set to EXIT_FAILURE.

◆ filter_tests() [1/2]

const std::vector< string > & xtd::tunit::settings::filter_tests ( ) const
noexcept

Gets filter tests.

Returns
filter tests. The value by default is {"*.*"}.

◆ filter_tests() [2/2]

void xtd::tunit::settings::filter_tests ( const std::vector< string > &  filter_tests)
noexcept

Sets filter tests.

Parameters
filter_testsfilter tests. The value by default is {"*.*"}.

◆ gtest_compatibility() [1/2]

bool xtd::tunit::settings::gtest_compatibility ( ) const
noexcept

Gets google test comaptibility.

Returns
true if google test comaptibility; otherwise false. The default value is false.

◆ gtest_compatibility() [2/2]

void xtd::tunit::settings::gtest_compatibility ( bool  gtest_compatibility)
noexcept

Sets google test comaptibility.

Parameters
gtest_compatibilitytrue if google test comaptibility; otherwise false. The default value is false.

◆ is_match_test_name()

bool xtd::tunit::settings::is_match_test_name ( const xtd::string test_class_name,
const xtd::string test_name 
) const
noexcept

Return true if a specified test class name and specified test name match with the current filter tests.

Returns
return true if class name and test name match with the current filter tests; otherwise false.

◆ list_tests() [1/2]

bool xtd::tunit::settings::list_tests ( ) const
noexcept

Gets list tests.

Returns
true if list tests; otherwise false. The default value is false.

◆ list_tests() [2/2]

void xtd::tunit::settings::list_tests ( bool  list_tests)
noexcept

Sets list tests.

Parameters
list_teststrue if list tests; otherwise false. The default value is false.

◆ output_color() [1/2]

bool xtd::tunit::settings::output_color ( ) const
noexcept

Gets output color.

Returns
true for colored output; otherwise false. The default value is true.

◆ output_color() [2/2]

void xtd::tunit::settings::output_color ( bool  output_color)
noexcept

Sets output color.

Parameters
output_colortrue for colored output; otherwise false. The default value is true.

◆ output_json() [1/2]

bool xtd::tunit::settings::output_json ( ) const
noexcept

Gets output xml.

Returns
true for generate xml report; otherwise false. The default value is false.

◆ output_json() [2/2]

void xtd::tunit::settings::output_json ( bool  output_json)
noexcept

Sets output json.

Parameters
output_jsontrue for generate json report; otherwise false. The default value is false.

◆ output_json_path() [1/2]

xtd::string xtd::tunit::settings::output_json_path ( ) const
noexcept

Gets output json path.

Returns
Output json path. The default value is xtd::string::empty_string ("").

◆ output_json_path() [2/2]

void xtd::tunit::settings::output_json_path ( const xtd::string output_json_path)
noexcept

Sets output sjon path.

Parameters
output_jsonl_pathOutput json path. The default value is xtd::string::empty_string ("").

◆ output_xml() [1/2]

bool xtd::tunit::settings::output_xml ( ) const
noexcept

Gets output xml.

Returns
true for generate xml report; otherwise false. The default value is false.

◆ output_xml() [2/2]

void xtd::tunit::settings::output_xml ( bool  output_xml)
noexcept

Sets output xml.

Parameters
output_xmltrue for generate xml report; otherwise false. The default value is false.

◆ output_xml_path() [1/2]

xtd::string xtd::tunit::settings::output_xml_path ( ) const
noexcept

Gets output xml path.

Returns
Output xml path. The default value is xtd::string::empty_string ("").

◆ output_xml_path() [2/2]

void xtd::tunit::settings::output_xml_path ( const xtd::string output_xml_path)
noexcept

Sets output xml path.

Parameters
output_xml_pathOutput xml path. The default value is xtd::string::empty_string ("").

◆ random_seed() [1/2]

uint32 xtd::tunit::settings::random_seed ( ) const
noexcept

Gets random seed value.

Returns
Random seed value. The default value is 0 (no seed).

◆ random_seed() [2/2]

void xtd::tunit::settings::random_seed ( uint32  random_seed)
noexcept

Sets random seed value.

Parameters
random_seedRandom seed value. The default value is 0 (no seed).

◆ repeat_test()

int32 xtd::tunit::settings::repeat_test ( ) const
noexcept

Gets repeat tests count.

Returns
Repeat test count. The default value is 1 (no repeat).

◆ repeat_tests()

void xtd::tunit::settings::repeat_tests ( int32  repeat_tests)
noexcept

Sets repeat tests count.

Parameters
repeat_testsRepeat test count. The default value is 1 (no repeat).

◆ show_duration() [1/2]

bool xtd::tunit::settings::show_duration ( ) const
noexcept

Gets if show duration for each test.

Returns
true if show duration for each test; otherwise false. The default value is true.

◆ show_duration() [2/2]

void xtd::tunit::settings::show_duration ( bool  show_duration)
noexcept

Sets if show duration for each test.

Parameters
show_durationtrue if show duration for each test; otherwise false. The default value is true.

◆ shuffle_test() [1/2]

bool xtd::tunit::settings::shuffle_test ( ) const
noexcept

Gets shuffle tests.

Returns
true if shuffle test; otherwise false. The default value is false.

◆ shuffle_test() [2/2]

void xtd::tunit::settings::shuffle_test ( bool  shuffle_test)
noexcept

Sets shuffle tests.

Parameters
shuffle_testtrue if shuffle test; otherwise false. The default value is false.

◆ start_time()

const xtd::date_time & xtd::tunit::settings::start_time ( ) const
noexcept

Gets unit test start time.

Returns
Unit test start time.

◆ throw_on_failure() [1/2]

bool xtd::tunit::settings::throw_on_failure ( ) const
noexcept

Gets throw on failure.

Returns
true if throw on failure; otherwise false. The default value is false.

◆ throw_on_failure() [2/2]

void xtd::tunit::settings::throw_on_failure ( bool  break_on_failure)
noexcept

Sets throw on failure.

Parameters
break_on_failuretrue if throw on failure; otherwise false. The default value is false.

◆ default_settings()

static xtd::tunit::settings & xtd::tunit::settings::default_settings ( )
staticnoexcept

Gets default settings instance.

Returns
Default settings instance.
Remarks
The following table shows the default value for properties :
Property Default value
also_run_ignored_tests false
break_on_failure false
brief false
count_tests false
enable_stack_trace false
exit_status EXIT_SUCCESS
filter_tests {"*.*"}
gtest_compatibility false
list_tests false
output_color true
output_json false
output_json_path ""
output_xml false
output_xml_path ""
random_seed 0
repeat_test 1
show_duration true
shuffle_test false
throw_on_failure false

The documentation for this class was generated from the following file: