The console_unit_test class is console unit test interface.
More...
#include <console_unit_test.h>
|
| console_unit_test () |
| Create a new console unit test. More...
|
|
| console_unit_test (char *argv[], int argc) |
| Create a new console unit test with argv specified and argc specified. More...
|
|
size_t | aborted_test_count () const noexcept |
|
std::vector< std::string > | aborted_test_names () const noexcept |
|
std::chrono::milliseconds | elapsed_time () const noexcept |
|
size_t | failed_test_count () const noexcept |
|
std::vector< std::string > | failed_test_names () const noexcept |
|
size_t | ignored_test_count () const noexcept |
|
std::vector< std::string > | ignored_test_names () const noexcept |
|
int | list_tests (const std::vector< std::string > &tests) override |
|
std::ostream & | ostream () |
| Gets the ostream used by this instance. More...
|
|
bool | parse_arguments (const std::vector< std::string > &args) override |
|
int | repeat_iteration () const noexcept |
|
int | repeat_iteration_count () const noexcept |
|
bool | repeat_tests () const noexcept |
|
int | run () |
| Runs all tests in this UnitTest object and prints the result. More...
|
|
size_t | succeed_test_count () const noexcept |
|
std::vector< std::string > | succeed_test_names () const noexcept |
|
size_t | test_cases_count () const noexcept |
|
size_t | test_count () const noexcept |
|
void | write_help () |
|
The console_unit_test class is console unit test interface.
- Examples
- This example sho how to instanciate and launch tests witn console unit test.
#include <xtd/xtd.tunit>
#include <sstream>
using namespace std;
using namespace xtd::tunit;
namespace unit_tests {
class test_class_(test) {
public:
void test_method_(test_case1) {
}
};
}
int main() {
}
◆ console_unit_test() [1/2]
tunit::console_unit_test::console_unit_test |
( |
| ) |
|
|
inline |
Create a new console unit test.
◆ console_unit_test() [2/2]
tunit::console_unit_test::console_unit_test |
( |
char * |
argv[], |
|
|
int |
argc |
|
) |
| |
|
inline |
Create a new console unit test with argv specified and argc specified.
- Parameters
-
argv | Arguments array from main method. |
argc | Argument count from main method. |
◆ ostream()
std::ostream& tunit::ostream_unit_test::ostream |
( |
| ) |
|
|
inlineinherited |
Gets the ostream used by this instance.
- Returns
- The ostream used by this instance.
- Warning
- Used it only if you need to write specific user messages. If you change or redirect it when tests running, the unit test output result will be indeterminate.
◆ run()
int tunit::unit_test::run |
( |
| ) |
|
|
inlineinherited |
Runs all tests in this UnitTest object and prints the result.
- Returns
- EXIT_SUCCESS (0) if succeed; otherwise return EXIT_FAILURE (1).
The documentation for this class was generated from the following file: