Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Oct 3, 2023
1 parent 6975a01 commit a1772b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def get_reports(
# TODO: We don't really support non-local analyses, so we
# only parse physical locations here.
file, rng = self._process_physical_location(location)
print(file)
print(rng)
assert False
if not (file and rng):
continue
if self.had_error:
Expand Down
15 changes: 9 additions & 6 deletions tools/report-converter/tests/unit/analyzers/test_gcc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,24 @@ def test_transform_single_file(self):
[analyzer_output_file], self.cc_result_dir, plist.EXTENSION,
file_name="{source_file}_{analyzer}")

sarif_file = os.path.join(self.cc_result_dir,
plist_file = os.path.join(self.cc_result_dir,
'double_free.cpp_gcc.plist')
with open(sarif_file, mode='rb') as sfile:
res = plistlib.load(sfile)
with open(plist_file, mode='rb') as pfile:
res = plistlib.load(pfile)

# Use relative path for this test.
res['files'][0] = 'files/double_free.cpp'

self.assertTrue(res['metadata']['generated_by']['version'])
res['metadata']['generated_by']['version'] = "x.y.z"
print(
res["diagnostics"][0]["issue_hash_content_of_line_in_context"])
assert False

sarif_file = os.path.join(self.test_files,
plist_file = os.path.join(self.test_files,
'double_free.expected.plist')
with open(sarif_file, mode='rb') as sfile:
exp = plistlib.load(sfile)
with open(plist_file, mode='rb') as pfile:
exp = plistlib.load(pfile)

self.maxDiff = None
self.assertEqual(res, exp)

0 comments on commit a1772b3

Please sign in to comment.