diff --git a/server/src/Paths.h b/server/src/Paths.h index 63817b112..b5fd433ab 100644 --- a/server/src/Paths.h +++ b/server/src/Paths.h @@ -16,6 +16,7 @@ namespace Paths { extern fs::path logPath; const std::string MAKEFILE_EXTENSION = ".mk"; + const std::string CXX_EXTENSION = ".cpp"; const std::string TEST_SUFFIX = "_test"; const std::string STUB_SUFFIX = "_stub"; const std::string DOT_SEP = "_dot_"; diff --git a/server/src/Tests.cpp b/server/src/Tests.cpp index 51927d13c..0bcdaca05 100644 --- a/server/src/Tests.cpp +++ b/server/src/Tests.cpp @@ -658,7 +658,7 @@ void KTestObjectParser::assignTypeUnnamedVar( continue; } if (!visited[indObj]) { - Tests::MethodParam param = {fieldType.baseTypeObj(1), "", std::nullopt }; + Tests::MethodParam param = {fieldType.baseTypeObj(1), "", std::nullopt}; order.emplace(indObj, param, curType.paramValue); visited[indObj] = true; } diff --git a/server/src/coverage/TestRunner.cpp b/server/src/coverage/TestRunner.cpp index 20c6ad27f..fe0fed893 100644 --- a/server/src/coverage/TestRunner.cpp +++ b/server/src/coverage/TestRunner.cpp @@ -90,10 +90,11 @@ std::vector TestRunner::getTestsToLaunch() { return; } const auto &testFilePath = directoryEntry.path(); - if (testFilePath.extension() == ".cpp" && StringUtils::endsWith(testFilePath.stem().c_str(), Paths::TEST_SUFFIX)) { + if (testFilePath.extension() == Paths::CXX_EXTENSION && + StringUtils::endsWith(testFilePath.stem().c_str(), Paths::TEST_SUFFIX)) { fs::path sourcePath = Paths::testPathToSourcePath(projectContext, testFilePath); fs::path makefile = - Paths::getMakefilePathFromSourceFilePath(projectContext, sourcePath); + Paths::getMakefilePathFromSourceFilePath(projectContext, sourcePath); if (fs::exists(makefile)) { try { auto tests = getTestsFromMakefile(makefile, testFilePath);