2024-05-29 16:29:08 +10:00
|
|
|
#include <cruft/util/tap.hpp>
|
2016-05-13 15:23:05 +10:00
|
|
|
|
2024-05-29 16:29:08 +10:00
|
|
|
#include <cruft/util/exe.hpp>
|
2016-10-10 16:23:07 +11:00
|
|
|
|
2023-07-21 14:20:49 +10:00
|
|
|
#include <fmt/std.h>
|
|
|
|
|
2018-12-05 19:12:03 +11:00
|
|
|
#include <filesystem>
|
2018-08-13 16:12:11 +10:00
|
|
|
|
2016-10-10 16:23:07 +11:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2016-05-13 15:23:05 +10:00
|
|
|
int
|
2017-01-25 15:07:14 +11:00
|
|
|
main (int, char **argv)
|
2016-05-13 15:23:05 +10:00
|
|
|
{
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::TAP::logger tap;
|
2017-01-25 15:07:14 +11:00
|
|
|
|
2018-08-13 16:12:11 +10:00
|
|
|
// 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 ();
|
2018-12-05 19:12:03 +11:00
|
|
|
auto const truth = std::filesystem::path (argv[0]);
|
2018-08-13 16:12:11 +10:00
|
|
|
tap.expect_eq (
|
|
|
|
query.stem (),
|
|
|
|
truth.stem (),
|
2021-04-13 16:05:08 +10:00
|
|
|
"identify executable path # {}", query
|
2018-08-13 16:12:11 +10:00
|
|
|
);
|
|
|
|
|
2016-10-10 16:23:07 +11:00
|
|
|
return tap.status ();
|
2016-05-13 15:23:05 +10:00
|
|
|
}
|