aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/fix-tests.patch
diff options
context:
space:
mode:
authorShiz <hi@shiz.me>2017-05-08 21:15:22 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2017-05-11 04:02:27 +0000
commit5246e1f211639aed5320fa8f954bd06c83157a80 (patch)
tree930c9471aaf8cd74996bae2c584052a151982de0 /main/busybox/fix-tests.patch
parentac3901a292af18917eadb09630603fd43aa12518 (diff)
downloadaports-5246e1f211639aed5320fa8f954bd06c83157a80.tar.gz
aports-5246e1f211639aed5320fa8f954bd06c83157a80.tar.bz2
aports-5246e1f211639aed5320fa8f954bd06c83157a80.tar.xz
main/busybox: clean up APKBUILD and enable tests
Diffstat (limited to 'main/busybox/fix-tests.patch')
-rw-r--r--main/busybox/fix-tests.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/main/busybox/fix-tests.patch b/main/busybox/fix-tests.patch
new file mode 100644
index 0000000000..aed099f879
--- /dev/null
+++ b/main/busybox/fix-tests.patch
@@ -0,0 +1,66 @@
+The cpio tests don't search for the right output line correctly,
+using a hardcoded tail offset. Instead, grep for the file entry
+just added.
+
+The reverse-hunk patch tests seem to get the output order wrong,
+and the tests pass when this is corrected.
+--- a/testsuite/cpio.tests
++++ b/testsuite/cpio.tests
+@@ -129,7 +129,7 @@
+
+ optional FEATURE_CPIO_O
+ testing "cpio uses by default uid/gid" \
+-"echo $0 | cpio -o -H newc | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc | cpio -tv 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ $user/$group
+ 0
+@@ -138,7 +138,7 @@
+
+ optional FEATURE_CPIO_O
+ testing "cpio -R with create" \
+-"echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ 1234/5678
+ 0
+@@ -147,7 +147,7 @@
+
+ optional FEATURE_CPIO_O
+ testing "cpio -R with extract" \
+-"echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ 8765/4321
+ 0
+
+--- a/testsuite/patch.tests
++++ b/testsuite/patch.tests
+@@ -75,12 +75,12 @@
+ testing "patch detects already applied hunk" \
+ 'patch 2>&1; echo $?; cat input' \
+ "\
++patching file input
+ Possibly reversed hunk 1 at 4
+ Hunk 1 FAILED 1/1.
+ abc
+ +def
+ 123
+-patching file input
+ 1
+ abc
+ def
+@@ -103,12 +103,12 @@
+ testing "patch detects already applied hunk at the EOF" \
+ 'patch 2>&1; echo $?; cat input' \
+ "\
++patching file input
+ Possibly reversed hunk 1 at 4
+ Hunk 1 FAILED 1/1.
+ abc
+ 123
+ +456
+-patching file input
+ 1
+ abc
+ 123