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.
test_initialize_attribute.h
Go to the documentation of this file.
1 #pragma once
5 #include "test.h"
6 
8 namespace xtd {
10  namespace tunit {
12  public:
13  template<typename test_class_t>
14  test_initialize_attribute(const std::string& name, test_class_t& test_class, void (*method)()) noexcept : test_initialize_attribute(name, test_class, method, xtd::diagnostics::stack_frame()) {}
15 
16  template<typename test_class_t>
17  test_initialize_attribute(const std::string& name, test_class_t& test_class, void (*method)(), const xtd::diagnostics::stack_frame& caller) noexcept {test_class.add_test_initialize({name, method, caller});}
18  };
19  }
20 }
21 
22 #define test_initialize_(method_name) \
23  __##method_name##_unused() = delete; \
24  class __test_initialize_attribute : public xtd::tunit::test_initialize_attribute { \
25  public:\
26  template<typename test_class> __test_initialize_attribute(test_class& test) : test_initialize_attribute(#method_name, test, &test_class::method_name, {__FILE__, __LINE__, __func__}) {} \
27  } __test_initialize_attribute {*this}; \
28  static void method_name()
29 
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:29
Definition: test_class.h:25
Definition: test_initialize_attribute.h:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::tunit::test class.