Savarese Software Research Corporation
test_main.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 Savarese Software Research Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.savarese.com/software/ApacheLicense-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __SSRC_WISP_TEST_TEST_MAIN_H
18 #define __SSRC_WISP_TEST_TEST_MAIN_H
19 
20 #include <cppunit/TestCase.h>
21 #include <cppunit/extensions/HelperMacros.h>
22 #include <cppunit/extensions/TestFactoryRegistry.h>
23 #include <cppunit/TextTestRunner.h>
24 
25 using CppUnit::TestCase;
26 using CppUnit::TestFactoryRegistry;
27 using CppUnit::TextTestRunner;
28 
29 #define WISP_TEST_MAIN(init_hook) \
30 int main(int argc, char **argv) { \
31  TextTestRunner runner; \
32  TestFactoryRegistry & registry = TestFactoryRegistry::getRegistry();\
33 \
34  init_hook; \
35 \
36  runner.addTest(registry.makeTest());\
37 \
38  return (runner.run() ? 0 : -1);\
39 }
40 
41 #endif

Savarese Software Research Corporation
Copyright © 2006-2012 Savarese Software Research Corporation. All rights reserved.