mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
created macro SET_SUITE_PARAMETERS
This commit is contained in:
parent
a6c56fe54b
commit
ab3cc22e57
2 changed files with 23 additions and 0 deletions
22
UnitTest++/ParameterizedMacros.h
Normal file
22
UnitTest++/ParameterizedMacros.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef UNITTEST_PARAMETERIZEDMACROS_H
|
||||
#define UNITTEST_PARAMETERIZEDMACROS_H
|
||||
|
||||
#include "ParameterizedSuite.h"
|
||||
|
||||
|
||||
#define SET_SUITE_PARAMETERS(Name, Type) \
|
||||
class ParameterizedCreator ## Name\
|
||||
{ \
|
||||
friend class ParameterizedSuite<## Type>; \
|
||||
public: \
|
||||
ParameterizedCreator ## Name() { create(); } \
|
||||
vector<## Type> parameters; \
|
||||
private: \
|
||||
void create(); \
|
||||
} parameterizedCreator ## Name ## Instance; \
|
||||
\
|
||||
ParameterizedSuite<##Type> ## Name(UnitTestSuite::GetSuiteName(), parameterizedCreator ## Name ## Instance.parameters); \
|
||||
\
|
||||
void ParameterizedCreator ## Name::create()
|
||||
|
||||
#endif
|
||||
|
|
@ -8,5 +8,6 @@
|
|||
#include "TestRunner.h"
|
||||
#include "TimeConstraint.h"
|
||||
#include "ReportAssert.h"
|
||||
#include "ParameterizedMacros.h"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue