OTest2
A C++ testing framework
controls.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OTest2__INCLUDE_OTEST2_CONTROLS_H_
20 #define OTest2__INCLUDE_OTEST2_CONTROLS_H_
21 
22 #ifndef OTEST2_PARSER_ACTIVE
23 
24 #define TEST_CONTROLS_SWITCH_STATE()
25 #define TEST_CONTROLS_SECTION_NAME()
26 
27 #else /* -- OTEST2_PARSER_ACTIVE */
28 
29 #define TEST_CONTROLS_SWITCH_STATE() __attribute__((annotate("otest2::switchState")))
30 #define TEST_CONTROLS_SECTION_NAME() __attribute__((annotate("otest2::section")))
31 
32 #endif /* -- OTEST2_PARSER_ACTIVE */
33 
34 namespace OTest2 {
35 
36 namespace Controls {
37 
48 template<typename... Args_>
49 void switchState(
50  void (*state_)(Args_... args_),
51  int delay_) TEST_CONTROLS_SWITCH_STATE();
52 
53 namespace Private {
54 
62 bool sectionName(const char* section_name_) TEST_CONTROLS_SECTION_NAME();
63 
64 } /* -- namespace Private */
65 
66 } /* -- namespace Controls */
67 
68 } /* -- namespace OTest2 */
69 
70 #endif /* OTest2__INCLUDE_OTEST2_CONTROLS_H_ */
OTest2::Controls::Private::sectionName
bool sectionName(const char *section_name_) TEST_CONTROLS_SECTION_NAME()
A function marking start of a section.
OTest2::Controls::switchState
void switchState(void(*state_)(Args_... args_), int delay_) TEST_CONTROLS_SWITCH_STATE()
Prepare next test state.
OTest2
Definition: assertbean.h:25
TEST_CONTROLS_SWITCH_STATE
#define TEST_CONTROLS_SWITCH_STATE()
Definition: controls.h:24
TEST_CONTROLS_SECTION_NAME
#define TEST_CONTROLS_SECTION_NAME()
Definition: controls.h:25