xtd 0.2.0
Loading...
Searching...
No Matches
class_initialize_attribute.h
Go to the documentation of this file.
1
4#pragma once
5#include "test.h"
6
8namespace xtd {
10 namespace tunit {
22 public:
24
30 template<typename test_class_t>
31 class_initialize_attribute(const std::string& name, test_class_t& test_class, void (*method)()) noexcept : class_initialize_attribute(name, test_class, method, xtd::diagnostics::stack_frame()) {}
37 template<typename test_class_t>
38 class_initialize_attribute(const std::string& name, test_class_t& test_class, void (*method)(), const xtd::diagnostics::stack_frame& caller) noexcept {test_class.add_class_initialize({name, method, caller});}
40 };
41 }
42}
43
52#define class_initialize_(method_name) \
53 __##method_name##_static() {} \
54 class __class_initialize_attribute : public xtd::tunit::class_initialize_attribute { \
55 public:\
56 template<typename test_class> __class_initialize_attribute(test_class& test) : class_initialize_attribute(#method_name, test, &method_name, {__FILE__, __LINE__, __func__}) {__##method_name##_static();} \
57 } __class_initialize_attribute {*this}; \
58 static void method_name()
59
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
This attribute is use to add initialize class method to class test attribute.
Definition class_initialize_attribute.h:21
class_initialize_attribute(const std::string &name, test_class_t &test_class, void(*method)()) noexcept
Creates new instance of class initialize_attribute attribute.
Definition class_initialize_attribute.h:31
class_initialize_attribute(const std::string &name, test_class_t &test_class, void(*method)(), const xtd::diagnostics::stack_frame &caller) noexcept
Creates new instance of class initialize_attribute attribute.
Definition class_initialize_attribute.h:38
Represents a test class.
Definition test_class.h:39
void add_class_initialize(const xtd::tunit::test &class_initialize) noexcept
Adds the class initialize method.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::tunit::test class.