Savarese Software Research Corporation

test_main.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2006-2008 Savarese Software Research Corporation
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.savarese.com/software/ApacheLicense-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef __SSRC_WISP_TEST_TEST_MAIN_H
00018 #define __SSRC_WISP_TEST_TEST_MAIN_H
00019 
00020 #include <cppunit/TestCase.h>
00021 #include <cppunit/extensions/HelperMacros.h>
00022 #include <cppunit/extensions/TestFactoryRegistry.h>
00023 #include <cppunit/TextTestRunner.h>
00024 
00025 using std::string;
00026 using CppUnit::TestCase;
00027 using CppUnit::TestFactoryRegistry;
00028 using CppUnit::TextTestRunner;
00029 
00030 #define WISP_TEST_MAIN(init_hook) \
00031 int main(int argc, char **argv) { \
00032   TextTestRunner runner; \
00033   TestFactoryRegistry & registry = TestFactoryRegistry::getRegistry();\
00034 \
00035   init_hook; \
00036 \
00037   runner.addTest(registry.makeTest());\
00038 \
00039   return (runner.run() ? 0 : -1);\
00040 }
00041 
00042 #endif

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