CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
test_catch2_EDProducer.cc File Reference
#include "catch.hpp"
#include "FWCore/TestProcessor/interface/TestProcessor.h"
#include "FWCore/Utilities/interface/Exception.h"

Go to the source code of this file.

Functions

 TEST_CASE ("Standard checks of __class__", s_tag)
 

Variables

static constexpr auto s_tag = "[__class__]"
 

Function Documentation

TEST_CASE ( "Standard checks of __class__ ,
s_tag   
)

Definition at line 7 of file test_catch2_EDProducer.cc.

References submitPVResolutionJobs::config, Exception, AlCaHLTBitMon_QueryRunRegistry::string, edm::test::TestProcessor::test(), edm::test::TestProcessor::testBeginAndEndJobOnly(), edm::test::TestProcessor::testLuminosityBlockWithNoEvents(), and edm::test::TestProcessor::testRunWithNoLuminosityBlocks().

7  {
8  const std::string baseConfig{
9  R"_(from FWCore.TestProcessor.TestProcess import * process = TestProcess() process.toTest = cms.EDProducer("__class__" #necessary configuration parameters ) process.moduleToTest(process.toTest) )_"};
10 
12  SECTION("base configuration is OK") { REQUIRE_NOTHROW(edm::test::TestProcessor(config)); }
13 
14  SECTION("No event data") {
16 
17  REQUIRE_THROWS_AS(tester.test(), cms::Exception);
18  //If the module does not throw when given no data, substitute
19  //REQUIRE_NOTHROW for REQUIRE_THROWS_AS
20  }
21 
22  SECTION("beginJob and endJob only") {
24 
25  REQUIRE_NOTHROW(tester.testBeginAndEndJobOnly());
26  }
27 
28  SECTION("Run with no LuminosityBlocks") {
30 
31  REQUIRE_NOTHROW(tester.testRunWithNoLuminosityBlocks());
32  }
33 
34  SECTION("LuminosityBlock with no Events") {
36 
37  REQUIRE_NOTHROW(tester.testLuminosityBlockWithNoEvents());
38  }
39 }

Variable Documentation

constexpr auto s_tag = "[__class__]"
static

Definition at line 5 of file test_catch2_EDProducer.cc.