tunit unit test library
More...
tunit unit test library
◆ class_cleanup_
#define class_cleanup_ |
( |
|
method_name | ) |
|
Value:__##method_name##_static() {} \
public:\
template<typename test_class> __class_cleanup_attribute(test_class& test) : class_cleanup_attribute(#method_name, test, &method_name, {__func__, __FILE__, __LINE__}) {__##method_name##_static();} \
} __class_cleanup_attribute {*this}; \
static void method_name()
This attribute is use to add cleaup class method to class test attribute.
Definition: class_cleanup_attribute.h:9
add cleaup class method to class test.
- Parameters
-
method_name | cleanup class method to add. |
◆ class_initialize_
#define class_initialize_ |
( |
|
method_name | ) |
|
Value:__##method_name##_static() {} \
public:\
template<typename test_class> __class_initialize_attribute(test_class& test) : class_initialize_attribute(#method_name, test, &method_name, {__func__, __FILE__, __LINE__}) {__##method_name##_static();} \
} __class_initialize_attribute {*this}; \
static void method_name()
This attribute is use to add initialize class method to class test attribute.
Definition: class_initialize_attribute.h:9
add initialize class method to class test.
- Parameters
-
method_name | cleanup class method to add. |
◆ line_info_
Get tunit::line_info informations.
- Returns
- tunit::line_info line informations.
- Examples
- The following example shows how to use the line_info_.
#include <xtd/xtd.tunit>
#include <iostream>
using namespace std;
using namespace xtd::tunit;
void trace_message(const string& message, const line_info& info) {
cout << "message: " << message << endl;
cout << "member name: " << info.member_name() << endl;
cout << "source file path: " << info.file_path() << endl;
cout << "source line number: " << info.line_number() << endl;
}
int main() {
}