2 #define BOOST_TEST_MODULE (prune_config test) 3 #include "boost/test/unit_test.hpp" 26 BOOST_CHECK_EXCEPTION(
27 check_configuration(config),
art::Exception, [&error_msg](
auto const&
e) {
29 e.what() == error_msg;
34 BOOST_AUTO_TEST_SUITE(prune_config_t)
38 check_configuration({});
46 " p: { module_type: PMTestAnalyzer } " 49 " p: { module_type: PMTestFilter } " 54 "---- Configuration BEGIN\n" 55 " An error occurred while processing module configurations.\n" 56 " Module label 'p' has been used in 'physics.analyzers' and " 57 "'physics.filters'.\n" 58 " Module labels must be unique across an art process.\n" 59 "---- Configuration END\n"};
60 check_exception(
config, err_msg);
68 " a: { module_type: PMTestAnalyzer } " 71 " f: { module_type: PMTestFilter } " 74 " p: { module_type: PMTestProducer } " 79 "---- Configuration BEGIN\n" 80 " An error occurred while processing a path configuration.\n" 81 " The following modules specified in path p1 are observers when all\n" 82 " other modules are modifiers:\n" 84 "---- Configuration END\n"};
85 check_exception(
config, err_msg);
92 "---- Configuration BEGIN\n" 93 " The following error occurred while processing path configurations:\n" 94 " Unknown path x1 has been specified in 'trigger_paths'.\n" 95 "---- Configuration END\n"};
96 check_exception(
config, err_msg);
103 "---- Configuration BEGIN\n" 104 " The following error occurred while processing path configurations:\n" 105 " Unknown path x1 has been specified in 'end_paths'.\n" 106 " Unknown path d6 has been specified in 'end_paths'.\n" 107 "---- Configuration END\n"};
108 check_exception(
config, err_msg);
115 " p1: [ \"-f\", p, a ] " 118 "---- Configuration BEGIN\n" 119 " The following error occurred while processing a path " 121 " Entry with name f in path p1 does not have a module configuration.\n" 122 "---- Configuration END\n"};
123 check_exception(
config, err_msg);
133 "---- Configuration BEGIN\n" 134 " There was an error parsing the entry \"!f-g\"in a FHiCL sequence.\n" 135 " The '!' or '-' character may appear as only the first character in the " 137 "---- Configuration END\n"};
138 check_exception(
config, err_msg);
145 " producers: { p: {} }" 148 std::string const err_msg{
"---- Configuration BEGIN\n" 149 " The following error occurred while " 150 "processing a path configuration:\n" 151 " Entry with name p in path p1 is a producer and " 152 "cannot have a '!' or '-' prefix.\n" 153 "---- Configuration END\n"};
154 check_exception(
config, err_msg);
162 " trigger_paths: [ p1 ] " 165 "---- Configuration BEGIN\n" 166 " The following error occurred while processing a path " 168 " Entry with name f in path p1 does not have a module configuration.\n" 169 "---- Configuration END\n"};
170 check_exception(
config, err_msg);
177 "physics.analyzers.a1: {\n" 178 " module_type: DummyAnalyzer\n" 181 "physics.trigger_paths: [e1]\n"};
183 "---- Configuration BEGIN\n" 184 " The following error occurred while processing a path " 186 " The 'trigger_paths' override parameter contains the path e1, which has " 188 " analyzer with the name a1.\n" 190 " Path e1 should instead be included as part of the 'end_paths' " 192 " Contact artists@fnal.gov for guidance.\n" 193 "---- Configuration END\n"};
194 check_exception(
config, err_msg);
201 "physics.producers.d1: {\n" 202 " module_type: DummyProducer\n" 205 "physics.end_paths: [p1]\n"};
207 "---- Configuration BEGIN\n" 208 " The following error occurred while processing a path " 210 " The 'end_paths' override parameter contains the path p1, which has a\n" 211 " producer with the name d1.\n" 213 " Path p1 should instead be included as part of the 'trigger_paths' " 215 " Contact artists@fnal.gov for guidance.\n" 216 "---- Configuration END\n"};
217 check_exception(
config, err_msg);
231 " random : table } }"};
233 "---- Configuration BEGIN\n" 235 " You have specified the following unsupported parameters in the\n" 236 " \"physics\" block of your configuration:\n" 238 " \"physics.check\" (table)\n" 239 " \"physics.test\" (atom)\n" 241 " Supported parameters include the following tables:\n" 242 " \"physics.producers\"\n" 243 " \"physics.filters\"\n" 244 " \"physics.analyzers\"\n" 245 " and sequences. Atomic configuration parameters are not allowed.\n" 247 "---- Configuration END\n"};
248 check_exception(
config, err_msg);
250 BOOST_AUTO_TEST_SUITE_END()
EnabledModules prune_config_if_enabled(bool prune_config, bool report_enabled, fhicl::intermediate_table &config)
BOOST_AUTO_TEST_CASE(empty_config)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
intermediate_table parse_document(std::string const &filename, cet::filepath_maker &maker)