xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Public Member Functions | Static Public Member Functions | List of all members
xtd::tunit::settings Class Referencefinal

#include <settings.h>

Definition

The settings class contains xtd.tunit settings.

Namespace
xtd::tunit
Library
xtd.tunit

Public Member Functions

 settings ()=default
 Creates new instance of settings. More...
 
bool also_run_ignored_tests () const noexcept
 Gets also run ignored test. More...
 
void also_run_ignored_tests (bool also_run_ignored_tests) noexcept
 Sets also run ignored test. More...
 
std::chrono::time_point< std::chrono::system_clock > end_time () const noexcept
 Gets unit test end time. More...
 
int exit_status () const noexcept
 Gets exit status. More...
 
void exit_status (int exit_status) noexcept
 Sets exit status. More...
 
const std::string & filter_tests () const noexcept
 Gets filter tests. More...
 
void filter_tests (const std::string &filter_tests) noexcept
 Sets filter tests. More...
 
bool is_match_test_name (const std::string &test_class_name, const std::string &test_name) const noexcept
 Return true if a specified test class name and specified test name match with the current filter tests. More...
 
bool list_tests () const noexcept
 Gets list tests. More...
 
void list_tests (bool list_tests) noexcept
 Sets list tests. More...
 
bool output_color () const noexcept
 Gets output color. More...
 
void output_color (bool output_color) noexcept
 Sets output color. More...
 
bool output_xml () const noexcept
 Gets output xml. More...
 
void output_xml (bool output_xml) noexcept
 Sets output xml. More...
 
std::string output_xml_path () const noexcept
 Gets output xml path. More...
 
void output_xml_path (const std::string &output_xml_path) noexcept
 Sets output xml path. More...
 
int random_seed () const noexcept
 Gets random seed value. More...
 
void random_seed (int random_seed) noexcept
 Sets random seed value. More...
 
int repeat_test () const noexcept
 Gets repeat tests count. More...
 
void repeat_tests (int repeat_tests) noexcept
 Sets repeat tests count. More...
 
bool show_duration () const noexcept
 Gets if show duration for each test. More...
 
void show_duration (bool show_duration) noexcept
 Sets if show duration for each test. More...
 
bool shuffle_test () const noexcept
 Gets shuffle tests. More...
 
void shuffle_test (bool shuffle_test) noexcept
 Sets shuffle tests. More...
 
std::chrono::time_point< std::chrono::system_clock > start_time () const noexcept
 Gets unit test start time. More...
 

Static Public Member Functions

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

Constructor & Destructor Documentation

◆ settings()

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

Creates new instance of settings.

Member Function Documentation

◆ also_run_ignored_tests() [1/2]

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

Gets also run ignored test.

Returns
true if also run ignored test; otherwise false.

◆ also_run_ignored_tests() [2/2]

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

Sets also run ignored test.

Parameters
also_run_ignored_teststrue if also run ignored test; otherwise false.

◆ default_settings()

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

Get default settings instance.

Returns
Default settings instance.

◆ end_time()

std::chrono::time_point<std::chrono::system_clock> xtd::tunit::settings::end_time ( ) const
inlinenoexcept

Gets unit test end time.

Returns
Unit test end time.

◆ exit_status() [1/2]

int xtd::tunit::settings::exit_status ( ) const
inlinenoexcept

Gets exit status.

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

◆ exit_status() [2/2]

void xtd::tunit::settings::exit_status ( int  exit_status)
inlinenoexcept

Sets exit status.

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

◆ filter_tests() [1/2]

const std::string& xtd::tunit::settings::filter_tests ( ) const
inlinenoexcept

Gets filter tests.

Returns
filter tests.
Remarks
The value by default is "*.*".

◆ filter_tests() [2/2]

void xtd::tunit::settings::filter_tests ( const std::string &  filter_tests)
inlinenoexcept

Sets filter tests.

Parameters
filter_testsfilter tests.
Remarks
The value by default is "*.*".

◆ is_match_test_name()

bool xtd::tunit::settings::is_match_test_name ( const std::string &  test_class_name,
const std::string &  test_name 
) const
inlinenoexcept

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
inlinenoexcept

Gets list tests.

Returns
true if list tests; otherwise false.

◆ list_tests() [2/2]

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

Sets list tests.

Parameters
list_teststrue if list tests; otherwise false.

◆ output_color() [1/2]

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

Gets output color.

Returns
true for colored output; otherwise false.

◆ output_color() [2/2]

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

Sets output color.

Parameters
output_colortrue for colored output; otherwise false.

◆ output_xml() [1/2]

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

Gets output xml.

Returns
true for generate xml report; otherwise false.

◆ output_xml() [2/2]

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

Sets output xml.

Parameters
output_xmltrue for generate xml report; otherwise false.

◆ output_xml_path() [1/2]

std::string xtd::tunit::settings::output_xml_path ( ) const
inlinenoexcept

Gets output xml path.

Returns
Output xml path.

◆ output_xml_path() [2/2]

void xtd::tunit::settings::output_xml_path ( const std::string &  output_xml_path)
inlinenoexcept

Sets output xml path.

Parameters
output_xml_pathOutput xml path.

◆ random_seed() [1/2]

int xtd::tunit::settings::random_seed ( ) const
inlinenoexcept

Gets random seed value.

Returns
Random seed value.
Remarks
By default is set to 0 (no seed).

◆ random_seed() [2/2]

void xtd::tunit::settings::random_seed ( int  random_seed)
inlinenoexcept

Sets random seed value.

Parameters
random_seedRandom seed value.
Remarks
By default is set to 0 (no seed).

◆ repeat_test()

int xtd::tunit::settings::repeat_test ( ) const
inlinenoexcept

Gets repeat tests count.

Returns
Repeat test count.
Remarks
By default is set to 1 (no repeat).

◆ repeat_tests()

void xtd::tunit::settings::repeat_tests ( int  repeat_tests)
inlinenoexcept

Sets repeat tests count.

Parameters
repeat_testsRepeat test count.
Remarks
By default is set to 1 (no repeat).

◆ show_duration() [1/2]

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

Gets if show duration for each test.

Returns
true if show duration for each test; otherwise false.

◆ show_duration() [2/2]

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

Sets if show duration for each test.

Parameters
show_durationtrue if show duration for each test; otherwise false.

◆ shuffle_test() [1/2]

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

Gets shuffle tests.

Returns
Shuffle test.
Remarks
By default is set to false (no shuffle).

◆ shuffle_test() [2/2]

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

Sets shuffle tests.

Parameters
shuffle_testShuffle test.
Remarks
By default is set to false (no shuffle).

◆ start_time()

std::chrono::time_point<std::chrono::system_clock> xtd::tunit::settings::start_time ( ) const
inlinenoexcept

Gets unit test start time.

Returns
Unit test start time.

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