All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slang: add ptest
@ 2017-03-02 17:29 Stefan Strogin
  2017-03-06 12:58 ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Strogin @ 2017-03-02 17:29 UTC (permalink / raw)
  To: openembedded-core; +Cc: xe-linux-external

Signed-off-by: Stefan Strogin <sstrogin@cisco.com>
Cc: xe-linux-external@cisco.com
---
 meta/recipes-extended/slang/slang/run-ptest        |  3 +++
 ...-add-output-in-the-format-result-testname.patch | 30
++++++++++++++++++++++
 meta/recipes-extended/slang/slang_2.3.1a.bb        | 21 ++++++++++++++-
 3 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/slang/slang/run-ptest
 create mode 100644
meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch

diff --git a/meta/recipes-extended/slang/slang/run-ptest
b/meta/recipes-extended/slang/slang/run-ptest
new file mode 100644
index 0000000000..39f474af31
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C test runtests
diff --git
a/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch
b/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch
new file mode 100644
index 0000000000..27a9bb87ea
--- /dev/null
+++
b/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch
@@ -0,0 +1,30 @@
+From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <sstrogin@cisco.com>
+Date: Thu, 2 Mar 2017 00:26:31 +0200
+Subject: [PATCH] test: add output in the format "result: testname"
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Stefan Strogin <sstrogin@cisco.com>
+---
+ src/test/runtests.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/test/runtests.sh b/src/test/runtests.sh
+index a3eaad0..64f0705 100755
+--- a/src/test/runtests.sh
++++ b/src/test/runtests.sh
+@@ -34,8 +34,10 @@ do
+     then
+ 	n_failed=`expr ${n_failed} + 1`
+ 	tests_failed="$tests_failed $testfile"
++	echo "FAIL: $testfile"
+     else
+         touch lastrun/$testfile
++	echo "PASS: $testfile"
+     fi
+ done
+ +-- +2.11.0
+
diff --git a/meta/recipes-extended/slang/slang_2.3.1a.bb
b/meta/recipes-extended/slang/slang_2.3.1a.bb
index c71d80481f..9c73a5f624 100644
--- a/meta/recipes-extended/slang/slang_2.3.1a.bb
+++ b/meta/recipes-extended/slang/slang_2.3.1a.bb
@@ -17,6 +17,8 @@ LIC_FILES_CHKSUM =
"file://COPYING;md5=a52a18a472d4f7e45479b06563717c02"
 SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \
            file://no-x.patch \
            file://dont-link-to-host.patch \
+           file://test-add-output-in-the-format-result-testname.patch \
+           file://run-ptest \
           "
  SRC_URI[md5sum] = "c5235313042ed0e71ec708f7b85ec241"
@@ -25,7 +27,7 @@ SRC_URI[sha256sum] =
"54f0c3007fde918039c058965dffdfd6c5aec0bad0f4227192cc486021
 UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/"
 PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.*
http://www.jedsoft.org/releases/slang/old/ \n"
 -inherit autotools-brokensep
+inherit autotools-brokensep ptest
 CLEANBROKEN = "1"
  EXTRA_OECONF = "--without-onig"
@@ -49,6 +51,23 @@ do_configure_prepend() {
     cd ${B}
 }
 +do_compile_ptest() {
+	oe_runmake -C src static
+	oe_runmake -C src/test sltest
+}
+
+do_install_ptest() {
+	cp -r ${S}/src/test ${D}${PTEST_PATH}/
+	mkdir ${D}${PTEST_PATH}/objs
+	cp ${S}/src/objs/libslang.a ${D}${PTEST_PATH}/objs/
+
+	cp ${S}/slsh/lib/require.sl ${D}${PTEST_PATH}/test/
+	sed -i 's/\.\.\/\.\.\/slsh\/lib\/require\.sl/require\.sl/'
${D}${PTEST_PATH}/test/req.sl
+
+	cp ${S}/doc/text/slangfun.txt ${D}${PTEST_PATH}/test/
+	sed -i 's/\.\.\/\.\.\/doc\/text\/slangfun\.txt/slangfun\.txt/'
${D}${PTEST_PATH}/test/docfun.sl
+}
+
 FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
  PARALLEL_MAKE = ""
-- 
2.11.0



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

* Re: [PATCH] slang: add ptest
  2017-03-02 17:29 [PATCH] slang: add ptest Stefan Strogin
@ 2017-03-06 12:58 ` Burton, Ross
  2017-03-09 16:45   ` Stefan Strogin
  0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2017-03-06 12:58 UTC (permalink / raw)
  To: Stefan Strogin; +Cc: xe-linux-external, OE-core

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

On 2 March 2017 at 17:29, Stefan Strogin <sstrogin@cisco.com> wrote:

> +       cp -r ${S}/src/test ${D}${PTEST_PATH}/
> +       mkdir ${D}${PTEST_PATH}/objs
> +       cp ${S}/src/objs/libslang.a ${D}${PTEST_PATH}/objs/
>

Why?

If this is because the tests need sltest, that's already been built and is
in the package: just patch the Makefile instead.  It's also huge, so I'd be
tempted to say we should strip sltest as enabling ptest for slang causes
slang-dbg to increase by 2MB.

Ross

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

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

* Re: [PATCH] slang: add ptest
  2017-03-06 12:58 ` Burton, Ross
@ 2017-03-09 16:45   ` Stefan Strogin
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Strogin @ 2017-03-09 16:45 UTC (permalink / raw)
  To: Burton, Ross; +Cc: xe-linux-external, OE-core

On 06/03/17 14:58, Burton, Ross wrote:
> 
> On 2 March 2017 at 17:29, Stefan Strogin <sstrogin@cisco.com <mailto:sstrogin@cisco.com>> wrote:
> 
>     +       cp -r ${S}/src/test ${D}${PTEST_PATH}/
>     +       mkdir ${D}${PTEST_PATH}/objs
>     +       cp ${S}/src/objs/libslang.a ${D}${PTEST_PATH}/objs/
> 
> 
> Why?
> 
> If this is because the tests need sltest, that's already been built and is in the package: just patch the Makefile instead.  It's also huge, so I'd be tempted to say we should strip sltest as enabling ptest for slang causes slang-dbg to increase by 2MB.
> 
> Ross

Sorry, my mistake. sltest doesn't need libslang.a for running, of course. I'll change the Makefile and resend the patch.


--
Thank you,
Stefan


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

end of thread, other threads:[~2017-03-09 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 17:29 [PATCH] slang: add ptest Stefan Strogin
2017-03-06 12:58 ` Burton, Ross
2017-03-09 16:45   ` Stefan Strogin

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.