Macros | Functions
path_specs_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "art/Framework/Art/detail/prune_configuration.h"
#include "fhiclcpp/intermediate_table.h"
#include "fhiclcpp/parse.h"

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (path_specs test)
 

Functions

 BOOST_AUTO_TEST_CASE (empty_path_spec)
 
 BOOST_AUTO_TEST_CASE (one_entry)
 
 BOOST_AUTO_TEST_CASE (one_entry_with_bit_number)
 
 BOOST_AUTO_TEST_CASE (entries_skipping_bits)
 
 BOOST_AUTO_TEST_CASE (entries_skipping_bits_with_nil)
 
 BOOST_AUTO_TEST_CASE (repeated_path_name)
 
 BOOST_AUTO_TEST_CASE (repeated_path_id)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (path_specs test)

Definition at line 1 of file path_specs_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( empty_path_spec  )

Definition at line 37 of file path_specs_t.cc.

38 {
39  BOOST_TEST(trigger_path_specs_for("[]").empty());
40 }
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97
BOOST_AUTO_TEST_CASE ( one_entry  )

Definition at line 42 of file path_specs_t.cc.

43 {
44  auto const path_specs = trigger_path_specs_for("[a]");
45  BOOST_TEST(size(path_specs) == 1ull);
46  BOOST_TEST(path_specs[0] == spec_for("a", 0));
47 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< art::PathSpec > path_specs(std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
BOOST_AUTO_TEST_CASE ( one_entry_with_bit_number  )

Definition at line 49 of file path_specs_t.cc.

50 {
51  auto const path_specs = trigger_path_specs_for("['1:a']");
52  BOOST_TEST(size(path_specs) == 1ull);
53  BOOST_TEST(path_specs[0] == spec_for("a", 1));
54 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< art::PathSpec > path_specs(std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
BOOST_AUTO_TEST_CASE ( entries_skipping_bits  )

Definition at line 56 of file path_specs_t.cc.

57 {
58  auto const path_specs = trigger_path_specs_for("[a, '2:c', '3:d']");
59  BOOST_TEST(size(path_specs) == 3ull);
60  BOOST_TEST(path_specs[0] == spec_for("a", 0));
61  BOOST_TEST(path_specs[1] == spec_for("c", 2));
62  BOOST_TEST(path_specs[2] == spec_for("d", 3));
63 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< art::PathSpec > path_specs(std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
BOOST_AUTO_TEST_CASE ( entries_skipping_bits_with_nil  )

Definition at line 65 of file path_specs_t.cc.

66 {
67  auto const path_specs = path_specs_from("trigger_paths: [a]\n"
68  "trigger_paths[100]: c");
69  BOOST_TEST(size(path_specs) == 2ull);
70  BOOST_TEST(path_specs[0] == spec_for("a", 0));
71  BOOST_TEST(path_specs[1] == spec_for("c", 100));
72 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< art::PathSpec > path_specs(std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
BOOST_AUTO_TEST_CASE ( repeated_path_name  )

Definition at line 74 of file path_specs_t.cc.

75 {
76  BOOST_CHECK_EXCEPTION(
77  trigger_path_specs_for("[a, a]"), art::Exception, [](auto const& e) {
78  return e.categoryCode() == art::errors::Configuration and
79  e.explain_self().find("has already been specified in the ") !=
80  std::string::npos;
81  });
82  BOOST_CHECK_EXCEPTION(
83  trigger_path_specs_for("[a, '1:a']"), art::Exception, [](auto const& e) {
84  return e.categoryCode() == art::errors::Configuration and
85  e.explain_self().find(
86  "has already been specified (perhaps implicitly) ") !=
87  std::string::npos;
88  });
89  BOOST_CHECK_EXCEPTION(
90  trigger_path_specs_for("['0:a', '1:a']"),
92  [](auto const& e) {
93  return e.categoryCode() == art::errors::Configuration and
94  e.explain_self().find(
95  "has already been specified (perhaps implicitly) ") !=
96  std::string::npos;
97  });
98  auto const path_specs = trigger_path_specs_for("['1:a', '1:a']");
99  BOOST_CHECK(size(path_specs) == 1ull);
100  BOOST_CHECK(path_specs[0] == spec_for("a", 1));
101 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
const double e
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< art::PathSpec > path_specs(std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
BOOST_AUTO_TEST_CASE ( repeated_path_id  )

Definition at line 103 of file path_specs_t.cc.

104 {
105  BOOST_CHECK_EXCEPTION(
106  trigger_path_specs_for("['1:a', 'b']"), art::Exception, [](auto const& e) {
107  return e.categoryCode() == art::errors::Configuration and
108  e.explain_self().find("has already been assigned to path name ") !=
109  std::string::npos;
110  });
111  BOOST_CHECK_EXCEPTION(
112  trigger_path_specs_for("['3:a', '3:b']"),
114  [](auto const& e) {
115  return e.categoryCode() == art::errors::Configuration and
116  e.explain_self().find("has already been assigned to path name ") !=
117  std::string::npos;
118  });
119 }
const double e
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66