slang: add ptest
PATCH v3 1/1 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).
--- 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 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
meta/recipes-extended/slang/slang/run-ptest new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh + +make -C test runtests
meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch new file +30 -0
@@ -0,0 +1,30 @@ +From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001 +From: Stefan Strogin <[email protected]> +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 <[email protected]> +--- + 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 +
meta/recipes-extended/slang/slang_2.3.1a.bb +24 -1
@@ -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 = ""
Signature · 1 line
2.11.0
Hello Stefan,
There is an error when do_compile_ptest_base:
| ../objs/libslang.a(sldisply.o): In function `tt_tgetstr': | /usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2576: undefined reference to `tgetstr' | ../objs/libslang.a(sldisply.o): In function `SLtt_initialize': | /usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2770: undefined reference to `tgetent' | ../objs/libslang.a(sldisply.o): In function `tt_tgetflag': | /usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2635: undefined reference to `tgetflag'
It is because it uses ncurses5-config which is wrong in oe-core, the log.do_configure shows:
checking for ncurses5-config... /buildarea/lyang1/test_m/tmp/work/i586-poky-linux/slang/2.3.1a-r0/recipe-sysroot/usr/bin/crossscripts/ncurses5-config checking for terminfo... ERROR: /usr/bin/ncurses5-config should not be used, use an alternative such as pkg-config
Would you please fix it?
// Robert
Quoted 113 lines · Stefan Strogin
This patch adds ptest for slang, it uses
make runteststo run tests. TheMakefilerunsruntests.shfor each *.sl and *.slc tests.runtests.shis patched for printing test results in a common format,Makefileis patched in order not to compile any dependencies.Changes
v2->v3: rebased on the latest master (1d9a88f6).Signed-off-by Stefan Strogin <[email protected]>--- 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 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.patchmeta/recipes-extended/slang/slang/run-ptest new file +3
-0@@ -0,0 +1,3 @@ +#!/bin/sh + +make -C test runtestsmeta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch new file +30
-0@@ -0,0 +1,30 @@ +From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001 +From: Stefan Strogin <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-extended/slang/slang_2.3.1a.bb +24
-1@@ -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 = ""
Hi Robert,
Thanks for the report. Could you say how to reproduce the error? What target architecture, config options, oe-core version, etc do you use? I have tried with openembedded-core 643c81af (master), with
MACHINE = "qemux86-64",EXTRA_IMAGE_FEATURES ?= "debug-tweaks ptest-pkgs"DISTRO_FEATURES += "ptest"
and CORE_IMAGE_EXTRA_INSTALL += "slang"
set in local.conf, everything builds fine.
--
Stefan
Quoted 141 lines · Robert Yang
Hello Stefan,
There is an error when
do_compile_ptest_base:| ../objs/libslang.a(sldisply.o): In function `tt_tgetstr':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2576: undefined reference to `tgetstr'
| ../objs/libslang.a(sldisply.o): In function `SLtt_initialize':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2770: undefined reference to `tgetent'
| ../objs/libslang.a(sldisply.o): In function `tt_tgetflag':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2635: undefined reference to `tgetflag'It is because it uses ncurses5-config which is wrong in oe-core, the log.do_configure shows:
checking for ncurses5-config... /buildarea/lyang1/test_m/tmp/work/i586-poky-linux/slang/2.3.1a-r0/recipe-sysroot/usr/bin/crossscripts/ncurses5-config checking for terminfo... ERROR:
/usr/bin/ncurses5-configshould not be used, use
an alternative such as pkg-configWould you please fix it?
// Robert
Quoted 113 lines · Stefan Strogin
This patch adds ptest for slang, it uses
make runteststo run tests. TheMakefilerunsruntests.shfor each *.sl and *.slc tests.runtests.shis patched for printing test results in a common format,Makefileis patched in order not to compile any dependencies.Changes
v2->v3: rebased on the latest master (1d9a88f6).Signed-off-by Stefan Strogin <[email protected]>--- 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 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.patchmeta/recipes-extended/slang/slang/run-ptest new file +3
-0@@ -0,0 +1,3 @@ +#!/bin/sh + +make -C test runtestsmeta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch new file +30
-0@@ -0,0 +1,30 @@ +From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001 +From: Stefan Strogin <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-extended/slang/slang_2.3.1a.bb +24
-1@@ -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 = ""
Quoted 9 lines · Stefan Strogin
Hi Robert,
Thanks for the report. Could you say how to reproduce the error? What target architecture, config options, oe-core version, etc do you use? I have tried with openembedded-core
643c81af(master), with
MACHINE = "qemux86-64",EXTRA_IMAGE_FEATURES?= "debug-tweaks ptest-pkgs"DISTRO_FEATURES+= "ptest"
andCORE_IMAGE_EXTRA_INSTALL+= "slang"
set in local.conf, everything builds fine.
The ARCH doesn't matter, I can see the error on every builds, is there "ERROR: /usr/bin/ncurses5-config should not be used" in your log.do_configure please ? What does it use for ncurses in your build?
// Robert
Quoted 148 lines
--
StefanQuoted 141 lines · Robert Yang
Hello Stefan,
There is an error when
do_compile_ptest_base:| ../objs/libslang.a(sldisply.o): In function `tt_tgetstr':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2576: undefined reference to `tgetstr'
| ../objs/libslang.a(sldisply.o): In function `SLtt_initialize':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2770: undefined reference to `tgetent'
| ../objs/libslang.a(sldisply.o): In function `tt_tgetflag':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2635: undefined reference to `tgetflag'It is because it uses ncurses5-config which is wrong in oe-core, the log.do_configure shows:
checking for ncurses5-config... /buildarea/lyang1/test_m/tmp/work/i586-poky-linux/slang/2.3.1a-r0/recipe-sysroot/usr/bin/crossscripts/ncurses5-config checking for terminfo... ERROR:
/usr/bin/ncurses5-configshould not be used, use
an alternative such as pkg-configWould you please fix it?
// Robert
Quoted 113 lines · Stefan Strogin
This patch adds ptest for slang, it uses
make runteststo run tests. TheMakefilerunsruntests.shfor each *.sl and *.slc tests.runtests.shis patched for printing test results in a common format,Makefileis patched in order not to compile any dependencies.Changes
v2->v3: rebased on the latest master (1d9a88f6).Signed-off-by Stefan Strogin <[email protected]>--- 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 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.patchmeta/recipes-extended/slang/slang/run-ptest new file +3
-0@@ -0,0 +1,3 @@ +#!/bin/sh + +make -C test runtestsmeta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch new file +30
-0@@ -0,0 +1,30 @@ +From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001 +From: Stefan Strogin <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-extended/slang/slang_2.3.1a.bb +24
-1@@ -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 = ""
Oh, I see. There are no errors in my log.do_compile_ptest_base and nothing is written to the terminal when building slang, it confused me. But there is an error in log.do_configure indeed,
"ERROR: /usr/bin/ncurses5-config should not be used". I'll fix it.
Quoted 166 lines · Robert Yang
Quoted 9 lines · Stefan Strogin
Hi Robert,
Thanks for the report. Could you say how to reproduce the error? What target architecture, config options, oe-core version, etc do you use? I have tried with openembedded-core
643c81af(master), with
MACHINE = "qemux86-64",EXTRA_IMAGE_FEATURES?= "debug-tweaks ptest-pkgs"DISTRO_FEATURES+= "ptest"
andCORE_IMAGE_EXTRA_INSTALL+= "slang"
set in local.conf, everything builds fine.The ARCH doesn't matter, I can see the error on every builds, is there "ERROR:
/usr/bin/ncurses5-configshould not be used" in your log.do_configure please ? What does it use for ncurses in your build?// Robert
Quoted 148 lines
--
StefanQuoted 141 lines · Robert Yang
Hello Stefan,
There is an error when
do_compile_ptest_base:| ../objs/libslang.a(sldisply.o): In function `tt_tgetstr':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2576: undefined reference to `tgetstr'
| ../objs/libslang.a(sldisply.o): In function `SLtt_initialize':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2770: undefined reference to `tgetent'
| ../objs/libslang.a(sldisply.o): In function `tt_tgetflag':
|/usr/src/debug/slang/2.3.1a-r0/slang-2.3.1a/src/sldisply.c:2635: undefined reference to `tgetflag'It is because it uses ncurses5-config which is wrong in oe-core, the log.do_configure shows:
checking for ncurses5-config... /buildarea/lyang1/test_m/tmp/work/i586-poky-linux/slang/2.3.1a-r0/recipe-sysroot/usr/bin/crossscripts/ncurses5-config checking for terminfo... ERROR:
/usr/bin/ncurses5-configshould not be used, use
an alternative such as pkg-configWould you please fix it?
// Robert
Quoted 113 lines · Stefan Strogin
This patch adds ptest for slang, it uses
make runteststo run tests. TheMakefilerunsruntests.shfor each *.sl and *.slc tests.runtests.shis patched for printing test results in a common format,Makefileis patched in order not to compile any dependencies.Changes
v2->v3: rebased on the latest master (1d9a88f6).Signed-off-by Stefan Strogin <[email protected]>--- 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 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.patchmeta/recipes-extended/slang/slang/run-ptest new file +3
-0@@ -0,0 +1,3 @@ +#!/bin/sh + +make -C test runtestsmeta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch new file +30
-0@@ -0,0 +1,30 @@ +From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001 +From: Stefan Strogin <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-extended/slang/slang_2.3.1a.bb +24
-1@@ -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 = ""