Skip to content

Commit 62f3731

Browse files
committed
CppCheck: actually generate analyzer information for markup files
1 parent 837c5cb commit 62f3731

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: lib/cppcheck.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,12 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string
689689
}
690690
mUnusedFunctionsCheck->parseTokens(tokenizer, mSettings);
691691

692-
// TODO: open file so we can set the fileinfo
692+
// TODO: how to get the proper tokenlist to generate the proper hash?
693+
const std::size_t hash = time(nullptr); // calculateHash(tokenizer.list, mSettings);
694+
std::list<ErrorMessage> errors;
695+
mAnalyzerInformation.analyzeFile(mSettings.buildDir, file.spath(), cfgname, hash, errors);
693696
mAnalyzerInformation.setFileInfo("CheckUnusedFunctions", mUnusedFunctionsCheck->analyzerInfo());
697+
mAnalyzerInformation.close();
694698
}
695699
return EXIT_SUCCESS;
696700
}

Diff for: test/cli/qml_test.py

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ def test_unused_functions_j():
5353
assert ret == 0, stdout
5454

5555

56-
# TODO: fillSampleData is not unused
57-
@pytest.mark.xfail(strict=True)
5856
def test_unused_functions_builddir(tmpdir):
5957
build_dir = os.path.join(tmpdir, 'b1')
6058
os.mkdir(build_dir)

0 commit comments

Comments
 (0)