Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:28

0001 
0002 #include <iostream>
0003 
0004 #include "cppunit/extensions/HelperMacros.h"
0005 
0006 // ----------------------------------------------
0007 class testmaker : public CppUnit::TestFixture {
0008   CPPUNIT_TEST_SUITE(testmaker);
0009   CPPUNIT_TEST(makerTest);
0010   CPPUNIT_TEST_SUITE_END();
0011 
0012 public:
0013   void setUp() {}
0014   void tearDown() {}
0015   void makerTest();
0016 };
0017 
0018 ///registration of the test so that the runner can find it
0019 CPPUNIT_TEST_SUITE_REGISTRATION(testmaker);
0020 
0021 void testmaker::makerTest()
0022 //int main()
0023 {
0024   std::string param1 =
0025       "string module_type = \"TestMod\"\n "
0026       " string module_label = \"t1\"";
0027 
0028   std::string param2 =
0029       "string module_type = \"TestMod\" "
0030       "string module_label = \"t2\"";
0031 
0032   /*try {
0033 
0034     edmplugin::PluginManager::configure(edmplugin::standard::config());
0035     Factory* f = Factory::get();
0036 
0037     //Factory::Iterator ib(f->begin()),ie(f->end());
0038     //for(;ib!=ie;++ib)
0039     //  {
0040     //std::cout << (*ib)->name() << std::endl;
0041     // }
0042 
0043     std::shared_ptr<ParameterSet> p1 = makePSet(*edm::pset::parse(param1.c_str()));
0044     std::shared_ptr<ParameterSet> p2 = makePSet(*edm::pset::parse(param2.c_str()));
0045 
0046     std::cerr << p1->getParameter<std::string>("@module_type");
0047 
0048     edm::ExceptionToActionTable table;
0049 
0050     edm::ProductRegistry preg;
0051 
0052     std::unique_ptr<Worker> w1 = f->makeWorker(*p1, preg, table, "PROD", 0, 0);
0053     std::unique_ptr<Worker> w2 = f->makeWorker(*p2, preg, table, "PROD", 0, 0);
0054   }
0055   catch(cms::Exception& e) {
0056       std::cerr << "cms::Exception: " << e.explainSelf() << std::endl;
0057       throw;
0058   }
0059   catch(std::exception& e) {
0060       std::cerr << "std::Exception: " << e.what() << std::endl;
0061       throw;
0062   }
0063   catch(...) {
0064       std::cerr << "weird exception" << std::endl;
0065       throw;
0066   }
0067 
0068   return 0;*/
0069 }