Skip to content

Commit 467a2c6

Browse files
committed
fix tests
1 parent 84645b1 commit 467a2c6

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

server/src/coverage/TestRunner.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,6 @@ grpc::Status TestRunner::runTests(bool withCoverage, const std::optional<std::ch
153153
exceptions.emplace_back(e);
154154
}
155155
});
156-
fs::remove(Paths::getGTestResultsJsonPath(projectContext));
157-
// StatsUtils::TestsExecutionStatsFileMap testsExecutionStats(projectContext, coverageGenerator.getTestResultMap(),
158-
// coverageGenerator.getCoverageMap());
159-
// printer::CSVPrinter printer = testsExecutionStats.toCSV();
160-
// FileSystemUtils::writeToFile(Paths::getExecutionStatsCSVPath(projectContext), printer.getStream().str());
161-
// LOG_S(INFO) << StringUtils::stringFormat("See execution stats here: %s",
162-
// Paths::getExecutionStatsCSVPath(projectContext));
163156
LOG_S(DEBUG) << "All run commands were executed";
164157
return Status::OK;
165158
}

server/src/fetchers/GlobalVariableUsageMatchCallback.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ void GlobalVariableUsageMatchCallback::checkUsage(const MatchFinder::MatchResult
2020
Result.Nodes.getNodeAs<clang::VarDecl>(Matchers::GLOBAL_VARIABLE_USAGE)) {
2121
clang::QualType varType = pVarDecl->getType();
2222
std::string name = pVarDecl->getNameAsString();
23+
if (!pVarDecl->isKnownToBeDefined() && !pVarDecl->isExternC()) {
24+
LOG_S(DEBUG) << "Variable \"" << name << "\" was skipped - it has no definition.";
25+
return;
26+
}
2327
if (const auto *pFunctionDecl = Result.Nodes.getNodeAs<clang::FunctionDecl>(
2428
Matchers::FUNCTION_USED_GLOBAL_VARIABLE)) {
2529
if (varType.isConstant(pVarDecl->getASTContext())) {
@@ -64,7 +68,7 @@ void GlobalVariableUsageMatchCallback::handleUsage(const clang::FunctionDecl *fu
6468
const std::string usedParamTypeString = varDecl->getType().getAsString();
6569
types::Type paramType = types::Type(realParamType, usedParamTypeString, sourceManager);
6670
method.globalParams.emplace_back(paramType, usage.variableName, AlignmentFetcher::fetch(varDecl));
67-
if (varDecl->isKnownToBeDefined()) {
71+
if (varDecl->isExternC()) {
6872
tests.externVariables.insert({paramType, usage.variableName});
6973
}
7074
}

0 commit comments

Comments
 (0)