diff options
author | Chong Lu <Chong.Lu@windriver.com> | 2014-06-09 15:45:52 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-06-13 12:31:38 +0100 |
commit | 6f0eb996ec0d1b77a5cc56a510036cd7db7c2836 (patch) | |
tree | 30cd648881bc2be00d1a949c120e4dca0b373629 /meta | |
parent | bdf734343a5e033b071c98068a2f921b35534a61 (diff) | |
download | poky-6f0eb996ec0d1b77a5cc56a510036cd7db7c2836.tar.gz |
sed: enable ptest support
Install sed test suite and run it as ptest.
(From OE-Core rev: de8cc3192eefafa639a9f34fcc35799be3286191)
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-extended/sed/sed-4.2.2/run-ptest | 3 | ||||
-rw-r--r-- | meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch | 66 | ||||
-rw-r--r-- | meta/recipes-extended/sed/sed_4.2.2.bb | 21 |
3 files changed, 87 insertions, 3 deletions
diff --git a/meta/recipes-extended/sed/sed-4.2.2/run-ptest b/meta/recipes-extended/sed/sed-4.2.2/run-ptest new file mode 100644 index 0000000000..7c0f62770e --- /dev/null +++ b/meta/recipes-extended/sed/sed-4.2.2/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | make -C testsuite -k runtest-TESTS | ||
diff --git a/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch b/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch new file mode 100644 index 0000000000..105e8b745b --- /dev/null +++ b/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | sed: add ptest | ||
2 | |||
3 | ptest needs buildtest-TESTS and runtest-TESTS targets. | ||
4 | serial-tests is required to generate those targets. | ||
5 | |||
6 | And fix following error after add serial-tests. | ||
7 | |||
8 | [snip] | ||
9 | help2man: can't get `--help' info from ../sed/sed | ||
10 | make[2]: *** [sed.1] Error 2 | ||
11 | [snip] | ||
12 | |||
13 | Upstream-Status: Inappropriate | ||
14 | |||
15 | Signed-off-by: Chong Lu <Chong.Lu@windriver.com> | ||
16 | --- | ||
17 | configure.ac | 2 +- | ||
18 | doc/Makefile.am | 2 +- | ||
19 | testsuite/Makefile.am | 6 ++++++ | ||
20 | 3 files changed, 8 insertions(+), 2 deletions(-) | ||
21 | |||
22 | diff --git a/configure.ac b/configure.ac | ||
23 | index 9d33ec9..4f0c532 100644 | ||
24 | --- a/configure.ac | ||
25 | +++ b/configure.ac | ||
26 | @@ -4,7 +4,7 @@ AC_CONFIG_AUX_DIR(build-aux) | ||
27 | AC_CONFIG_SRCDIR([sed/sed.c]) | ||
28 | AM_CONFIG_HEADER(config.h:config_h.in) | ||
29 | AC_PREREQ(2.60) | ||
30 | -AM_INIT_AUTOMAKE | ||
31 | +AM_INIT_AUTOMAKE([serial-tests]) | ||
32 | |||
33 | SED_FEATURE_VERSION=4.2.2 | ||
34 | AC_DEFINE_UNQUOTED(SED_FEATURE_VERSION, "$SED_FEATURE_VERSION", | ||
35 | diff --git a/doc/Makefile.am b/doc/Makefile.am | ||
36 | index af6975c..6fd8c9a 100644 | ||
37 | --- a/doc/Makefile.am | ||
38 | +++ b/doc/Makefile.am | ||
39 | @@ -25,7 +25,7 @@ $(srcdir)/s-texi: sed-in.texi $(srcdir)/groupify.sed | ||
40 | fi | ||
41 | echo stamp > $(srcdir)/s-texi | ||
42 | |||
43 | -sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x | ||
44 | +_sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x | ||
45 | $(HELP2MAN) --name "stream editor for filtering and transforming text" \ | ||
46 | -p sed --include $(srcdir)/sed.x -o $(srcdir)/sed.1 $(SED) | ||
47 | |||
48 | diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am | ||
49 | index d80e72c..b05f01e 100644 | ||
50 | --- a/testsuite/Makefile.am | ||
51 | +++ b/testsuite/Makefile.am | ||
52 | @@ -99,5 +99,11 @@ EXTRA_DIST = \ | ||
53 | # automake makes `check' depend on $(TESTS). Declare | ||
54 | # dummy targets for $(TESTS) so that make does not complain. | ||
55 | |||
56 | +install-ptest: | ||
57 | + cd $(BUILDDIR); tar -cf - $(TESTDIR) --exclude *.o | ( cd $(DESTDIR) && tar -xf - ) | ||
58 | + for i in $(EXTRA_DIST) tst-regex2.c; do install $(srcdir)/$$i $(DESTDIR)/$(TESTDIR); done | ||
59 | + sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/bash/sh/' -i $(DESTDIR)/$(TESTDIR)/Makefile | ||
60 | + for i in `grep -rl "../sed/sed" $(DESTDIR)/$(TESTDIR)`; do sed -e 's/..\/sed\/sed/sed/' -i $$i; done | ||
61 | + | ||
62 | .PHONY: $(SEDTESTS) | ||
63 | $(SEDTESTS): | ||
64 | -- | ||
65 | 1.7.9.5 | ||
66 | |||
diff --git a/meta/recipes-extended/sed/sed_4.2.2.bb b/meta/recipes-extended/sed/sed_4.2.2.bb index 47c8b5b14f..74ac16bea9 100644 --- a/meta/recipes-extended/sed/sed_4.2.2.bb +++ b/meta/recipes-extended/sed/sed_4.2.2.bb | |||
@@ -5,14 +5,19 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \ | |||
5 | file://sed/sed.h;beginline=1;endline=17;md5=767ab3a06d7584f6fd0469abaec4412f" | 5 | file://sed/sed.h;beginline=1;endline=17;md5=767ab3a06d7584f6fd0469abaec4412f" |
6 | SECTION = "console/utils" | 6 | SECTION = "console/utils" |
7 | 7 | ||
8 | SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz" | 8 | SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \ |
9 | file://sed-add-ptest.patch \ | ||
10 | file://run-ptest \ | ||
11 | " | ||
9 | 12 | ||
10 | SRC_URI[md5sum] = "4111de4faa3b9848a0686b2f260c5056" | 13 | SRC_URI[md5sum] = "4111de4faa3b9848a0686b2f260c5056" |
11 | SRC_URI[sha256sum] = "fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff" | 14 | SRC_URI[sha256sum] = "fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff" |
12 | 15 | ||
13 | inherit autotools texinfo update-alternatives gettext | 16 | inherit autotools texinfo update-alternatives gettext ptest |
17 | RDEPENDS_${PN}-ptest += "make locale-base-ru-ru" | ||
14 | 18 | ||
15 | EXTRA_OECONF = "--disable-acl" | 19 | EXTRA_OECONF = "--disable-acl \ |
20 | ${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-regex-tests', '', d)}" | ||
16 | 21 | ||
17 | do_install () { | 22 | do_install () { |
18 | autotools_do_install | 23 | autotools_do_install |
@@ -25,4 +30,14 @@ ALTERNATIVE_${PN} = "sed" | |||
25 | ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed" | 30 | ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed" |
26 | ALTERNATIVE_PRIORITY = "100" | 31 | ALTERNATIVE_PRIORITY = "100" |
27 | 32 | ||
33 | TESTDIR = "testsuite" | ||
34 | |||
35 | do_compile_ptest() { | ||
36 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
37 | } | ||
38 | |||
39 | do_install_ptest() { | ||
40 | oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR} | ||
41 | } | ||
42 | |||
28 | BBCLASSEXTEND = "native" | 43 | BBCLASSEXTEND = "native" |