[Git][reproducible-builds/diffoscope][master] 3 commits: Update PPU tests for compatibility with Free Pascal versions 3.2.0 or greater....

Chris Lamb gitlab at salsa.debian.org
Tue Aug 11 10:59:37 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
d0f0b215 by Chris Lamb at 2020-08-11T11:53:07+01:00
Update PPU tests for compatibility with Free Pascal versions 3.2.0 or greater. (Closes: Debian:968124)

- - - - -
90fe3f3c by Chris Lamb at 2020-08-11T11:57:36+01:00
Add an assert_diff helper that loads and compares a fixture output.

- - - - -
d76a231f by Chris Lamb at 2020-08-11T11:58:00+01:00
Move a few tests to assert_diff.

- - - - -


9 changed files:

- tests/comparators/test_android.py
- tests/comparators/test_berkeley_db.py
- tests/comparators/test_docx.py
- tests/comparators/test_dtb.py
- tests/comparators/test_ppu.py
- tests/data/ppu_expected_diff
- tests/data/test1.ppu
- tests/data/test2.ppu
- tests/utils/data.py


Changes:

=====================================
tests/comparators/test_android.py
=====================================
@@ -24,7 +24,7 @@ from diffoscope.config import Config
 from diffoscope.comparators.android import AndroidBootImgFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, assert_diff
 from ..utils.tools import skip_unless_tools_exist
 
 bootimg1 = load_fixture("android1.img")
@@ -52,8 +52,7 @@ def differences(bootimg1, bootimg2):
 @skip_unless_tools_exist("abootimg")
 @pytest.mark.skipif(bearch, reason="abootimg is buggy on BE architectures")
 def test_diff(differences):
