Skip to content

Commit

Permalink
Add a test for the GenericConsumer
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Nov 20, 2023
1 parent 74c7484 commit bef578c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FWCore/Modules/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

<test name="TestFWCoreModulesEmptySourceRunsAndLumis" command="cmsRun ${LOCALTOP}/src/FWCore/Modules/test/emptysource_RunsAndLumis_cfg.py"/>

<test name="testGenericConsumer" command="cmsRun ${LOCALTOP}/src/FWCore/Modules/test/testGenericConsumer.py"/>

<bin file="test_catch2_*.cc" name="TestFWCoreModulesTP">
<use name="FWCore/TestProcessor"/>
<use name="catch2"/>
Expand Down
37 changes: 37 additions & 0 deletions FWCore/Modules/test/testGenericConsumer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Configuration file for EventContentAnalyzer

import FWCore.ParameterSet.Config as cms

process = cms.Process("TEST")

process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
process.options.wantSummary = True

process.load("FWCore.Modules.printContent_cfi")

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(5)
)

process.source = cms.Source("EmptySource")

process.thing = cms.EDProducer("ThingProducer")

process.anotherThing = cms.EDProducer("ThingProducer")

process.otherThing = cms.EDProducer("OtherThingProducer",
thingTag = cms.InputTag('anotherThing'),
transient = cms.untracked.bool(True)
)

process.task = cms.Task(
process.thing,
process.anotherThing,
process.otherThing
)

process.consumer = cms.EDAnalyzer("GenericConsumer",
eventProducts = cms.untracked.vstring("*_thing_*_*", "otherThing")
)

process.path = cms.Path(process.consumer, process.task)

0 comments on commit bef578c

Please sign in to comment.