Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions FWCore/Framework/test/stubs/DeleteEarlyModules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ namespace edmtest {
public:
explicit DeleteEarlyProducer(edm::ParameterSet const& pset) { produces<DeleteEarly>(); }

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
descriptions.addDefault(desc);
Copy link
Contributor

@Martin-Grunewald Martin-Grunewald Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it here and below all addDefault as opposed to addWithDefaultLabel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the I personally recommends not using addWithDefaultLabel, especially in cases where there is no useful default (which is very much the case for many of the test modules).

}

void beginJob() override {
// Needed because DeleteEarly objects may be allocated and deleted in initialization
edmtest::DeleteEarly::resetDeleteCount();
Expand All @@ -48,6 +53,12 @@ namespace edmtest {
m_put = produces<edm::RefProd<DeleteEarly>>();
}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("get");
descriptions.addDefault(desc);
}

void produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const override {
auto h = e.getHandle(m_token);
e.emplace(m_put, h);
Expand All @@ -63,6 +74,12 @@ namespace edmtest {
DeleteEarlyReader(edm::ParameterSet const& pset)
: getToken_(consumes(pset.getUntrackedParameter<edm::InputTag>("tag"))) {}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<edm::InputTag>("tag");
descriptions.addDefault(desc);
}

void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const override { e.get(getToken_); }

private:
Expand All @@ -75,6 +92,12 @@ namespace edmtest {
consumes<DeleteEarly>(pset.getUntrackedParameter<edm::InputTag>("tag"));
}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<edm::InputTag>("tag");
descriptions.addDefault(desc);
}

void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override {}

private:
Expand All @@ -85,6 +108,12 @@ namespace edmtest {
DeleteEarlyRefProdReader(edm::ParameterSet const& pset)
: getToken_(consumes(pset.getUntrackedParameter<edm::InputTag>("tag"))) {}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<edm::InputTag>("tag");
descriptions.addDefault(desc);
}

void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const override { e.get(getToken_).get(); }

