@@ -127,29 +127,28 @@ std::vector<UnitTest> TestRunner::getTestsToLaunch() {
127
127
}
128
128
return result;
129
129
}
130
+ auto [sourcePath, testPath] = Paths::getSourceAndTestPath (projectContext,
131
+ projectContext.projectPath / testFilePath.value ());
132
+ fs::path makefile = Paths::getMakefilePathFromSourceFilePath (projectContext, sourcePath);
130
133
131
134
if (testName.empty () && functionName.empty ()) {
132
135
// for file
133
- fs::path sourcePath = Paths::testPathToSourcePath (projectContext, testFilePath.value ());
134
- fs::path makefile = Paths::getMakefilePathFromSourceFilePath (projectContext, sourcePath);
135
- return getTestsFromMakefile (makefile, testFilePath.value ());
136
+ return getTestsFromMakefile (makefile, testPath);
136
137
}
137
138
138
139
if (testName.empty ()) {
139
140
// for function
140
- fs::path sourcePath = Paths::testPathToSourcePath (projectContext, testFilePath.value ());
141
- fs::path makefile = Paths::getMakefilePathFromSourceFilePath (projectContext, sourcePath);
142
-
143
141
144
142
std::string renamedMethodDescription = KleeUtils::getRenamedOperator (functionName);
145
143
StringUtils::replaceColon (renamedMethodDescription);
146
144
147
- std::string filter = " *." + renamedMethodDescription + Paths::TEST_SUFFIX + " *" ;
145
+ std::string filter = " *." + renamedMethodDescription + Paths::TEST_SUFFIX + " *" ;
148
146
149
- return getTestsFromMakefile (makefile, testFilePath. value () , filter);
147
+ return getTestsFromMakefile (makefile, testPath , filter);
150
148
}
149
+
151
150
// for single test
152
- return {UnitTest{testFilePath. value () , testSuite, testName}};
151
+ return {UnitTest{testPath , testSuite, testName}};
153
152
}
154
153
155
154
grpc::Status TestRunner::runTests (bool withCoverage, const std::optional<std::chrono::seconds> &testTimeout) {
0 commit comments