@@ -11,9 +11,11 @@ RelativeMakefilePrinter::RelativeMakefilePrinter(PathToShellVariable pathToShell
1111RelativeMakefilePrinter::RelativeMakefilePrinter (
1212 const fs::path &buildDirectory,
1313 const fs::path &buildDirectoryRelative,
14- const fs::path &projectPath)
14+ const fs::path &projectPath,
15+ const fs::path &testsPath)
1516 : DefaultMakefilePrinter(),
1617 pathToShellVariable{{{buildDirectory, " $(BUILD_DIR)" },
18+ {testsPath, " $(TESTS_DIR)" },
1719 {projectPath, " $(PROJECT_DIR)" },
1820 {buildDirectoryRelative, " $(BUILD_RELATIVE)" }},
1921 [](const std::string& lhs, const std::string& rhs) -> bool {
@@ -23,6 +25,7 @@ RelativeMakefilePrinter::RelativeMakefilePrinter(
2325 return std::greater<>()(lhs, rhs);
2426 }},
2527 buildDirectoryRelative{buildDirectoryRelative},
28+ testsPath{testsPath},
2629 projectPath{projectPath} {
2730 initializePathsToShellVariables ();
2831}
@@ -71,6 +74,8 @@ std::string RelativeMakefilePrinter::getProjectStructureRelativeTo(const fs::pat
7174 printer.declareVariable (" export PROJECT_DIR" , " $(MAKEFILE_DIR)/$(PROJECT_DIR_RELATIVE_TO_MAKEFILE)" );
7275 printer.declareVariable (" export BUILD_RELATIVE" , buildDirectoryRelative);
7376 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)" );
7479 return printer.ss .str ();
7580}
7681
0 commit comments