summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Strogin <sstrogin@cisco.com>2017-06-20 19:21:02 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-28 20:55:08 +0100
commita17cf42a1240ff1c520632da853e6a7ef68389f6 (patch)
treef13a2dd145bcaeceb5c1470d5c09f0258dd1f68e
parente8b1c653946ef921b65d47e52aea0dc530ef4286 (diff)
downloadpoky-a17cf42a1240ff1c520632da853e6a7ef68389f6.tar.gz
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>
-rw-r--r--meta/recipes-extended/slang/slang/run-ptest3
-rw-r--r--meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch30
-rw-r--r--meta/recipes-extended/slang/slang_2.3.1a.bb25
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 0000000000..39f474af31
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make -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 @@
1From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001
2From: Stefan Strogin <sstrogin@cisco.com>
3Date: Thu, 2 Mar 2017 00:26:31 +0200
4Subject: [PATCH] test: add output in the format "result: testname"
5
6Upstream-Status: Inappropriate [oe specific]
7
8Signed-off-by: Stefan Strogin <sstrogin@cisco.com>
9---
10 src/test/runtests.sh | 2 ++
11 1 file changed, 2 insertions(+)
12
13diff --git a/src/test/runtests.sh b/src/test/runtests.sh
14index a3eaad0..64f0705 100755
15--- a/src/test/runtests.sh
16+++ b/src/test/runtests.sh
17@@ -34,8 +34,10 @@ do
18 then
19 n_failed=`expr ${n_failed} + 1`
20 tests_failed="$tests_failed $testfile"
21+ echo "FAIL: $testfile"
22 else
23 touch lastrun/$testfile
24+ echo "PASS: $testfile"
25 fi
26 done
27
28--
292.11.0
30
diff --git a/meta/recipes-extended/slang/slang_2.3.1a.bb b/meta/recipes-extended/slang/slang_2.3.1a.bb
index c71d80481f..b302104ee1 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"
17SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \ 17SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \
18 file://no-x.patch \ 18 file://no-x.patch \
19 file://dont-link-to-host.patch \ 19 file://dont-link-to-host.patch \
20 file://test-add-output-in-the-format-result-testname.patch \
21 file://run-ptest \
20 " 22 "
21 23
22SRC_URI[md5sum] = "c5235313042ed0e71ec708f7b85ec241" 24SRC_URI[md5sum] = "c5235313042ed0e71ec708f7b85ec241"
@@ -25,7 +27,7 @@ SRC_URI[sha256sum] = "54f0c3007fde918039c058965dffdfd6c5aec0bad0f4227192cc486021
25UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/" 27UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/"
26PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n" 28PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n"
27 29
28inherit autotools-brokensep 30inherit autotools-brokensep ptest
29CLEANBROKEN = "1" 31CLEANBROKEN = "1"
30 32
31EXTRA_OECONF = "--without-onig" 33EXTRA_OECONF = "--without-onig"
@@ -49,6 +51,27 @@ do_configure_prepend() {
49 cd ${B} 51 cd ${B}
50} 52}
51 53
54do_compile_ptest() {
55 oe_runmake -C src static
56 oe_runmake -C src/test sltest
57}
58
59do_install_ptest() {
60 mkdir ${D}${PTEST_PATH}/test
61 for f in Makefile sltest runtests.sh *.sl *.inc; do
62 cp ${S}/src/test/$f ${D}${PTEST_PATH}/test/
63 done
64 sed -e 's/\ \$(TEST_PGM)\.c\ assoc\.c\ list\.c\ \$(SLANGLIB)\/libslang\.a//' \
65 -e '/\$(CC).*(TEST_PGM)/d' \
66 -i ${D}${PTEST_PATH}/test/Makefile
67
68 cp ${S}/slsh/lib/require.sl ${D}${PTEST_PATH}/test/
69 sed -i 's/\.\.\/\.\.\/slsh\/lib\/require\.sl/require\.sl/' ${D}${PTEST_PATH}/test/req.sl
70
71 cp ${S}/doc/text/slangfun.txt ${D}${PTEST_PATH}/test/
72 sed -i 's/\.\.\/\.\.\/doc\/text\/slangfun\.txt/slangfun\.txt/' ${D}${PTEST_PATH}/test/docfun.sl
73}
74
52FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/" 75FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
53 76
54PARALLEL_MAKE = "" 77PARALLEL_MAKE = ""