@@ -11,9 +11,11 @@ RelativeMakefilePrinter::RelativeMakefilePrinter(PathToShellVariable pathToShell
11
11
RelativeMakefilePrinter::RelativeMakefilePrinter (
12
12
const fs::path &buildDirectory,
13
13
const fs::path &buildDirectoryRelative,
14
- const fs::path &projectPath)
14
+ const fs::path &projectPath,
15
+ const fs::path &testsPath)
15
16
: DefaultMakefilePrinter(),
16
17
pathToShellVariable{{{buildDirectory, " $(BUILD_DIR)" },
18
+ {testsPath, " $(TESTS_DIR)" },
17
19
{projectPath, " $(PROJECT_DIR)" },
18
20
{buildDirectoryRelative, " $(BUILD_RELATIVE)" }},
19
21
[](const std::string& lhs, const std::string& rhs) -> bool {
@@ -23,6 +25,7 @@ RelativeMakefilePrinter::RelativeMakefilePrinter(
23
25
return std::greater<>()(lhs, rhs);
24
26
}},
25
27
buildDirectoryRelative{buildDirectoryRelative},
28
+ testsPath{testsPath},
26
29
projectPath{projectPath} {
27
30
initializePathsToShellVariables ();
28
31
}
@@ -71,6 +74,8 @@ std::string RelativeMakefilePrinter::getProjectStructureRelativeTo(const fs::pat
71
74
printer.declareVariable (" export PROJECT_DIR" , " $(MAKEFILE_DIR)/$(PROJECT_DIR_RELATIVE_TO_MAKEFILE)" );
72
75
printer.declareVariable (" export BUILD_RELATIVE" , buildDirectoryRelative);
73
76
printer.declareVariable (" export BUILD_DIR" , " $(PROJECT_DIR)/$(BUILD_RELATIVE)" );
77
+ printer.declareVariable (" export TESTS_DIR_RELATIVE" , fs::relative (testsPath, makefilePath.parent_path ()));
78
+ printer.declareVariable (" export TESTS_DIR" , " $(MAKEFILE_DIR)/$(TESTS_DIR_RELATIVE)" );
74
79
return printer.ss .str ();
75
80
}
76
81
0 commit comments