24 #ifndef SdoService_cpp 25 #define SdoService_cpp 27 #include <cppunit/ui/text/TestRunner.h> 28 #include <cppunit/TextOutputter.h> 29 #include <cppunit/extensions/TestFactoryRegistry.h> 30 #include <cppunit/extensions/HelperMacros.h> 31 #include <cppunit/TestAssert.h> 45 :
public CppUnit::TestFixture
48 CPPUNIT_TEST(test_getProfile);
49 CPPUNIT_TEST(test_set_getName);
50 CPPUNIT_TEST(test_set_getInterfaceType);
51 CPPUNIT_TEST(test_set_getIdlDefinition);
52 CPPUNIT_TEST(test_set_getProperties);
53 CPPUNIT_TEST(test_set_getServiceRef);
54 CPPUNIT_TEST_SUITE_END();
121 int main(
int argc,
char* argv[])
134 std::string arg(argv[i]);
135 std::string next_arg;
136 if (i + 1 < argc) next_arg = argv[i + 1];
139 if (arg ==
"--text") { format =
TEXT_OUT;
break; }
152 ofs.open(fname.c_str());
154 if ( arg ==
"--compiler" ) { format =
COMPILER_OUT;
break; }
155 if ( arg ==
"--cerr" ) { target = 1;
break; }
156 if ( arg ==
"--xsl" )
158 if (next_arg ==
"") xsl =
"default.xsl";
161 if ( arg ==
"--namespace" )
165 std::cerr <<
"no namespace specified" << std::endl;
175 CppUnit::TextUi::TestRunner runner;
177 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
179 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry(ns).makeTest());
180 CppUnit::Outputter* outputter = 0;
181 std::ostream* stream = target ? &std::cerr : &std::cout;
185 outputter =
new CppUnit::TextOutputter(&runner.result(),*stream);
188 std::cout <<
"XML_OUT" << std::endl;
189 outputter =
new CppUnit::XmlOutputter(&runner.result(),
191 static_cast<CppUnit::XmlOutputter*
>(outputter)->setStyleSheet(xsl);
194 outputter =
new CppUnit::CompilerOutputter(&runner.result(),*stream);
197 runner.setOutputter(outputter);
202 #endif // SdoService_cpp
int main(int argc, char **argv)
void test_set_getProperties()
virtual void tearDown()
Test finalization.
void test_set_getServiceRef()
SdoServiceTests()
Constructor.
virtual void setUp()
Test initialization.
void test_set_getInterfaceType()
void test_set_getIdlDefinition()
CPPUNIT_TEST_SUITE_REGISTRATION(SdoService::SdoServiceTests)
~SdoServiceTests()
Destructor.