private:
Expand All @@ -96,6 +125,12 @@ namespace edmtest {
DeleteEarlyCheckDeleteAnalyzer(edm::ParameterSet const& pset)
: m_expectedValues(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedValues")), m_index(0) {}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<std::vector<unsigned int>>("expectedValues");
descriptions.addDefault(desc);
}

void analyze(edm::Event const&, edm::EventSetup const&) override {
if (DeleteEarly::nDeletes() != m_expectedValues.at(m_index)) {
throw cms::Exception("DeleteEarlyError")
Expand Down
28 changes: 26 additions & 2 deletions FWCore/Framework/test/stubs/HistoryAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ namespace edmtest {
void analyze(edm::Event const& event, edm::EventSetup const&);
void endJob();

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
typedef std::vector<std::string> vstring;

Expand All @@ -54,7 +56,7 @@ namespace edmtest {
: expectedSize_(params.getParameter<int>("expectedSize")),
eventCount_(0),
expectedCount_(params.getParameter<int>("expectedCount")),
expectedSelectEventsInfo_(params.getParameter<std::vector<edm::ParameterSet> >("expectedSelectEventsInfo")),
expectedSelectEventsInfo_(params.getParameter<std::vector<edm::ParameterSet>>("expectedSelectEventsInfo")),
expectedPaths_(params.getParameter<vstring>("expectedPaths")),
expectedEndPaths_(params.getParameter<vstring>("expectedEndPaths")),
expectedModules_(params.getParameter<vstring>("expectedModules")),
Expand All @@ -63,6 +65,28 @@ namespace edmtest {
expectedDropFromProcPSet_(params.getParameter<vstring>("expectedDropFromProcPSet")),
expectedModulesOnEndPaths_(params.getParameter<edm::ParameterSet>("expectedModulesOnEndPaths")) {}

void HistoryAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<int>("expectedSize");
desc.add<int>("expectedCount");
edm::ParameterSetDescription expectedDesc;
expectedDesc.add<std::vector<int>>("EndPathPositions");
expectedDesc.add<std::vector<std::string>>("EndPaths");
expectedDesc.add<bool>("InProcessHistory");
expectedDesc.add<std::vector<std::string>>("SelectEvents");
desc.addVPSet("expectedSelectEventsInfo", expectedDesc);
desc.add<std::vector<std::string>>("expectedPaths");
desc.add<std::vector<std::string>>("expectedEndPaths");
desc.add<std::vector<std::string>>("expectedModules");
desc.add<std::vector<std::string>>("expectedDroppedEndPaths");
desc.add<std::vector<std::string>>("expectedDroppedModules");
desc.add<std::vector<std::string>>("expectedDropFromProcPSet");
edm::ParameterSetDescription modulesOnEndPathsDesc;
modulesOnEndPathsDesc.addWildcard<std::vector<std::string>>("*");
desc.add<edm::ParameterSetDescription>("expectedModulesOnEndPaths", modulesOnEndPathsDesc);
descriptions.addDefault(desc);
}

void HistoryAnalyzer::analyze(edm::Event const& event, edm::EventSetup const&) {
edm::EventSelectionIDVector const& esv = event.eventSelectionIDs();
assert(esv.size() == static_cast<size_t>(expectedSize_));
Expand Down Expand Up @@ -97,7 +121,7 @@ namespace edmtest {
assert(paths == expectedPaths_);

for (vstring::const_iterator i = paths.begin(), iEnd = paths.end(); i != iEnd; ++i) {
vstring modulesOnPath = proc_pset.getParameter<std::vector<std::string> >(*i);
vstring modulesOnPath = proc_pset.getParameter<std::vector<std::string>>(*i);
assert(!modulesOnPath.empty());
}
}
Expand Down
11 changes: 11 additions & 0 deletions FWCore/Framework/test/stubs/TestGetPathStatus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace edmtest {

void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
std::vector<int> expectedStates_;
std::vector<unsigned int> expectedIndexes_;
Expand All @@ -38,6 +40,15 @@ namespace edmtest {
tokenPathStatus_(consumes(pset.getParameter<edm::InputTag>("pathStatusTag"))),
tokenEndPathStatus_(consumes(pset.getParameter<edm::InputTag>("endPathStatusTag"))) {}

void TestGetPathStatus::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::vector<int>>("expectedStates");
desc.add<std::vector<unsigned int>>("expectedIndexes");
desc.add<edm::InputTag>("pathStatusTag");
desc.add<edm::InputTag>("endPathStatusTag");
descriptions.addDefault(desc);
}

void TestGetPathStatus::analyze(edm::StreamID, edm::Event const& event, edm::EventSetup const&) const {
auto const& pathStatus = event.get(tokenPathStatus_);

Expand Down
6 changes: 6 additions & 0 deletions FWCore/Framework/test/stubs/TestSchedulerModule1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ class TestSchedulerModule1 : public global::EDProducer<> {

void produce(StreamID, Event& e, EventSetup const&) const final;

static void fillDescriptions(ConfigurationDescriptions& descriptions) {
ParameterSetDescription desc;
desc.add<std::string>("module_name");
descriptions.addDefault(desc);
}

private:
ParameterSet pset_;
};
Expand Down
6 changes: 6 additions & 0 deletions FWCore/Framework/test/stubs/TestSchedulerModule2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ namespace edm {

void produce(StreamID, Event& e, EventSetup const&) const final;

static void fillDescriptions(ConfigurationDescriptions& descriptions) {
ParameterSetDescription desc;
desc.add<std::string>("module_name");
descriptions.addDefault(desc);
}

private:
ParameterSet pset_;
};
Expand Down
5 changes: 5 additions & 0 deletions FWCore/Framework/test/stubs/ToyAnalyzers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ namespace edmtest {
explicit NonAnalyzer(edm::ParameterSet const& /*p*/) {}
~NonAnalyzer() override {}
void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& c) const final;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
descriptions.addDefault(desc);
}
};

void NonAnalyzer::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {}
Expand Down
6 changes: 6 additions & 0 deletions FWCore/Framework/test/stubs/ToyDoubleProducers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ namespace edmtest {
explicit ToyDoubleProducer(double d) : value_(d) { produces<DoubleProduct>(); }
void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<double>("dvalue");
descriptions.addDefault(desc);
}

private:
double value_;
};
Expand Down
17 changes: 17 additions & 0 deletions FWCore/Integration/plugins/AssociationMapAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ namespace edmtest {
explicit AssociationMapAnalyzer(edm::ParameterSet const&);
void analyze(edm::StreamID, edm::Event const& event, edm::EventSetup const&) const override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

edm::EDGetTokenT<std::vector<int>> inputToken1_;
edm::EDGetTokenT<std::vector<int>> inputToken2_;
edm::EDGetTokenT<edm::View<int>> inputToken1V_;
Expand Down Expand Up @@ -63,6 +65,21 @@ namespace edmtest {
associationMapToken8_ = consumes<AssocOneToOneView>(pset.getParameter<edm::InputTag>("associationMapTag8"));
}

void AssociationMapAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("inputTag1");
desc.add<edm::InputTag>("inputTag2");
desc.add<edm::InputTag>("associationMapTag1");
desc.add<edm::InputTag>("associationMapTag2");
desc.add<edm::InputTag>("associationMapTag3");
desc.add<edm::InputTag>("associationMapTag4");
desc.add<edm::InputTag>("associationMapTag5");
desc.add<edm::InputTag>("associationMapTag6");
desc.add<edm::InputTag>("associationMapTag7");
desc.add<edm::InputTag>("associationMapTag8");
descriptions.addDefault(desc);
}

void AssociationMapAnalyzer::analyze(edm::StreamID, edm::Event const& event, edm::EventSetup const&) const {
edm::Handle<std::vector<int>> inputCollection1 = event.getHandle(inputToken1_);

Expand Down
10 changes: 8 additions & 2 deletions FWCore/Integration/plugins/AssociationMapProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ namespace edmtest {
class AssociationMapProducer : public edm::one::EDProducer<> {
public:
explicit AssociationMapProducer(edm::ParameterSet const&);
~AssociationMapProducer() override;

void produce(edm::Event&, edm::EventSetup const&) override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

typedef edm::AssociationMap<edm::OneToValue<std::vector<int>, double> > AssocOneToValue;
typedef edm::AssociationMap<edm::OneToOne<std::vector<int>, std::vector<int> > > AssocOneToOne;
typedef edm::AssociationMap<edm::OneToMany<std::vector<int>, std::vector<int> > > AssocOneToMany;
Expand Down Expand Up @@ -65,7 +66,12 @@ namespace edmtest {
produces<AssocOneToOneView>("twoArg");
}

AssociationMapProducer::~AssociationMapProducer() {}
void AssociationMapProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("inputTag1");
desc.add<edm::InputTag>("inputTag2");
descriptions.addDefault(desc);
}

void AssociationMapProducer::produce(edm::Event& event, edm::EventSetup const&) {
edm::Handle<std::vector<int> > inputCollection1 = event.getHandle(inputToken1_);
Expand Down
12 changes: 12 additions & 0 deletions FWCore/Integration/plugins/ManyProductProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ namespace edmtest {

void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<unsigned int>("nProducts", 1);
descriptions.addDefault(desc);
}

private:
unsigned int nProducts_;
std::vector<std::string> instanceNames_;
Expand Down Expand Up @@ -50,6 +56,12 @@ namespace edmtest {

void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const final;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<unsigned int>("nProducts", 1);
descriptions.addDefault(desc);
}

private:
unsigned int nProducts_;
std::vector<edm::InputTag> tags_;
Expand Down
9 changes: 9 additions & 0 deletions FWCore/Integration/plugins/MaybeUninitializedIntAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/global/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/InputTag.h"
Expand All @@ -22,6 +24,13 @@ namespace edmtest {
}
}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<int32_t>("value");
desc.add<edm::InputTag>("source");
descriptions.addDefault(desc);
}

private:
const cms_int32_t value_;
const edm::EDGetTokenT<MaybeUninitializedIntProduct> token_;
Expand Down
8 changes: 8 additions & 0 deletions FWCore/Integration/plugins/MaybeUninitializedIntProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Utilities/interface/EDPutToken.h"

namespace edmtest {
Expand All @@ -15,6 +17,12 @@ namespace edmtest {
event.emplace(token_, value_);
}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<int32_t>("value");
descriptions.addDefault(desc);
}

private:
const cms_int32_t value_;
const edm::EDPutTokenT<MaybeUninitializedIntProduct> token_;
Expand Down
9 changes: 7 additions & 2 deletions FWCore/Integration/plugins/MissingDictionaryTestProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ namespace edmtest {
class MissingDictionaryTestProducer : public edm::one::EDProducer<> {
public:
explicit MissingDictionaryTestProducer(edm::ParameterSet const&);
~MissingDictionaryTestProducer() override;

void produce(edm::Event&, edm::EventSetup const&) override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
edm::EDGetTokenT<MissingDictionaryTestA> inputToken1_;
edm::EDGetTokenT<std::vector<MissingDictionaryTestA> > inputToken2_;
Expand All @@ -52,7 +53,11 @@ namespace edmtest {
produces<std::list<MissingDictionaryTestA> >();
}

MissingDictionaryTestProducer::~MissingDictionaryTestProducer() {}
void MissingDictionaryTestProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("inputTag");
descriptions.addDefault(desc);
}

void MissingDictionaryTestProducer::produce(edm::Event& event, edm::EventSetup const&) {
edm::Handle<MissingDictionaryTestA> h1;
Expand Down
8 changes: 6 additions & 2 deletions FWCore/Integration/plugins/PathAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ namespace edmtest {
class PathAnalyzer : public edm::global::EDAnalyzer<> {
public:
explicit PathAnalyzer(edm::ParameterSet const&);
~PathAnalyzer() override;

void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override;
void beginJob() override;
void endJob() override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
void dumpTriggerNamesServiceInfo(char const* where) const;
}; // class PathAnalyzer
Expand All @@ -31,7 +32,10 @@ namespace edmtest {

PathAnalyzer::PathAnalyzer(edm::ParameterSet const&) {}

PathAnalyzer::~PathAnalyzer() {}
void PathAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
descriptions.addDefault(desc);
}

void PathAnalyzer::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {
dumpTriggerNamesServiceInfo("analyze");
Expand Down
Loading