CMS 3D CMS Logo

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()

TEST_CASE ( "Standard checks of __class__ ,
s_tag   
)

Definition at line 7 of file test_catch2_EDProducer.cc.

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

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

Variable Documentation

◆ s_tag

constexpr auto s_tag = "[__class__]"
staticconstexpr

Definition at line 5 of file test_catch2_EDProducer.cc.

edm::test::TestProcessorConfig
Definition: TestProcessor.h:89
config
Definition: config.py:1
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::test::TestProcessor
Definition: TestProcessor.h:157
Exception
Definition: hltDiff.cc:246