Skip to content

Commit

Permalink
FUCK THIS+
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Dec 7, 2023
1 parent 9dff32b commit ced09b0
Showing 1 changed file with 20 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# ------------------------------------------------------------------------


import json
import os
import inspect
import shutil
Expand All @@ -30,7 +31,7 @@ def setup_class(self):

os.environ['TEST_WORKSPACE'] = TEST_WORKSPACE

test_project = 'suppress'
test_project = 'cpp'

test_config = {}

Expand Down Expand Up @@ -105,35 +106,10 @@ def test_review_status(self):
$version: 1
rules:
- filters:
filepath: /path/to/project/test/*
checker_name: core.DivideZero
checker_name: core.NullDereference
actions:
review_status: intentional
reason: Division by zero in test files is automatically intentional.
- filters:
filepath: /path/to/project/important/module/*
actions:
review_status: confirmed
reason: All reports in this module should be investigated.
- filters:
filepath: "*/project/test/*"
actions:
review_status: suppress
reason: If a filter starts with asterix, then it should be quoted due to YAML format.
- filters:
report_hash: b85851b34789e35c6acfa1a4aaf65382
actions:
review_status: false_positive
reason: This report is false positive.
- filters:
filepath: /path/to/3pp/lib/*
actions:
ignore: true
reason: The reports of this lib are ignored completely.
"""
with open(rs_cfg, "w") as f:
f.write(source_code)
Expand All @@ -145,16 +121,29 @@ def test_review_status(self):
cmd = [env.codechecker_cmd(), 'check', '-b',
f'make -C {self.test_proj_path}',
"--review-status-config", rs_cfg, '-o', reports_dir]

print(shlex.join(cmd))
print(shlex.join(cmd))
print(shlex.join(cmd))
print(shlex.join(cmd))
print(shlex.join(cmd))
assert False

out, err, ret = codechecker.call_command(
cmd, self._test_project_path,
env.test_env(self._test_workspace))
print(out)
print(err)
self.assertEqual(ret, 0)

self.assertEqual(ret, 2)
parse_cmd = [env.codechecker_cmd(), 'parse', reports_dir, '-e', 'json']

out, err, ret = codechecker.call_command(
parse_cmd, self._test_project_path,
env.test_env(self._test_workspace))
parse_result = json.loads(out)

for report in parse_result["reports"]:
print(report["checker_name"])
if report["checker_name"] == "core.NullDereference":
print(report["review_status"])

assert False
self.assertEqual(ret, 2)

0 comments on commit ced09b0

Please sign in to comment.