Skip to content

Commit

Permalink
Add test for Disable clang-diagnostic-error checker #4325
Browse files Browse the repository at this point in the history
Test if clang-diagnostic-error checker is disabled in cli.
  • Loading branch information
Nora Zinaeddin committed Sep 15, 2024
1 parent 99fcaf4 commit 8e0d576
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion analyzer/tests/functional/analyze/test_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def test_relative_include_paths(self):

def test_tidyargs_saargs(self):
"""
Test tidyargs and saargs config files
Test tidyargs and saargs config files & Clang Tidy config
"""
build_json = os.path.join(self.test_workspace, "build_extra_args.json")
report_dir = os.path.join(self.test_workspace, "reports_extra_args")
Expand Down Expand Up @@ -1316,6 +1316,22 @@ def test_invalid_compilation_database(self):

self.assertEqual(process.returncode, 1)

def test_disable_error_checker_tidy(self):
"""Make sure clang-diagnostic-error checker is disabled (PR #4325)"""
cmd = [self._codechecker_cmd, "check", "-l", self.__get_build_json(),
'--enable', 'clang-diagnostic-error']

process = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=self.test_dir,
encoding="utf-8",
errors="ignore")
out, _ = process.communicate()

self.assertNotIn("error", out)

def test_compilation_db_relative_file_path(self):
"""
Test relative path in compilation database.
Expand Down

0 comments on commit 8e0d576

Please sign in to comment.