Skip to contentSkip to conversation

gzip: add ptest

PATCH In review Denys Zagorui 2 participants 3 messages Mar 9, 2017 – Mar 12, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gzip: add ptest

tests don't work with 'diff' and 'less' utils from busybox

---
 meta/recipes-extended/gzip/files/run-ptest |  6 ++++++
 meta/recipes-extended/gzip/gzip_1.8.bb     | 18 +++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/gzip/files/run-ptest
meta/recipes-extended/gzip/files/run-ptest new file +6 -0
new file mode 100644
index 0000000..cf7c649
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd src/tests
+
+make check
+
meta/recipes-extended/gzip/gzip_1.8.bb +17 -1
index 11be846..1f8c026 100644
@@ -2,7 +2,8 @@ require gzip.inc
 
 LICENSE = "GPLv3+"
 
-SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
+SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \
+	    file://run-ptest"
 SRC_URI_append_class-target = " file://wrong-path-fix.patch"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
@@ -12,6 +13,21 @@ PROVIDES_append_class-native = " gzip-replacement-native"
 
 BBCLASSEXTEND = "native"
 
+inherit ptest 
+
+RDEPENDS_${PN}-ptest = "less diffutils gawk perl"
+
+do_install_ptest() {
+	mkdir -p ${D}${PTEST_PATH}/src/build-aux
+	cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/src/build-aux/
+	mkdir -p ${D}${PTEST_PATH}/src/tests
+	cp -r ${S}/tests/* ${D}${PTEST_PATH}/src/tests
+	sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./'           \
+            -e 's/^srcdir = ..*/srcdir = \./'                     \
+            -e 's/^Makefile: ..*/Makefile: /'                     \
+            ${B}/tests/Makefile > ${D}${PTEST_PATH}/src/tests/Makefile
+}
+
 SRC_URI[md5sum] = "732553152814b22dc35aa0267df5286c"
 SRC_URI[sha256sum] = "1ff7aedb3d66a0d73f442f6261e4b3860df6fd6c94025c2cb31a202c9c60fe0e"
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Denys Zagorui

tests don't work with 'diff' and 'less' utils from busybox

I don't think that depending on diff and less is the right solution for that problem, because then enabling testing will change the system that is meant to be tested.

For example, suppose that the real system only has busybox and busybox diff needs to work. That version of diff cannot be tested anymore with IMAGE_FEATURES += "ptest-pkgs" because that will pull in gzip-ptest, which then overrides the busybox diff.

Perhaps the tests can be fixed to work also with busybox, or the tests can detect busybox and skip the part that depends on real diff and less?

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.

A message that is not in the archive (sent off-list or not yet received): CACJ80St7+4KB+Tm6J=Gqmyc-UVxuky_9Qwu25kFwqJ68=TWKzw@mail.gmail.com

#3 lore raw

Denys Zagorui
GlobalLogic
Kyiv, 03038, Protasov Business Park, N.Grinchenka, 2/1 M +380.67.317.30.93
www.globallogic.com

http://www.globallogic.com/email_disclaimer.txt

11 марта 2017 12:52 пользователь "Denys Zagorui" <[email protected]> написал:

Quoted 42 lines

Hello, thanks for reply.
I figure out that 'zless' from gzip 1.8 don,t work with 'less' from busybox. It's because 'zless' tries to verify 'less' version invoke it with key -V, and 'less' from busybox don't understand this key, so test 'help-version' fails. So when i remove version verification from 'zless' it's works fine.
'zdiff' test also fails, because 'diff' from busybox has another output then 'diff' from diffutils package, so patch zdiff test (add version verification), if 'diff' from busybox i check one output, if from diffutils another.

10 марта 2017 09:10 пользователь "Patrick Ohly" <[email protected]> написал:

Quoted 26 lines · Denys Zagorui
Quoted 1 line

tests don't work with 'diff' and 'less' utils from busybox

I don't think that depending on diff and less is the right solution for that problem, because then enabling testing will change the system that is meant to be tested.

For example, suppose that the real system only has busybox and busybox diff needs to work. That version of diff cannot be tested anymore with IMAGE_FEATURES += "ptest-pkgs" because that will pull in gzip-ptest, which then overrides the busybox diff.

Perhaps the tests can be fixed to work also with busybox, or the tests can detect busybox and skip the part that depends on real diff and less?

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.