1 #include "artdaq-core/Utilities/SimpleLookupPolicy.hh"
3 #define BOOST_TEST_MODULE SimpleLookupPolicy_t
4 #include <boost/filesystem.hpp>
5 #include "cetlib/quiet_unit_test.hpp"
6 #include "cetlib_except/exception.h"
8 #define TRACE_NAME "SimpleLookupPolicy_t"
11 BOOST_AUTO_TEST_SUITE(SimpleLookupPolicy_test)
13 BOOST_AUTO_TEST_CASE(Constructors)
21 BOOST_AUTO_TEST_CASE(AbsoluteFilePath)
24 auto absolutePath = boost::filesystem::current_path();
25 absolutePath +=
"LookupTarget.fcl";
26 p(absolutePath.string());
30 BOOST_AUTO_TEST_CASE(FallbackPath)
32 auto coreDir = getenv(
"ARTDAQ_CORE_DIR");
33 std::string coreDirStr =
"";
34 if (coreDir !=
nullptr)
36 coreDirStr = std::string(coreDir);
40 p(
"LookupTarget.fcl");
41 BOOST_REQUIRE_EXCEPTION(p(
"ThisFileDoesNotExist.fcl"), cet::exception, [](cet::exception
const& e) {
return e.category() ==
"search_path"; });
44 BOOST_AUTO_TEST_SUITE_END()
Constructor argument is a list of directories.
This class is intended to find files using a set lookup order.