[Analyzer] [Tests] Remove temporary fields from generated reference results.
authorGeorge Karpenkov <ekarpenkov@apple.com>
Tue, 24 Oct 2017 23:52:46 +0000 (23:52 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Tue, 24 Oct 2017 23:52:46 +0000 (23:52 +0000)
Pointer to HTML diagnostics is removed (as it is not stored) as well as
the version (as it would be available from the commit message).

llvm-svn: 316534

clang/utils/analyzer/SATestBuild.py

index c70219c..947cb53 100755 (executable)
@@ -493,6 +493,14 @@ def normalizeReferenceResults(Dir, SBOutputDir, ProjectBuildMode):
                      if SourceFile.startswith(PathPrefix)
                      else SourceFile for SourceFile in Data['files']]
             Data['files'] = Paths
+
+            # Remove transient fields which change from run to run.
+            for Diag in Data['diagnostics']:
+                if 'HTMLDiagnostics_files' in Diag:
+                    Diag.pop('HTMLDiagnostics_files')
+            if 'clang_version' in Data:
+                Data.pop('clang_version')
+
             plistlib.writePlist(Data, Plist)