All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gzip: add ptest
@ 2017-03-09 20:48 Denys Zagorui
  2017-03-10  7:10 ` Patrick Ohly
  0 siblings, 1 reply; 3+ messages in thread
From: Denys Zagorui @ 2017-03-09 20:48 UTC (permalink / raw)
  To: openembedded-core; +Cc: Denys Zagorui

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

Signed-off-by: Denys Zagorui <denys.zagorui@gmail.com>
---
 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

diff --git a/meta/recipes-extended/gzip/files/run-ptest b/meta/recipes-extended/gzip/files/run-ptest
new file mode 100644
index 0000000..cf7c649
--- /dev/null
+++ b/meta/recipes-extended/gzip/files/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd src/tests
+
+make check
+
diff --git a/meta/recipes-extended/gzip/gzip_1.8.bb b/meta/recipes-extended/gzip/gzip_1.8.bb
index 11be846..1f8c026 100644
--- a/meta/recipes-extended/gzip/gzip_1.8.bb
+++ b/meta/recipes-extended/gzip/gzip_1.8.bb
@@ -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"
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gzip: add ptest
  2017-03-09 20:48 [PATCH] gzip: add ptest Denys Zagorui
@ 2017-03-10  7:10 ` Patrick Ohly
       [not found]   ` <CACJ80St7+4KB+Tm6J=Gqmyc-UVxuky_9Qwu25kFwqJ68=TWKzw@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Ohly @ 2017-03-10  7:10 UTC (permalink / raw)
  To: Denys Zagorui; +Cc: openembedded-core

On Thu, 2017-03-09 at 22:48 +0200, Denys Zagorui wrote:
> 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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gzip: add ptest
       [not found]   ` <CACJ80St7+4KB+Tm6J=Gqmyc-UVxuky_9Qwu25kFwqJ68=TWKzw@mail.gmail.com>
@ 2017-03-12 20:02     ` Denys Zagorui
  0 siblings, 0 replies; 3+ messages in thread
From: Denys Zagorui @ 2017-03-12 20:02 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]

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" <denys.zagorui@gmail.com>
написал:

> 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" <patrick.ohly@intel.com>
> написал:
>
>> On Thu, 2017-03-09 at 22:48 +0200, Denys Zagorui wrote:
>> > 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.
>>
>>
>>
>>

[-- Attachment #2: Type: text/html, Size: 3015 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-12 20:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09 20:48 [PATCH] gzip: add ptest Denys Zagorui
2017-03-10  7:10 ` Patrick Ohly
     [not found]   ` <CACJ80St7+4KB+Tm6J=Gqmyc-UVxuky_9Qwu25kFwqJ68=TWKzw@mail.gmail.com>
2017-03-12 20:02     ` Denys Zagorui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.