/* * Copyright 2008, Yahoo! Inc. * * 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. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "Util.h" using namespace std; CPPUNIT_NS_BEGIN class EclipseOutputter: public CompilerOutputter { public: EclipseOutputter(TestResultCollector *result,ostream &stream): CompilerOutputter(result,stream,"%p:%l: "),stream_(stream) { } virtual void printFailedTestName( TestFailure *failure ){} virtual void printFailureMessage( TestFailure *failure ) { stream_<<": "; Message msg = failure->thrownException()->message(); stream_<< msg.shortDescription(); string text; for(int i=0; i the output must be in the compiler error format. //bool selfTest = (argc > 1) && (std::string("-ide") == argv[1]); globalTestConfig.addConfigFromCmdLine(argc,argv); // Create the event manager and test controller CPPUNIT_NS::TestResult controller; // Add a listener that colllects test result CPPUNIT_NS::TestResultCollector result; controller.addListener( &result ); // Add a listener that print dots as tests run. // CPPUNIT_NS::TextTestProgressListener progress; CPPUNIT_NS::BriefTestProgressListener progress; controller.addListener( &progress ); CPPUNIT_NS::TestRunner runner; runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); try { cout << "Running " << globalTestConfig.getTestName(); runner.run( controller, globalTestConfig.getTestName()); cout<