12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- /*##############################################################################
- HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ############################################################################## */
- #ifdef _USE_CPPUNIT
- #include "unittests.hpp"
- /*
- * This is the main unittest driver for HPCC. From here,
- * all unit tests, be they internal or external (API),
- * will run.
- *
- * All internal unit tests, written on the same source
- * files as the implementation they're testing, can be
- * dynamically linked via the helper class below.
- *
- * All external unit tests (API tests, test-driven
- * development, interface documentation and general
- * usability tests) should be implemented as source
- * files within the same directory as this file, and
- * statically linked together.
- *
- * CPPUnit will automatically recognise and run them all.
- */
- int main(int argc, char* argv[])
- {
- InitModuleObjects();
- // These are the internal unit tests covered by other modules and libraries
- Array objects;
- objects.append(*(new LoadedObject ("jhtree")));
- objects.append(*(new LoadedObject ("roxiemem")));
- objects.append(*(new LoadedObject ("thorhelper")));
- queryStderrLogMsgHandler()->setMessageFields(MSGFIELD_time);
- CppUnit::TextUi::TestRunner runner;
- if (argc==1)
- {
- CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
- runner.addTest( registry.makeTest() );
- }
- else
- {
- for (int name = 1; name < argc; name++)
- {
- CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(argv[name]);
- runner.addTest( registry.makeTest() );
- }
- }
- bool wasSucessful = runner.run( "", false );
- ExitModuleObjects();
- releaseAtoms();
- return wasSucessful;
- }
- #endif // _USE_CPPUNIT
|