forked from banditcpp/bandit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.h
48 lines (39 loc) · 1.71 KB
/
grammar.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef BANDIT_GRAMMAR_H
#define BANDIT_GRAMMAR_H
#include <bandit/controller.h>
namespace bandit {
inline void describe(const std::string& desc, const std::function<void()>& func,
bool hard_skip = false,
detail::controller_t& controller = detail::registered_controller()) {
controller.describe(desc, func, hard_skip);
}
inline void describe_skip(const std::string& desc, const std::function<void()>& func,
detail::controller_t& controller = detail::registered_controller()) {
describe(desc, func, true, controller);
}
inline void xdescribe(const std::string& desc, const std::function<void()>& func,
detail::controller_t& controller = detail::registered_controller()) {
describe(desc, func, true, controller);
}
inline void before_each(const std::function<void()>& func,
detail::controller_t& controller = detail::registered_controller()) {
controller.before_each(func);
}
inline void after_each(const std::function<void()>& func,
detail::controller_t& controller = detail::registered_controller()) {
controller.after_each(func);
}
inline void it(const std::string& desc, const std::function<void()>& func,
bool hard_skip = false, detail::controller_t& controller = detail::registered_controller()) {
controller.it(desc, func, hard_skip);
}
inline void it_skip(const std::string& desc, const std::function<void()>& func,
detail::controller_t& controller = detail::registered_controller()) {
it(desc, func, true, controller);
}
inline void xit(const std::string& desc, const std::function<void()>& func,
detail::controller_t& controller = detail::registered_controller()) {
it(desc, func, true, controller);
}
}
#endif