blob: d7c590852f0afe81ea1edb503d2be781084d6749 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright (c) 2020 Egor Tensin <egor@tensin.name>
// This file is part of the "winapi-debug" project.
// For details, see https://github.com/egor-tensin/winapi-debug.
// Distributed under the MIT License.
#pragma once
#include <boost/test/unit_test.hpp>
#include <filesystem>
using path = std::filesystem::path;
class Paths {
public:
using path = std::filesystem::path;
static Paths& get() {
static Paths instance;
return instance;
}
Paths() : exe_path{get_executable_path()}, exe_dir{exe_path.parent_path()} {}
const path exe_path;
const path exe_dir;
private:
static path get_executable_path() {
const auto argv0 = boost::unit_test::framework::master_test_suite().argv[0];
return std::filesystem::absolute(argv0);
}
Paths(const Paths&) = delete;
Paths& operator=(const Paths&) = delete;
};
|