4
* Copyright (C) 2010 Eric Day (eday@oddments.org)
7
* Use and distribution licensed under the BSD license. See the
8
* COPYING file in the root project directory for full text.
13
* @brief Common Declarations and Macros
16
#ifndef SCALESTACK_TESTCOMMON_H
17
#define SCALESTACK_TESTCOMMON_H
22
#define TEST_BEGIN(name) \
23
static void test_ ## name(void) \
26
std::cout << " " << #name << "..."; \
30
std::cout << "ok" << std::endl; \
33
#define TEST_RUNNER_BEGIN(name) \
34
int main(int argc, char* argv[]) \
36
if (argc == 2 && std::string(argv[1]) == "-v") \
37
_test_verbose = true; \
39
std::cout << std::endl << #name << std::endl; \
41
#define TEST_RUNNER_END \
45
#define TEST_RUN(name) test_ ## name()
47
static bool _test_verbose = false;
49
#endif /* SCALESTACK_TESTCOMMON_H */