Skip to content

Commit

Permalink
Merge pull request #3630 from bruntib/stat_flag
Browse files Browse the repository at this point in the history
[bugfix] Disappearing --stats flag
  • Loading branch information
csordasmarton authored Mar 18, 2022
2 parents 0b2939e + f9d0995 commit ed03752
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion analyzer/codechecker_analyzer/analyzers/analyzer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def is_statistics_capable(context):
check_env = env.extend(context.path_env_extra,
context.ld_lib_path_extra)

checkers = ClangSA.get_analyzer_checkers(clangsa_cfg, check_env)
checkers = ClangSA.get_analyzer_checkers(
clangsa_cfg, check_env, True, True)

stat_checkers_pattern = re.compile(r'.+statisticscollector.+')

Expand Down
8 changes: 5 additions & 3 deletions analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ def add_checker_config(self, checker_cfg):
def get_analyzer_checkers(
cls,
cfg_handler: config_handler.ClangSAConfigHandler,
environ: Dict[str, str]
environ: Dict[str, str],
alpha: bool = True,
debug: bool = False
) -> List[str]:
"""Return the list of the supported checkers."""
checker_list_args = clang_options.get_analyzer_checkers_cmd(
cfg_handler,
alpha=True,
debug=False)
alpha=alpha,
debug=debug)
return parse_clang_help_page(checker_list_args, 'CHECKERS:', environ)

@classmethod
Expand Down
8 changes: 8 additions & 0 deletions web/tests/functional/statistics/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
""" statistics collector feature test. """


from distutils import util
import os
import unittest
import shlex
Expand Down Expand Up @@ -48,6 +49,13 @@ def setUp(self):
print("'analyze' reported statistics collector-compatibility? " +
str(self.stats_capable))

if not self.stats_capable:
try:
self.stats_capable = bool(util.strtobool(
os.environ['CC_TEST_FORCE_STATS_CAPABLE']))
except (ValueError, KeyError):
pass

test_project_path = self._testproject_data['project_path']
test_project_build = shlex.split(self._testproject_data['build_cmd'])
test_project_clean = shlex.split(self._testproject_data['clean_cmd'])
Expand Down

0 comments on commit ed03752

Please sign in to comment.