projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
925d97b
)
Add find_file from libdcp.
author
Carl Hetherington
<cth@carlh.net>
Mon, 2 May 2022 07:40:03 +0000
(09:40 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Mon, 2 May 2022 07:40:03 +0000
(09:40 +0200)
test/test.cc
patch
|
blob
|
history
test/test.h
patch
|
blob
|
history
diff --git
a/test/test.cc
b/test/test.cc
index e61387132f12fce7e61e558a445743366ef2ddae..21f27c36c31fbc28596a060d4f661c5aa8eab218 100644
(file)
--- a/
test/test.cc
+++ b/
test/test.cc
@@
-937,3
+937,17
@@
ConfigRestorer::~ConfigRestorer()
setup_test_config();
}
setup_test_config();
}
+
+boost::filesystem::path
+find_file (boost::filesystem::path dir, string filename_part)
+{
+ boost::optional<boost::filesystem::path> found;
+ for (auto i: boost::filesystem::directory_iterator(dir)) {
+ if (i.path().filename().string().find(filename_part) != string::npos) {
+ BOOST_REQUIRE (!found);
+ found = i;
+ }
+ }
+ BOOST_REQUIRE (found);
+ return *found;
+}
diff --git
a/test/test.h
b/test/test.h
index 43bccd52b775b8791ae75e097cb9a75e0ed44730..10113b66276afae11a42af1a2cb442bfe05aba0c 100644
(file)
--- a/
test/test.h
+++ b/
test/test.h
@@
-76,6
+76,7
@@
extern void make_random_file (boost::filesystem::path path, size_t size);
extern void make_and_verify_dcp (std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {});
extern void check_int_close (int a, int b, int d);
extern void check_int_close (std::pair<int, int>, std::pair<int, int>, int d);
extern void make_and_verify_dcp (std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {});
extern void check_int_close (int a, int b, int d);
extern void check_int_close (std::pair<int, int>, std::pair<int, int>, int d);
+extern boost::filesystem::path find_file (boost::filesystem::path dir, std::string filename_part);
class LogSwitcher
class LogSwitcher