-    expected_diff = get_data("android_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "android_expected_diff")
 
 
 @skip_unless_tools_exist("abootimg")


=====================================
tests/comparators/test_berkeley_db.py
=====================================
@@ -21,7 +21,7 @@ import pytest
 
 from diffoscope.comparators.berkeley_db import BerkeleyDBFile
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, assert_diff
 from ..utils.tools import skip_unless_tools_exist
 from ..utils.nonexisting import assert_non_existing
 
@@ -45,8 +45,7 @@ def test_no_differences(db1):
 
 @skip_unless_tools_exist("db_dump")
 def test_diff(differences):
-    expected_diff = get_data("berkeley_db_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "berkeley_db_expected_diff")
 
 
 @skip_unless_tools_exist("db_dump")


=====================================
tests/comparators/test_docx.py
=====================================
@@ -21,7 +21,7 @@ import pytest
 
 from diffoscope.comparators.docx import DocxFile
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, assert_diff
 from ..utils.tools import skip_unless_tools_exist
 from ..utils.nonexisting import assert_non_existing
 
@@ -45,8 +45,7 @@ def differences(docx1, docx2):
 
 @skip_unless_tools_exist("docx2txt")
 def test_diff(differences):
-    expected_diff = get_data("docx_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "docx_expected_diff")
 
 
 @skip_unless_tools_exist("docx2txt")


=====================================
tests/comparators/test_dtb.py
=====================================
@@ -27,7 +27,7 @@ from diffoscope.config import Config
 from diffoscope.comparators.dtb import DeviceTreeFile
 from diffoscope.comparators.missing_file import MissingFile
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, assert_diff
 from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 
 # Generated by: dtc --in-format=dts --out-format=dtb --out=devicetree1.dtb devicetree1.dts
@@ -64,8 +64,7 @@ def differences(dtb1, dtb2):
 
 @skip_unless_tool_is_at_least("fdtdump", fdtdump_version, "1.4.2")
 def test_diff(differences):
-    expected_diff = get_data("devicetree_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "devicetree_expected_diff")
 
 
 @skip_unless_tools_exist("fdtdump")


=====================================
tests/comparators/test_ppu.py
=====================================
@@ -24,7 +24,7 @@ import subprocess
 
 from diffoscope.comparators.ppu import PpuFile
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, assert_diff
 from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from ..utils.nonexisting import assert_non_existing
 
@@ -61,12 +61,11 @@ def differences(file1, file2):
     return file1.compare(file2).details
 
 
- at skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.0.0")
+ at skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.2.0")
 def test_diff(differences):
-    expected_diff = get_data("ppu_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "ppu_expected_diff")
 
 
- at skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.0.0")
+ at skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.2.0")
 def test_compare_non_existing(monkeypatch, file1):
     assert_non_existing(monkeypatch, file1, has_null_source=False)


=====================================
tests/data/ppu_expected_diff
=====================================
@@ -1,17 +1,105 @@
-@@ -15,15 +15,15 @@
- Definitions stored      : 121
- Symbols stored          : 398
+@@ -4,26 +4,26 @@
+ 
+ Header
+ -------
+ Compiler version        : 3.2.0
+ Target processor        : x86_64
+ Target operating system : Linux-x86-64
+ Unit flags              : no_link, little_endian, release, local_symtable
+-FileSize (w/o header)   : 756
+-Checksum                : 3CCDD3E4
+-Interface Checksum      : 800507DD
++FileSize (w/o header)   : 812
++Checksum                : 0ABC639D
++Interface Checksum      : 8061E805
+ Indirect Checksum       : 2A5CA015
+ Definitions stored      : 1
+ Symbols stored          : 4
  
  Interface section
  ------------------
- Module Name: CastleGenericLists
- 
--Source file 1 : castlegenericlists.pas 2016/02/17 15:03:46
-+Source file 1 : castlegenericlists.pas 2016/02/17 15:04:53
- Uses unit: System (Crc: 09C1FD4E, IntfcCrc: 3A093E2F, IndCrc: FEDD6E0A)
- Uses unit: objpas (Crc: 663BC437, IntfcCrc: CA7886A2, IndCrc: 64D020AC)
- Uses unit: fgl (Crc: C38E0A5A, IntfcCrc: 470D2834, IndCrc: 0764D076)
- Link unit object file: castlegenericlists.o (static )
- DerefMapsize: 2
- DerefMap[0] = FGL
- DerefMap[1] = SYSTEM
+-Module Name: CastleInternalPng
++Module Name: CastleInternalDoubleLists
+ 
+-Source file 1 : castleinternalpng.pas 2018/01/21 10:59:47
++Source file 1 : castleinternaldoublelists.pas 2018/01/21 10:59:47
+ Source file 2 : castleconf.inc 2020/08/10 16:13:09
+ Uses unit: System (Crc: 834E727C, IntfcCrc: 11606A94, IndCrc: E1A3CEBA)
+ Uses unit: objpas (Crc: 8ADEDA2C, IntfcCrc: 2E3EFC00, IndCrc: CBFF6EAF)
+ DerefMapsize: 1
+ DerefMap[0] = SYSTEM
+ Derefdata length: 27
+ 
+@@ -34,26 +34,26 @@
+ Interface definitions
+ ----------------------
+ 
+ Interface Symbols
+ ------------------
+ Symtable count: 3
+ ** Symbol Id 0 **
+-Unit symbol CastleInternalPng
+-     File Pos : 1 (16,1)
++Unit symbol CastleInternalDoubleLists
++     File Pos : 1 (22,1)
+    Visibility : public
+    SymOptions : 
+ ** Symbol Id 1 **
+ Unit symbol SYSTEM
+-     File Pos : 1 (16,10)
++     File Pos : 1 (22,10)
+    Visibility : public
+    SymOptions : 
+ ** Symbol Id 2 **
+ Unit symbol OBJPAS
+-     File Pos : 1 (19,15)
++     File Pos : 1 (34,15)
+    Visibility : public
+    SymOptions : 
+ 
+ Interface Macro Symbols
+ -----------------------
+ (no exported macros)
+ 
+@@ -84,36 +84,36 @@
+       Type symbol : (0) Nil
+        DefOptions : 
+         DefStates : 
+       Return type : (4) Unit 0, DefId 3
+        TypeOption : UnitInit
+        CallOption : Register
+           Options : HasCallingConvention, HasMangledName, Global
+-     Mangled name : CASTLEINTERNALPNG_$$_init$
++     Mangled name : CASTLEINTERNALDOUBLELISTS_$$_init$
+            Number : 65535
+             Level : 1
+             Class : (13) Nil
+           Procsym : (15) SymId 3
+-         File Pos : 1 (20,1)
++         File Pos : 1 (44,1)
+        Visibility : hidden
+        SymOptions : 
+         Import Nr : 0
+-      Alias names : INIT$_$CASTLEINTERNALPNG, CASTLEINTERNALPNG_$$_init$
++      Alias names : INIT$_$CASTLEINTERNALDOUBLELISTS, CASTLEINTERNALDOUBLELISTS_$$_init$
+     ------ parast ------
+     Symtable options: none
+     ------ parast ------
+     ------ parast ------
+     Symtable count: 0
+ 
+ Static Symbols
+ ------------------
+ Symtable count: 1
+ ** Symbol Id 3 **
+-Procedure symbol $CASTLEINTERNALPNG_$$_init$
+-     File Pos : 1 (20,1)
++Procedure symbol $CASTLEINTERNALDOUBLELISTS_$$_init$
++     File Pos : 1 (44,1)
+    Visibility : public
+    SymOptions : 
+    Definition : (21) DefId 0
+ 
+ WPO info
+ --------
+ ** Instantiated Object/Class types: 0 **


=====================================
tests/data/test1.ppu
=====================================
Binary files a/tests/data/test1.ppu and b/tests/data/test1.ppu differ


=====================================
tests/data/test2.ppu
=====================================
Binary files a/tests/data/test2.ppu and b/tests/data/test2.ppu differ


=====================================
tests/utils/data.py
=====================================
@@ -47,6 +47,10 @@ def get_data(filename):
         return f.read()
 
 
+def assert_diff(difference, filename):
+    assert difference.unified_diff == get_data(filename)
+
+
 # https://code.activestate.com/recipes/576620-changedirectory-context-manager/#c3
 @contextlib.contextmanager
 def cwd_data():



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/26d9a39f142476ed00586e2ff4d0203f1bf101c0...d76a231f6ff1e706ed9080a8431db19b0aa9190f

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/26d9a39f142476ed00586e2ff4d0203f1bf101c0...d76a231f6ff1e706ed9080a8431db19b0aa9190f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200811/f158f875/attachment.htm>


More information about the rb-commits mailing list