diff --git a/tools/report-converter/codechecker_report_converter/report/hash.py b/tools/report-converter/codechecker_report_converter/report/hash.py index 2cc2fbd87a..aa6c5e5ab9 100644 --- a/tools/report-converter/codechecker_report_converter/report/hash.py +++ b/tools/report-converter/codechecker_report_converter/report/hash.py @@ -184,8 +184,6 @@ def get_report_hash(report: Report, hash_type: HashType) -> str: else: raise Exception("Invalid report hash type: " + str(hash_type)) - print(hash_content) - return __str_to_hash('|||'.join(hash_content)) diff --git a/tools/report-converter/codechecker_report_converter/report/parser/sarif.py b/tools/report-converter/codechecker_report_converter/report/parser/sarif.py index b893847eb5..42753acc96 100644 --- a/tools/report-converter/codechecker_report_converter/report/parser/sarif.py +++ b/tools/report-converter/codechecker_report_converter/report/parser/sarif.py @@ -98,10 +98,6 @@ def get_reports( if report.report_hash is None: report.report_hash = get_report_hash( report, HashType.PATH_SENSITIVE) - print(get_report_hash(report, HashType.PATH_SENSITIVE)) - print(get_report_hash(report, HashType.CONTEXT_FREE)) - print(get_report_hash( - report, HashType.DIAGNOSTIC_MESSAGE)) reports.append(report) diff --git a/tools/report-converter/tests/unit/analyzers/test_gcc_parser.py b/tools/report-converter/tests/unit/analyzers/test_gcc_parser.py index 3644d0e2c6..caacd71c62 100644 --- a/tools/report-converter/tests/unit/analyzers/test_gcc_parser.py +++ b/tools/report-converter/tests/unit/analyzers/test_gcc_parser.py @@ -14,8 +14,7 @@ import os import plistlib -# import shutil -# import tempfile +import shutil import unittest from codechecker_report_converter.analyzers.gcc import analyzer_result @@ -37,6 +36,9 @@ def setup_class(self): TEST_WORKSPACE = env.get_workspace('gcc_parser') os.environ['TEST_WORKSPACE'] = TEST_WORKSPACE self.test_workspace = os.environ['TEST_WORKSPACE'] + self.cc_result_dir = self.test_workspace + + self.analyzer_result = analyzer_result.AnalyzerResult() self.test_files = os.path.join(os.path.dirname(__file__), 'gcc_output_test_files') @@ -54,35 +56,26 @@ def teardown_class(self): global TEST_WORKSPACE print("Removing: " + TEST_WORKSPACE) - # shutil.rmtree(TEST_WORKSPACE, ignore_errors=True) - - def setUp(self): - """ Setup the test. """ - self.analyzer_result = analyzer_result.AnalyzerResult() - self.cc_result_dir = self.test_workspace - - def tearDown(self): - """ Clean temporary directory. """ - # shutil.rmtree(self.cc_result_dir) + shutil.rmtree(TEST_WORKSPACE, ignore_errors=True) - # def test_no_plist_file(self): - # """ Test transforming single plist file. """ - # analyzer_output_file = os.path.join(self.test_files, 'files', - # 'double_free.cpp') + def test_no_plist_file(self): + """ Test transforming single plist file. """ + analyzer_output_file = os.path.join(self.test_files, 'files', + 'double_free.cpp') - # ret = self.analyzer_result.transform( - # [analyzer_output_file], self.cc_result_dir, plist.EXTENSION, - # file_name="{source_file}_{analyzer}") - # self.assertFalse(ret) + ret = self.analyzer_result.transform( + [analyzer_output_file], self.cc_result_dir, plist.EXTENSION, + file_name="{source_file}_{analyzer}") + self.assertFalse(ret) - # def test_no_plist_dir(self): - # """ Test transforming single plist file. """ - # analyzer_output_file = os.path.join(self.test_files, 'non_existing') + def test_no_plist_dir(self): + """ Test transforming single plist file. """ + analyzer_output_file = os.path.join(self.test_files, 'non_existing') - # ret = self.analyzer_result.transform( - # [analyzer_output_file], self.cc_result_dir, plist.EXTENSION, - # file_name="{source_file}_{analyzer}") - # self.assertFalse(ret) + ret = self.analyzer_result.transform( + [analyzer_output_file], self.cc_result_dir, plist.EXTENSION, + file_name="{source_file}_{analyzer}") + self.assertFalse(ret) def test_gcc_transform_single_file(self): """ Test transforming single plist file. """