File testsuite-endian.patch of Package busybox
--- busybox-1.37.0/testsuite/runtest.orig 2025-03-10 10:04:28.909724356 +0100
+++ busybox-1.37.0/testsuite/runtest 2025-03-10 10:26:23.695736520 +0100
@@ -4,6 +4,12 @@
. ./testing.sh
+# use ELF endian definition to detect build endianess
+buildendianess=$(../busybox-static hexdump -s 5 -n 1 -C ../busybox-static | head -n 1)
+buildendianess=${buildendianess:11:1}
+verboseendian=([1]="little" [2]="big")
+export ENDIAN=${ENDIAN:-${verboseendian[$buildendianess]}}
+
total_failed=0
# Run one old-style test.
--- busybox-1.37.0/testsuite/hexdump.tests.orig 2025-03-10 10:04:22.640788448 +0100
+++ busybox-1.37.0/testsuite/hexdump.tests 2025-03-10 10:04:35.813313575 +0100
@@ -66,20 +66,39 @@
"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\
+if [ "$ENDIAN" = "little" ]; then
testing "hexdump -e /2 %d" \
- "hexdump -e '8/2 \" %6d\" \"\n\"'" \
- "\
+ "hexdump -e '8/2 \" %6d\" \"\n\"'" \
+ "\
256 770 1284 1798 2312 2826 3340 3854
4368 4882 5396 5910 6424 6938 7452 7966
29040 29554 30068 30582 31096 31610 32124 32638
-32384 -31870 -31356 -30842 -30328 -29814 -29300 -28786
-3600 -3086 -2572 -2058 -1544 -1030 -516 -2
" \
- "" \
+ "" \
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"\
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"\
"\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"\
"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\
+else
+testing "hexdump -e /2 %d" \
+ "hexdump -e '8/2 \" %6d\" \"\n\"'" \
+ "\
+ 1 515 1029 1543 2057 2571 3085 3599
+ 4113 4627 5141 5655 6169 6683 7197 7711
+ 28785 29299 29813 30327 30841 31355 31869 32383
+ -32639 -32125 -31611 -31097 -30583 -30069 -29555 -29041
+ -3855 -3341 -2827 -2313 -1799 -1285 -771 -257
+" \
+ "" \
+"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"\
+"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"\
+"\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"\
+"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\
+"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\
+
+fi
exit $FAILCOUNT