xtd 0.2.0
test_class_attribute.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "unit_test.hpp"
6#include <xtd/typeof>
7#include <xtd/string>
8
10namespace xtd {
12 namespace tunit {
23 template<class test_class_t>
25 public:
27
31 explicit test_class_attribute(const xtd::string& name) noexcept {xtd::tunit::unit_test::add({name, xtd::new_sptr<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 {typeof_<class_name>().full_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 {typeof_<class_name>().full_name()}; \
81 class class_name : public from_class_name
test_class_attribute(const xtd::string &name) noexcept
Creates a new instance of test_class_attribute with specified name.
Definition test_class_attribute.hpp:31
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
sptr< type_t > new_sptr(args_t &&... args)
xtd::new_sptr operator creates a xtd::sptr object.
Definition new_sptr.hpp:24
The tunit namespace contains a unit test library.
Definition abort_error.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::tunit::unit_test class.