xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.tunit
include
xtd
tunit
test_cleanup_attribute.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
test.hpp
"
6
8
namespace
xtd
{
10
namespace
tunit
{
21
class
test_cleanup_attribute
{
22
public
:
24
31
template
<
typename
test_
class
_t>
32
test_cleanup_attribute
(
const
std::string& name, test_class_t&
test_class
,
void
(*method)(),
const
xtd::diagnostics::stack_frame
& stack_frame =
xtd::diagnostics::stack_frame::current
()) noexcept {
test_class
.
add_test_cleanup
({name, method, stack_frame});}
34
};
35
}
36
}
37
44
#define test_cleanup_(method_name) \
45
__##method_name##_unused() = delete; \
46
struct __test_cleanup_attribute : xtd::tunit::test_cleanup_attribute { \
47
template<typename test_class> __test_cleanup_attribute(test_class& test) : test_cleanup_attribute(#method_name, test, &test_class::method_name) {} \
48
} __test_cleanup_attribute {*this}; \
49
static void method_name()
xtd::diagnostics::stack_frame
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition
stack_frame.hpp:46
xtd::diagnostics::stack_frame::current
static auto current(const xtd::diagnostics::source_location &value=xtd::diagnostics::source_location::current()) noexcept -> xtd::diagnostics::stack_frame
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
xtd::tunit::test_class
Represents a test class.
Definition
test_class.hpp:39
xtd::tunit::test_class::add_test_cleanup
auto add_test_cleanup(const xtd::tunit::test &test_cleanup) noexcept -> void
Adds the test cleanup method.
xtd::tunit::test_cleanup_attribute::test_cleanup_attribute
test_cleanup_attribute(const std::string &name, test_class_t &test_class, void(*method)(), const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) noexcept
Creates a new instance of test_cleanup_attribute with specified name, test class, method and stack fr...
Definition
test_cleanup_attribute.hpp:32
xtd::tunit
The tunit namespace contains a unit test library.
Definition
abort_error.hpp:10
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
test.hpp
Contains xtd::tunit::test class.
Generated on
for xtd by
Gammasoft
. All rights reserved.