From bef578c50443d9cacf2d6a32e053e2158819a689 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Mon, 20 Nov 2023 18:03:29 +0100 Subject: [PATCH] Add a test for the GenericConsumer --- FWCore/Modules/test/BuildFile.xml | 2 ++ FWCore/Modules/test/testGenericConsumer.py | 37 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 FWCore/Modules/test/testGenericConsumer.py diff --git a/FWCore/Modules/test/BuildFile.xml b/FWCore/Modules/test/BuildFile.xml index e18f700307177..6ac6a976af776 100644 --- a/FWCore/Modules/test/BuildFile.xml +++ b/FWCore/Modules/test/BuildFile.xml @@ -4,6 +4,8 @@ + + diff --git a/FWCore/Modules/test/testGenericConsumer.py b/FWCore/Modules/test/testGenericConsumer.py new file mode 100644 index 0000000000000..bb6915d1130e9 --- /dev/null +++ b/FWCore/Modules/test/testGenericConsumer.py @@ -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)