CMS 3D CMS Logo

Functions | Variables
test_catch2_EDAnalyzer.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 auto s_tag = "[__class__]"
 

Function Documentation

TEST_CASE ( "Standard checks of __class__ ,
s_tag   
)

Definition at line 7 of file test_catch2_EDAnalyzer.cc.

References 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 *
10 process = TestProcess()
11 process.toTest = cms.EDProducer("__class__"
12 #necessary configuration parameters
13  )
14 process.moduleToTest(process.toTest)
15 )_"
16  };
17 
19  SECTION("base configuration is OK") {
20  REQUIRE_NOTHROW(edm::test::TestProcessor(config));
21  }
22 
23  SECTION("No event data") {
25 
26  REQUIRE_THROWS_AS(tester.test(), cms::Exception);
27  //If the module does not throw when given no data, substitute
28  //REQUIRE_NOTHROW for REQUIRE_THROWS_AS
29  }
30 
31  SECTION("beginJob and endJob only") {
33 
34  REQUIRE_NOTHROW(tester.testBeginAndEndJobOnly());
35  }
36 
37  SECTION("Run with no LuminosityBlocks") {
39 
40  REQUIRE_NOTHROW(tester.testRunWithNoLuminosityBlocks());
41  }
42 
43  SECTION("LuminosityBlock with no Events") {
45 
46  REQUIRE_NOTHROW(tester.testLuminosityBlockWithNoEvents());
47  }
48 
49 }
Definition: config.py:1

Variable Documentation

auto s_tag = "[__class__]"
static

Definition at line 5 of file test_catch2_EDAnalyzer.cc.