-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases.hpp
34 lines (26 loc) · 1003 Bytes
/
aliases.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __CPP_TEST__MACROS__ALIASES_HPP__
#define __CPP_TEST__MACROS__ALIASES_HPP__
#include "./../includes/Test.hpp"
#include "./../includes/Result.hpp"
#include "./../includes/Register.hpp"
#define CONCAT(a, b) a ## b
#define EXPECT(value) __test__result__.expect(#value, value)
#define TO_BE(value) toBe(__FILE__, __LINE__, value)
#define TO_NOT_BE(value) toNotBe(__FILE__, __LINE__, value)
#define TO_BE_NULL() toBeNull(__FILE__, __LINE__)
#define TO_NOT_BE_NULL() toNotBeNull(__FILE__, __LINE__)
#define TO_BE_TRUE() TO_BE(true)
#define TO_BE_FALSE() TO_BE(false)
#define _TEST(description, runner, line)\
class CONCAT(_test_,line) : public Test::Test\
{\
public:\
CONCAT(_test_,line) () : Test::Test(__FILE__, description){}\
void run(Test::Result & __test__result__)\
{\
runner\
}\
};\
Test::Register<CONCAT(_test_,line)> CONCAT(_register_,line);
#define TEST(description, runner) _TEST(description, runner, __LINE__)
#endif