[Git][reproducible-builds/diffoscope][master] Fix test_libmix_differences on openSUSE Tumbleweed. (Closes: #reproducible-builds/diffoscope#244)
Chris Lamb
gitlab at salsa.debian.org
Mon Mar 15 12:46:00 UTC 2021
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
fda75c73 by Chris Lamb at 2021-03-15T12:45:39+00:00
Fix test_libmix_differences on openSUSE Tumbleweed. (Closes: #reproducible-builds/diffoscope#244)
- - - - -
2 changed files:
- tests/comparators/test_elf.py
- + tests/data/elfmix_x_obj_objdump_expected_diff
Changes:
=====================================
tests/comparators/test_elf.py
=====================================
@@ -182,15 +182,22 @@ def test_libmix_differences(libmix_differences):
x86_o = x86_o.details[0]
assert x86_o.source1.startswith("objdump ")
assert src_c.source1.endswith(".c")
- x_obj = x_obj.details[0]
- assert x_obj.source1.startswith("readelf ")
# Content
assert "return42_or_3" in file_list.unified_diff
assert_diff(mach_o, "elfmix_mach_o_expected_diff")
assert_diff(x86_o, "elfmix_disassembly_expected_diff")
assert_diff(src_c, "elfmix_src_c_expected_diff")
- assert_diff(x_obj, "elfmix_x_obj_expected_diff")
+
+ x_obj = x_obj.details[0]
+ if x_obj.source1.startswith("readelf "):
+ assert_diff(x_obj, "elfmix_x_obj_expected_diff")
+ elif x_obj.source1.startswith("objdump "):
+ assert_diff(x_obj, "elfmix_x_obj_objdump_expected_diff")
+ else:
+ pytest.fail(
+ f"x_obj is neither readelf or objdump: {repr(x_obj.source1)}"
+ )
TEST_DBGSYM_DEB1_PATH = data("dbgsym/add/test-dbgsym_1_amd64.deb")
=====================================
tests/data/elfmix_x_obj_objdump_expected_diff
=====================================
@@ -0,0 +1,12 @@
+@@ -3,9 +3,9 @@
+
+ Disassembly of section .text:
+
+ 00000000 <return42_or_3>:
+ return42_or_3():
+ entry a1, 32
+ mov.n a7, a1
+- movi.n a2, 42
++ movi.n a2, 43
+ retw.n
+
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/fda75c731cd20383b15bcfc3326100b5ecd0787f
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/fda75c731cd20383b15bcfc3326100b5ecd0787f
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/20210315/01109f94/attachment.htm>
More information about the rb-commits
mailing list