CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
test_catch2_EDAnalyzer.cc
Go to the documentation of this file.
1 #include "catch.hpp"
4 
5 static constexpr auto s_tag = "[__class__]";
6 
7 TEST_CASE("Standard checks of __class__", s_tag) {
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 }
40 
41 //Add additional TEST_CASEs to exercise the modules capabilities
42 
edm::test::Event test(T &&...iArgs)
TEST_CASE("Standard checks of __class__", s_tag)
tuple config
parse the configuration file
static constexpr auto s_tag