]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
quilt: rewrite ptest glue
authorRoss Burton <ross.burton@arm.com>
Fri, 13 Jan 2023 16:57:01 +0000 (16:57 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 15 Jan 2023 08:46:07 +0000 (08:46 +0000)
The ptest glue was overly complex. Not as many files are needed to be
installed if we tell it to use the system's quilt tools, there's no
need for a custom Makefile just to set some environment variables, and
/usr/bin/ed doesn't appear to be used at all.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/quilt/quilt.inc
meta/recipes-devtools/quilt/quilt/Makefile [deleted file]
meta/recipes-devtools/quilt/quilt/run-ptest
meta/recipes-devtools/quilt/quilt/test.sh

index ec69705093b94fc2e40ec39fbb20f08334707ae0..b4284dcafb32480a79bd6b0763f07d3c04043abc 100644 (file)
@@ -9,7 +9,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
 SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
         file://run-ptest \
-        file://Makefile \
         file://test.sh \
         file://0001-tests-Allow-different-output-from-mv.patch \
         file://fix-grep-3.8.patch \
@@ -61,17 +60,12 @@ do_install:append:class-native () {
     touch ${D}${sysconfdir}/quiltrc
 }
 
-do_compile_ptest() {
-       oe_runmake bin/patch-wrapper test/.depend
-}
-
 do_install_ptest() {
-       tar -c --exclude=\*.in bin/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
-       tar -c --exclude=\*.in compat/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
-       tar -c --exclude=\*.in quilt/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
-       tar -c --exclude=mail.test --exclude=delete.test test/ | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
-       cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
-       cp ${WORKDIR}/test.sh ${D}${PTEST_PATH}
+       install ${WORKDIR}/test.sh ${D}${PTEST_PATH}
+    mkdir ${D}${PTEST_PATH}/test
+    install ${S}/test/* ${D}${PTEST_PATH}/test
+    # mail needs a MTA, and the patch-wrapper is disabled
+    rm -f ${D}${PTEST_PATH}/test/mail.test ${D}${PTEST_PATH}/test/patch-wrapper.test
 }
 
 PACKAGES += "guards guards-doc"
@@ -85,9 +79,9 @@ FILES:guards-doc = "${mandir}/man1/guards.1"
 RDEPENDS:${PN} = "bash patch diffstat bzip2 util-linux less"
 RDEPENDS:${PN}:class-native = "diffstat-native patch-native bzip2-native"
 
-RDEPENDS:${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
-                        perl-module-filehandle perl-module-getopt-std \
-                        perl-module-posix perl-module-file-temp \
-                        perl-module-text-parsewords perl-module-overloading \
-                        bash util-linux-getopt patch \
-                       "
+RDEPENDS:${PN}-ptest += "file sed gawk diffutils findutils ed perl \
+                         perl-module-filehandle perl-module-getopt-std \
+                         perl-module-posix perl-module-file-temp \
+                         perl-module-text-parsewords perl-module-overloading \
+                         bash util-linux-getopt \
+                        "
diff --git a/meta/recipes-devtools/quilt/quilt/Makefile b/meta/recipes-devtools/quilt/quilt/Makefile
deleted file mode 100644 (file)
index 1f6cd24..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-PATH :=         $(CURDIR)/bin:$(CURDIR)/compat:$(PATH)
-QUILT_DIR :=    $(CURDIR)/quilt
-QUILTRC :=      $(CURDIR)/test/test.quiltrc
-export QUILT_DIR QUILTRC
-CHECK_ENV := P=patches/; _P=../patches/; export P _P;
-CHECK_ENV += QUILT_PC=.pc; export QUILT_PC
--include test/.depend
-
-check-% : test/%.test
-       @LANG=C; LC_ALL=C; \
-       export LANG LC_ALL; \
-       $(CHECK_ENV); \
-       cd $(<D); \
-       ./run -q $(<F)
index d2de5c855a353737e543a1b3ecb83d15922b1836..322508cbe25338eecb745193d9c32b474a5ceda9 100755 (executable)
@@ -1,8 +1,7 @@
 #!/bin/sh
 
-THIS_SH=/bin/sh
-ln -sf /bin/ed /usr/bin/ed
 /usr/sbin/adduser --disabled-password --gecos "" quilttest
-su -c "${THIS_SH} ./test.sh" quilttest
+
+su -c ./test.sh quilttest
+
 /usr/sbin/deluser quilttest
-rm -f /usr/bin/ed
index 6563e4a2fb0213c7226d47dba61724cefa3222bd..7dac8f44231194aa55dc97bc56136c89137ee39a 100755 (executable)
@@ -1 +1,24 @@
-for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
+#! /bin/sh
+
+set -e -u
+
+export LANG=C
+export LC_ALL=C
+export P=patches/
+export _P=../patches/
+export QUILTRC=$(pwd)/test/test.quiltrc
+export QUILT_PC=.pc
+export QUILT_DIR=/usr/share/quilt/
+
+# Specify on the commandline, else runs all of the tests
+TESTS=${@:-test/*.test}
+
+for FILENAME in $TESTS; do
+    TESTNAME=$(basename $FILENAME .test)
+    ./test/run $FILENAME
+    if [ $? -eq 0 ];
+        then echo PASS: $TESTNAME
+    else
+        echo FAIL: $TESTNAME
+    fi
+done