Skip to content

Commit

Permalink
CppCheck: actually generate analyzer information for markup files
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Oct 25, 2024
1 parent 837c5cb commit 178381c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,12 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string
}
mUnusedFunctionsCheck->parseTokens(tokenizer, mSettings);

// TODO: open file so we can set the fileinfo
// TODO: how to get the proper tokenlist to generate the proper hash?
const std::size_t hash = time(nullptr); // calculateHash(tokenizer.list, mSettings);
std::list<ErrorMessage> errors;
mAnalyzerInformation.analyzeFile(mSettings.buildDir, file.spath(), cfgname, hash, errors);
mAnalyzerInformation.setFileInfo("CheckUnusedFunctions", mUnusedFunctionsCheck->analyzerInfo());
mAnalyzerInformation.close();
}
return EXIT_SUCCESS;
}
Expand Down
3 changes: 0 additions & 3 deletions test/cli/qml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# python3 -m pytest test-qml.py

import os
import pytest
from testutils import cppcheck

__script_dir = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -53,8 +52,6 @@ def test_unused_functions_j():
assert ret == 0, stdout


# TODO: fillSampleData is not unused
@pytest.mark.xfail(strict=True)
def test_unused_functions_builddir(tmpdir):
build_dir = os.path.join(tmpdir, 'b1')
os.mkdir(build_dir)
Expand Down

0 comments on commit 178381c

Please sign in to comment.