@@ -127,29 +127,28 @@ std::vector<UnitTest> TestRunner::getTestsToLaunch() {
127127 }
128128 return result;
129129 }
130+ auto [sourcePath, testPath] = Paths::getSourceAndTestPath (projectContext,
131+ projectContext.projectPath / testFilePath.value ());
132+ fs::path makefile = Paths::getMakefilePathFromSourceFilePath (projectContext, sourcePath);
130133
131134 if (testName.empty () && functionName.empty ()) {
132135 // 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);
136137 }
137138
138139 if (testName.empty ()) {
139140 // for function
140- fs::path sourcePath = Paths::testPathToSourcePath (projectContext, testFilePath.value ());
141- fs::path makefile = Paths::getMakefilePathFromSourceFilePath (projectContext, sourcePath);
142-
143141
144142 std::string renamedMethodDescription = KleeUtils::getRenamedOperator (functionName);
145143 StringUtils::replaceColon (renamedMethodDescription);
146144
147- std::string filter = " *." + renamedMethodDescription + Paths::TEST_SUFFIX + " *" ;
145+ std::string filter = " *." + renamedMethodDescription + Paths::TEST_SUFFIX + " *" ;
148146
149- return getTestsFromMakefile (makefile, testFilePath. value () , filter);
147+ return getTestsFromMakefile (makefile, testPath , filter);
150148 }
149+
151150 // for single test
152- return {UnitTest{testFilePath. value () , testSuite, testName}};
151+ return {UnitTest{testPath , testSuite, testName}};
153152}
154153
155154grpc::Status TestRunner::runTests (bool withCoverage, const std::optional<std::chrono::seconds> &testTimeout) {
0 commit comments