diff options
author | Stefan Strogin <sstrogin@cisco.com> | 2017-06-20 19:21:02 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 20:55:08 +0100 |
commit | a17cf42a1240ff1c520632da853e6a7ef68389f6 (patch) | |
tree | f13a2dd145bcaeceb5c1470d5c09f0258dd1f68e | |
parent | e8b1c653946ef921b65d47e52aea0dc530ef4286 (diff) | |
download | poky-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>
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 | |||
3 | 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 @@ | |||
1 | From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Stefan Strogin <sstrogin@cisco.com> | ||
3 | Date: Thu, 2 Mar 2017 00:26:31 +0200 | ||
4 | Subject: [PATCH] test: add output in the format "result: testname" | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe specific] | ||
7 | |||
8 | Signed-off-by: Stefan Strogin <sstrogin@cisco.com> | ||
9 | --- | ||
10 | src/test/runtests.sh | 2 ++ | ||
11 | 1 file changed, 2 insertions(+) | ||
12 | |||
13 | diff --git a/src/test/runtests.sh b/src/test/runtests.sh | ||
14 | index 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 | -- | ||
29 | 2.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" | |||
17 | SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \ | 17 | SRC_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 | ||
22 | SRC_URI[md5sum] = "c5235313042ed0e71ec708f7b85ec241" | 24 | SRC_URI[md5sum] = "c5235313042ed0e71ec708f7b85ec241" |
@@ -25,7 +27,7 @@ SRC_URI[sha256sum] = "54f0c3007fde918039c058965dffdfd6c5aec0bad0f4227192cc486021 | |||
25 | UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/" | 27 | UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/" |
26 | PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n" | 28 | PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n" |
27 | 29 | ||
28 | inherit autotools-brokensep | 30 | inherit autotools-brokensep ptest |
29 | CLEANBROKEN = "1" | 31 | CLEANBROKEN = "1" |
30 | 32 | ||
31 | EXTRA_OECONF = "--without-onig" | 33 | EXTRA_OECONF = "--without-onig" |
@@ -49,6 +51,27 @@ do_configure_prepend() { | |||
49 | cd ${B} | 51 | cd ${B} |
50 | } | 52 | } |
51 | 53 | ||
54 | do_compile_ptest() { | ||
55 | oe_runmake -C src static | ||
56 | oe_runmake -C src/test sltest | ||
57 | } | ||
58 | |||
59 | do_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 | |||
52 | FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/" | 75 | FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/" |
53 | 76 | ||
54 | PARALLEL_MAKE = "" | 77 | PARALLEL_MAKE = "" |