[gnome-continuous-yocto/gnomeostree-3.28-rocko: 6571/8267] slang: add ptest



commit a17cf42a1240ff1c520632da853e6a7ef68389f6
Author: Stefan Strogin <sstrogin cisco com>
Date:   Tue Jun 20 19:21:02 2017 +0300

    slang: add ptest
    
    This patch adds ptest for slang, it uses `make runtests` to run tests.
    The Makefile runs runtests.sh for each *.sl and *.slc tests.
    runtests.sh is patched for printing test results in a common format,
    Makefile is patched in order not to compile any dependencies.
    
    Changes v2->v3: rebased on the latest master (1d9a88f6).
    
    (From OE-Core rev: 643c81afc16f8d3522cc5dc491459a1bae14d827)
    
    Signed-off-by: Stefan Strogin <sstrogin cisco com>
    Cc: xe-linux-external cisco com
    Signed-off-by: Ross Burton <ross burton intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 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        |   25 ++++++++++++++++-
 3 files changed, 57 insertions(+), 1 deletions(-)
---
diff --git a/meta/recipes-extended/slang/slang/run-ptest b/meta/recipes-extended/slang/slang/run-ptest
new file mode 100644
index 0000000..39f474a
--- /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 0000000..27a9bb8
--- /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 c71d804..b302104 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,27 @@ do_configure_prepend() {
     cd ${B}
 }
 
+do_compile_ptest() {
+       oe_runmake -C src static
+       oe_runmake -C src/test sltest
+}
+
+do_install_ptest() {
+       mkdir ${D}${PTEST_PATH}/test
+       for f in Makefile sltest runtests.sh *.sl *.inc; do
+               cp ${S}/src/test/$f ${D}${PTEST_PATH}/test/
+       done
+       sed -e 's/\ \$(TEST_PGM)\.c\ assoc\.c\ list\.c\ \$(SLANGLIB)\/libslang\.a//' \
+           -e '/\$(CC).*(TEST_PGM)/d' \
+           -i ${D}${PTEST_PATH}/test/Makefile
+
+       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 = ""


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]