exe: defend test case against msys2 paths
This commit is contained in:
parent
4fd68aef55
commit
75a3572fdd
18
test/exe.cpp
18
test/exe.cpp
@ -2,6 +2,8 @@
|
||||
|
||||
#include "../exe.hpp"
|
||||
|
||||
#include <experimental/filesystem>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
int
|
||||
@ -9,7 +11,19 @@ main (int, char **argv)
|
||||
{
|
||||
cruft::TAP::logger tap;
|
||||
|
||||
auto path = cruft::image_path ();
|
||||
tap.expect_eq (path, argv[0], "identify executable path");
|
||||
// we'd like to compare based on the total path, but systems like msys2
|
||||
// have varying styles of paths and it's difficult to harmonize the
|
||||
// expected and queried values.
|
||||
//
|
||||
// so we compare the filename instead under the assumption that it should
|
||||
// be stable across path styles.
|
||||
auto const query = cruft::image_path ();
|
||||
auto const truth = std::experimental::filesystem::path (argv[0]);
|
||||
tap.expect_eq (
|
||||
query.stem (),
|
||||
truth.stem (),
|
||||
"identify executable path # %!", query
|
||||
);
|
||||
|
||||
return tap.status ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user