diff --git a/analyzer/codechecker_analyzer/analyzers/analyzer_types.py b/analyzer/codechecker_analyzer/analyzers/analyzer_types.py index 4832788c70..83289257c7 100644 --- a/analyzer/codechecker_analyzer/analyzers/analyzer_types.py +++ b/analyzer/codechecker_analyzer/analyzers/analyzer_types.py @@ -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.+') diff --git a/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py b/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py index d5e053e6e1..a1df95b232 100644 --- a/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py +++ b/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py @@ -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 diff --git a/web/tests/functional/statistics/test_statistics.py b/web/tests/functional/statistics/test_statistics.py index 7ebe5e520d..794b73a2f0 100644 --- a/web/tests/functional/statistics/test_statistics.py +++ b/web/tests/functional/statistics/test_statistics.py @@ -10,6 +10,7 @@ """ statistics collector feature test. """ +from distutils import util import os import unittest import shlex @@ -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'])