Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-22 22:55:13

0001 #include "FWCore/TestProcessor/interface/TestProcessor.h"
0002 #include "FWCore/Utilities/interface/Exception.h"
0003 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0004 
0005 #define CATCH_CONFIG_MAIN
0006 #include "catch.hpp"
0007 
0008 TEST_CASE("GeneralPurposeTrackAnalyzer tests", "[GeneralPurposeTrackAnalyzer]") {
0009   //The python configuration
0010   const std::string baseConfig{
0011       R"_(from FWCore.TestProcessor.TestProcess import *
0012 from Alignment.OfflineValidation.GeneralPurposeTrackAnalyzer_cfi import GeneralPurposeTrackAnalyzer
0013 process = TestProcess()
0014 process.trackAnalyzer = GeneralPurposeTrackAnalyzer
0015 process.moduleToTest(process.trackAnalyzer)
0016 process.add_(cms.Service('MessageLogger'))
0017 process.add_(cms.Service('TFileService',fileName=cms.string('tesTrackAnalyzer1.root')))
0018 )_"};
0019 
0020   edm::test::TestProcessor::Config config{baseConfig};
0021   SECTION("base configuration is OK") { REQUIRE_NOTHROW(edm::test::TestProcessor(config)); }
0022 
0023   // SECTION("No event data") {
0024   //   edm::test::TestProcessor tester(config);
0025   //   REQUIRE_NOTHROW(tester.test());
0026   // }
0027 
0028   // SECTION("beginJob and endJob only") {
0029   //   edm::test::TestProcessor tester(config);
0030   //   REQUIRE_NOTHROW(tester.testBeginAndEndJobOnly());
0031   // }
0032 
0033   // SECTION("Run with no LuminosityBlocks") {
0034   //   edm::test::TestProcessor tester(config);
0035   //   REQUIRE_NOTHROW(tester.testRunWithNoLuminosityBlocks());
0036   // }
0037 
0038   // SECTION("LuminosityBlock with no Events") {
0039   //   edm::test::TestProcessor tester(config);
0040   //   REQUIRE_NOTHROW(tester.testLuminosityBlockWithNoEvents());
0041   // }
0042 }
0043 
0044 TEST_CASE("DMRChecker tests", "[DMRChecker]") {
0045   //The python configuration
0046   const std::string baseConfig{
0047       R"_(from FWCore.TestProcessor.TestProcess import *
0048 from Alignment.OfflineValidation.DMRChecker_cfi import DMRChecker
0049 process = TestProcess()
0050 process.dmrAnalyzer = DMRChecker
0051 process.moduleToTest(process.dmrAnalyzer)
0052 process.add_(cms.Service('MessageLogger'))
0053 process.add_(cms.Service('TFileService',fileName=cms.string('tesTrackAnalyzer2.root')))
0054 )_"};
0055 
0056   edm::test::TestProcessor::Config config{baseConfig};
0057   SECTION("base configuration is OK") { REQUIRE_NOTHROW(edm::test::TestProcessor(config)); }
0058 
0059   // SECTION("No event data") {
0060   //   edm::test::TestProcessor tester(config);
0061   //   REQUIRE_NOTHROW(tester.test());
0062   // }
0063 
0064   // SECTION("beginJob and endJob only") {
0065   //   edm::test::TestProcessor tester(config);
0066   //   REQUIRE_NOTHROW(tester.testBeginAndEndJobOnly());
0067   // }
0068 
0069   // SECTION("Run with no LuminosityBlocks") {
0070   //   edm::test::TestProcessor tester(config);
0071   //   REQUIRE_NOTHROW(tester.testRunWithNoLuminosityBlocks());
0072   // }
0073 
0074   // SECTION("LuminosityBlock with no Events") {
0075   //   edm::test::TestProcessor tester(config);
0076   //   REQUIRE_NOTHROW(tester.testLuminosityBlockWithNoEvents());
0077   // }
0078 }