#include "boost/test/unit_test.hpp"
#include "boost/filesystem.hpp"
#include "cetlib/filepath_maker.h"
#include "cetlib/filesystem.h"
#include "cetlib/getenv.h"
#include "cetlib_except/exception.h"
#include <string>
Go to the source code of this file.
#define BOOST_TEST_MODULE (filepath_maker test) |
BOOST_AUTO_TEST_CASE |
( |
filepath_maker_t |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
filepath_lookup_t1 |
| ) |
|
Definition at line 59 of file filepath_maker_test.cc.
63 auto const files = {
"a.txt"s,
"b.txt"s,
"c.txt"s};
70 bfs::path
const p1{fullPath1};
71 bfs::path
const p2{fullPath2};
72 bfs::path
const p3{fullPath3};
73 BOOST_TEST(bfs::equivalent(p1, p2));
74 BOOST_TEST(bfs::equivalent(p1, p3));
80 check_exception(
maker, current_nested_dir() +
'/' +
filename);
bool is_absolute_filepath(std::string const &qualified_filename)
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_lookup_t2 |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
filepath_lookup_nonabsolute_t |
| ) |
|
Definition at line 92 of file filepath_maker_test.cc.
95 auto const files = {
"a.txt"s,
"b.txt"s,
"c.txt"s};
99 auto const fullPath2 =
maker(current_nested_dir() +
'/' +
filename);
100 bfs::path
const p1{fullPath1};
101 bfs::path
const p2{fullPath2};
102 BOOST_TEST(bfs::equivalent(p1, p2));
110 check_exception(
maker, file_in_current_dir);
112 maker(current_dir() +
'/' + file_in_current_dir);
bool is_absolute_filepath(std::string const &qualified_filename)
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_lookup_after1_t1 |
| ) |
|
Definition at line 115 of file filepath_maker_test.cc.
bool file_exists(std::string const &qualified_filename)
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_lookup_after1_t2 |
| ) |
|
Definition at line 124 of file filepath_maker_test.cc.
127 auto const absolute_path = current_dir() +
'/' + file_in_current_dir;
129 maker(absolute_path);
131 check_exception(
maker, absolute_path);
136 check_exception(
maker, current_nested_dir() +
"/a.txt");
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_lookup_after1_t3 |
| ) |
|
Definition at line 139 of file filepath_maker_test.cc.
142 auto const relative_path =
"./" + file_in_current_dir;
144 maker(relative_path);
146 check_exception(
maker, relative_path);
151 check_exception(
maker, current_nested_dir() +
"/a.txt");
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_lookup_after1_t4 |
| ) |
|
Definition at line 154 of file filepath_maker_test.cc.
158 maker(file_in_current_dir);
160 check_exception(
maker, file_in_current_dir);
165 check_exception(
maker, current_nested_dir() +
"/a.txt");
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_first_absolute_or_lookup_with_dot_t1 |
| ) |
|
Definition at line 168 of file filepath_maker_test.cc.
std::string getenv(std::string const &name)
bool file_exists(std::string const &qualified_filename)
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_first_absolute_or_lookup_with_dot_t2 |
| ) |
|
Definition at line 178 of file filepath_maker_test.cc.
181 auto const absolute_path = current_dir() +
'/' + file_in_current_dir;
183 maker(absolute_path);
185 check_exception(
maker, absolute_path);
190 check_exception(
maker, current_nested_dir() +
"/a.txt");
std::string getenv(std::string const &name)
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_first_absolute_or_lookup_with_dot_t3 |
| ) |
|
Definition at line 193 of file filepath_maker_test.cc.
196 auto const relative_path =
"./" + file_in_current_dir;
198 maker(relative_path);
200 check_exception(
maker, relative_path);
205 check_exception(
maker, current_nested_dir() +
"/a.txt");
std::string getenv(std::string const &name)
def maker(G, ac, typename)
BOOST_AUTO_TEST_CASE |
( |
filepath_first_absolute_or_lookup_with_dot_t4 |
| ) |
|
Definition at line 208 of file filepath_maker_test.cc.
212 maker(file_in_current_dir);
214 check_exception(
maker, file_in_current_dir);
219 check_exception(
maker, current_nested_dir() +
"/a.txt");
std::string getenv(std::string const &name)
def maker(G, ac, typename)