xtd 1.0.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

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

Public Static Properties

static auto default_settings () noexcept -> xtd::tunit::settings &
 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]

auto xtd::tunit::settings::also_run_ignored_tests ( ) const -> bool
nodiscardnoexcept

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]

auto xtd::tunit::settings::also_run_ignored_tests ( bool value) -> settings &
noexcept

Sets also run ignored test.

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

◆ break_on_failure() [1/2]

auto xtd::tunit::settings::break_on_failure ( ) const -> bool
nodiscardnoexcept

Gets break immediatly on failure.

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

◆ break_on_failure() [2/2]

auto xtd::tunit::settings::break_on_failure ( bool value) -> settings &
noexcept

Sets break immediatly on failure.

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

◆ brief() [1/2]

auto xtd::tunit::settings::brief ( ) const -> bool
nodiscardnoexcept

Gets brief.

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

◆ brief() [2/2]

auto xtd::tunit::settings::brief ( bool value) -> settings &
noexcept

Sets brief.

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

◆ count_tests() [1/2]

auto xtd::tunit::settings::count_tests ( ) const -> bool
nodiscardnoexcept

Gets count tests.

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

◆ count_tests() [2/2]

auto xtd::tunit::settings::count_tests ( bool value) -> settings &
noexcept

Sets count tests.

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

◆ enable_stack_trace() [1/2]

auto xtd::tunit::settings::enable_stack_trace ( ) const -> bool
nodiscardnoexcept

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]

auto xtd::tunit::settings::enable_stack_trace ( bool value) -> settings &
noexcept

Sets stack trace enabled.

Parameters
valuetrue 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()

auto xtd::tunit::settings::end_time ( ) const -> const xtd::date_time &
nodiscardnoexcept

Gets unit test end time.

Returns
Unit test end time.

◆ exit_status() [1/2]

auto xtd::tunit::settings::exit_status ( ) const -> xtd::int32
nodiscardnoexcept

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]

auto xtd::tunit::settings::exit_status ( xtd::int32 value) -> settings &
noexcept

Sets exit status.

Parameters
valueexit 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]

auto xtd::tunit::settings::filter_tests ( ) const -> const xtd::array< xtd::string > &
nodiscardnoexcept

Gets filter tests.

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

◆ filter_tests() [2/2]

auto xtd::tunit::settings::filter_tests ( const xtd::array< xtd::string > & value) -> settings &
noexcept

Sets filter tests.

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

◆ gtest_compatibility() [1/2]

auto xtd::tunit::settings::gtest_compatibility ( ) const -> bool
nodiscardnoexcept

Gets google test comaptibility.

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

◆ gtest_compatibility() [2/2]

auto xtd::tunit::settings::gtest_compatibility ( bool value) -> settings &
noexcept

Sets google test comaptibility.

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

◆ is_match_test_name()

auto xtd::tunit::settings::is_match_test_name ( const xtd::string & test_class_name,
const xtd::string & test_name ) const -> bool
nodiscardnoexcept

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]

auto xtd::tunit::settings::list_tests ( ) const -> bool
nodiscardnoexcept

Gets list tests.

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

◆ list_tests() [2/2]

auto xtd::tunit::settings::list_tests ( bool value) -> settings &
noexcept

Sets list tests.

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

◆ output_color() [1/2]

auto xtd::tunit::settings::output_color ( ) const -> bool
nodiscardnoexcept

Gets output color.

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

◆ output_color() [2/2]

auto xtd::tunit::settings::output_color ( bool value) -> settings &
noexcept

Sets output color.

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

◆ output_json() [1/2]

auto xtd::tunit::settings::output_json ( ) const -> bool
nodiscardnoexcept

Gets output xml.

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

◆ output_json() [2/2]

auto xtd::tunit::settings::output_json ( bool value) -> settings &
noexcept

Sets output json.

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

◆ output_json_path() [1/2]

auto xtd::tunit::settings::output_json_path ( ) const -> xtd::string
nodiscardnoexcept

Gets output json path.

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

◆ output_json_path() [2/2]

auto xtd::tunit::settings::output_json_path ( const xtd::string & value) -> settings &
noexcept

Sets output sjon path.

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

◆ output_xml() [1/2]

auto xtd::tunit::settings::output_xml ( ) const -> bool
nodiscardnoexcept

Gets output xml.

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

◆ output_xml() [2/2]

auto xtd::tunit::settings::output_xml ( bool value) -> settings &
noexcept

Sets output xml.

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

◆ output_xml_path() [1/2]

auto xtd::tunit::settings::output_xml_path ( ) const -> xtd::string
nodiscardnoexcept

Gets output xml path.

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

◆ output_xml_path() [2/2]

auto xtd::tunit::settings::output_xml_path ( const xtd::string & value) -> settings &
noexcept

Sets output xml path.

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

◆ random_seed() [1/2]

auto xtd::tunit::settings::random_seed ( ) const -> xtd::uint32
nodiscardnoexcept

Gets random seed value.

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

◆ random_seed() [2/2]

auto xtd::tunit::settings::random_seed ( xtd::uint32 value) -> settings &
noexcept

Sets random seed value.

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

◆ repeat_test()

auto xtd::tunit::settings::repeat_test ( ) const -> xtd::int32
nodiscardnoexcept

Gets repeat tests count.

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

◆ repeat_tests()

auto xtd::tunit::settings::repeat_tests ( xtd::int32 value) -> settings &
noexcept

Sets repeat tests count.

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

◆ show_duration() [1/2]

auto xtd::tunit::settings::show_duration ( ) const -> bool
nodiscardnoexcept

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]

auto xtd::tunit::settings::show_duration ( bool value) -> settings &
noexcept

Sets if show duration for each test.

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

◆ shuffle_test() [1/2]

auto xtd::tunit::settings::shuffle_test ( ) const -> bool
nodiscardnoexcept

Gets shuffle tests.

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

◆ shuffle_test() [2/2]

auto xtd::tunit::settings::shuffle_test ( bool value) -> settings &
noexcept

Sets shuffle tests.

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

◆ start_time()

auto xtd::tunit::settings::start_time ( ) const -> const xtd::date_time &
nodiscardnoexcept

Gets unit test start time.

Returns
Unit test start time.

◆ throw_on_failure() [1/2]

auto xtd::tunit::settings::throw_on_failure ( ) const -> bool
nodiscardnoexcept

Gets throw on failure.

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

◆ throw_on_failure() [2/2]

auto xtd::tunit::settings::throw_on_failure ( bool value) -> settings &
noexcept

Sets throw on failure.

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

◆ default_settings()

auto xtd::tunit::settings::default_settings ( ) -> xtd::tunit::settings &
staticnodiscardnoexcept

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: