xtd 0.2.0
test_class_attribute.h
Go to the documentation of this file.
1 #pragma once
5 #include "unit_test.h"
6 #include <memory>
7 #include <string>
8 
10 namespace xtd {
12  namespace tunit {
23  template <typename test_class_t>
24  class test_class_attribute final {
25  public:
27 
31  explicit test_class_attribute(const std::string& name) noexcept {xtd::tunit::unit_test::add({name, std::make_shared<test_class_t>()});}
33  };
34  }
35 }
36 
43 #define test_class_(class_name) \
44  class_name;\
45  xtd::tunit::test_class_attribute<class_name> __##class_name##_attribute {#class_name}; \
46  class class_name : public xtd::tunit::test_class
47 
78 #define test_class_from_(class_name, from_class_name) \
79  class_name;\
80  xtd::tunit::test_class_attribute<class_name> __##class_name##_attribute {#class_name}; \
81  class class_name : public from_class_name
Represents a test class attribute.
Definition: test_class_attribute.h:24
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
test_class_attribute(const std::string &name) noexcept
Creates a new instance of test_class_attribute with specified name.
Definition: test_class_attribute.h:31
Contains xtd::tunit::unit_test class.