Merge pull request #252053 from amarshall/diffoscope-fix

authored by

Ryan Lahfa and committed by
GitHub
a3cbbe6e c04f87be

+59
+1
pkgs/tools/misc/diffoscope/default.nix
··· 92 92 93 93 patches = [ 94 94 ./ignore_links.patch 95 + ./fix-test_fit.patch 95 96 ]; 96 97 97 98 postPatch = ''
+58
pkgs/tools/misc/diffoscope/fix-test_fit.patch
··· 1 + From f1e9fa32c925fe7fb3cd825a02dcff52d305d845 Mon Sep 17 00:00:00 2001 2 + From: Andrew Marshall <andrew@johnandrewmarshall.com> 3 + Date: Mon, 28 Aug 2023 19:03:38 -0400 4 + Subject: [PATCH] Fix test_fit with file 5.45 5 + 6 + See also 435a8fe9a201a7e74e705e06cc56b66fa6cb4af9. 7 + --- 8 + tests/comparators/test_fit.py | 20 +++++++++++++------- 9 + 1 file changed, 13 insertions(+), 7 deletions(-) 10 + 11 + diff --git a/tests/comparators/test_fit.py b/tests/comparators/test_fit.py 12 + index d8478c00..47258a3e 100644 13 + --- a/tests/comparators/test_fit.py 14 + +++ b/tests/comparators/test_fit.py 15 + @@ -27,7 +27,11 @@ 16 + from diffoscope.comparators.utils.specialize import specialize 17 + 18 + from ..utils.data import data, assert_diff, load_fixture 19 + -from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least 20 + +from ..utils.tools import ( 21 + + skip_unless_file_version_is_at_least, 22 + + skip_unless_tool_is_at_least, 23 + + skip_unless_tools_exist, 24 + +) 25 + from ..utils.nonexisting import assert_non_existing 26 + 27 + cpio1 = load_fixture("test1.cpio") 28 + @@ -124,19 +128,21 @@ def test_nested_listing(nested_differences): 29 + @skip_unless_tools_exist("cpio") 30 + @skip_unless_tool_is_at_least("dumpimage", dumpimage_version, "2021.01") 31 + @skip_unless_tools_exist("fdtdump") 32 + +@skip_unless_file_version_is_at_least("5.45") 33 + def test_nested_symlink(nested_differences): 34 + - assert nested_differences[1].source1 == "dir/link" 35 + - assert nested_differences[1].comment == "symlink" 36 + - assert_diff(nested_differences[1], "symlink_expected_diff") 37 + + assert nested_differences[2].source1 == "dir/link" 38 + + assert nested_differences[2].comment == "symlink" 39 + + assert_diff(nested_differences[2], "symlink_expected_diff") 40 + 41 + 42 + @skip_unless_tools_exist("cpio") 43 + @skip_unless_tool_is_at_least("dumpimage", dumpimage_version, "2021.01") 44 + @skip_unless_tools_exist("fdtdump") 45 + +@skip_unless_file_version_is_at_least("5.45") 46 + def test_nested_compressed_files(nested_differences): 47 + - assert nested_differences[2].source1 == "dir/text" 48 + - assert nested_differences[2].source2 == "dir/text" 49 + - assert_diff(nested_differences[2], "text_ascii_expected_diff") 50 + + assert nested_differences[3].source1 == "dir/text" 51 + + assert nested_differences[3].source2 == "dir/text" 52 + + assert_diff(nested_differences[3], "text_ascii_expected_diff") 53 + 54 + 55 + @skip_unless_tools_exist("cpio") 56 + -- 57 + 2.41.0 58 +