summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libpcre
diff options
context:
space:
mode:
authorChong Lu <Chong.Lu@windriver.com>2014-02-19 11:18:12 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-20 14:28:12 +0000
commite15bec02ef5b138b3b366520c52b60da5c68b068 (patch)
tree07cb7e8c4dd1758484b755f3bd673c22cd3a3193 /meta/recipes-support/libpcre
parentd32189a11e03335548f3e81c4b1cccf23e000a34 (diff)
downloadpoky-e15bec02ef5b138b3b366520c52b60da5c68b068.tar.gz
libpcre: enable ptest support
Install libpcre test suite and run it as ptest. (From OE-Core rev: fadaa1c7f4d927e3003bc4750f3b677ed627febb) 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/recipes-support/libpcre')
-rw-r--r--meta/recipes-support/libpcre/libpcre/Makefile183
-rw-r--r--meta/recipes-support/libpcre/libpcre/run-ptest3
-rw-r--r--meta/recipes-support/libpcre/libpcre_8.34.bb19
3 files changed, 203 insertions, 2 deletions
diff --git a/meta/recipes-support/libpcre/libpcre/Makefile b/meta/recipes-support/libpcre/libpcre/Makefile
new file mode 100644
index 0000000000..5419d71f7f
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/Makefile
@@ -0,0 +1,183 @@
1TESTS = pcre_stringpiece_unittest RunTest RunGrepTest
2subdir = .
3am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
4am__vpath_adj = case $$p in \
5 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
6 *) f=$$p;; \
7 esac;
8am__tty_colors_dummy = \
9 mgn= red= grn= lgn= blu= brg= std=; \
10 am__color_tests=no
11am__tty_colors = { \
12 $(am__tty_colors_dummy); \
13 if test "X$(AM_COLOR_TESTS)" = Xno; then \
14 am__color_tests=no; \
15 elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
16 am__color_tests=yes; \
17 elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
18 am__color_tests=yes; \
19 fi; \
20 if test $$am__color_tests = yes; then \
21 red=''; \
22 grn=''; \
23 lgn=''; \
24 blu=''; \
25 mgn=''; \
26 brg=''; \
27 std=''; \
28 fi; \
29}
30am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
31am__sh_e_setup = case $$- in *e*) set +e;; esac
32am__common_driver_flags = \
33 --color-tests "$$am__color_tests" \
34 --enable-hard-errors "$$am__enable_hard_errors" \
35 --expect-failure "$$am__expect_failure"
36am__check_pre = \
37$(am__sh_e_setup); \
38$(am__vpath_adj_setup) $(am__vpath_adj) \
39$(am__tty_colors); \
40srcdir=$(srcdir); export srcdir; \
41case "$@" in \
42 */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
43 *) am__odir=.;; \
44esac; \
45test "x$$am__odir" = x"." || test -d "$$am__odir" \
46 || $(MKDIR_P) "$$am__odir" || exit $$?; \
47if test -f "./$$f"; then dir=./; \
48elif test -f "$$f"; then dir=; \
49else dir="$(srcdir)/"; fi; \
50tst=$$dir$$f; log='$@'; \
51if test -n '$(DISABLE_HARD_ERRORS)'; then \
52 am__enable_hard_errors=no; \
53else \
54 am__enable_hard_errors=yes; \
55fi;
56am__set_TESTS_bases = \
57 bases='$(TEST_LOGS)'; \
58 bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
59 bases=`echo $$bases`
60RECHECK_LOGS = $(TEST_LOGS)
61TEST_SUITE_LOG = test-suite.log
62TEST_EXTENSIONS = .test
63LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
64am__test_logs1 = $(TESTS:=.log)
65am__test_logs2 = $(am__test_logs1:.log=.log)
66TEST_LOGS = $(am__test_logs2:.test.log=.log)
67MKDIR_P = /bin/mkdir -p
68PACKAGE_STRING = PCRE 8.34
69SHELL = /bin/sh
70srcdir = .
71top_srcdir = .
72$(TEST_SUITE_LOG): $(TEST_LOGS)
73 @$(am__set_TESTS_bases); \
74 am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
75 redo_bases=`for i in $$bases; do \
76 am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
77 done`; \
78 st=0; \
79 errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
80 for i in $$redo_bases; do \
81 test -f $$i.trs && test -r $$i.trs \
82 || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
83 test -f $$i.log && test -r $$i.log \
84 || { echo "$$errmsg $$i.log" >&2; st=1; }; \
85 done; \
86 test $$st -eq 0 || exit 1;
87 @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
88 ws='[ ]'; \
89 results=`for b in $$bases; do echo $$b.trs; done`; \
90 test -n "$$results" || results=/dev/null; \
91 all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
92 pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
93 fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
94 skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
95 xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
96 xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
97 error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
98 if test `expr $$fail + $$xpass + $$error` -eq 0; then \
99 success=true; \
100 else \
101 success=false; \
102 fi; \
103 br='==================='; br=$$br$$br$$br$$br; \
104 result_count () \
105 { \
106 if test x"$$1" = x"--maybe-color"; then \
107 maybe_colorize=yes; \
108 elif test x"$$1" = x"--no-color"; then \
109 maybe_colorize=no; \
110 else \
111 echo "$@: invalid 'result_count' usage" >&2; exit 4; \
112 fi; \
113 shift; \
114 desc=$$1 count=$$2; \
115 if test $$maybe_colorize = yes && test $$count -gt 0; then \
116 color_start=$$3 color_end=$$std; \
117 else \
118 color_start= color_end=; \
119 fi; \
120 echo "$${color_start}# $$desc $$count$${color_end}"; \
121 }; \
122 create_testsuite_report () \
123 { \
124 result_count $$1 "TOTAL:" $$all "$$brg"; \
125 result_count $$1 "PASS: " $$pass "$$grn"; \
126 result_count $$1 "SKIP: " $$skip "$$blu"; \
127 result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
128 result_count $$1 "FAIL: " $$fail "$$red"; \
129 result_count $$1 "XPASS:" $$xpass "$$red"; \
130 result_count $$1 "ERROR:" $$error "$$mgn"; \
131 }; \
132 { \
133 echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
134 $(am__rst_title); \
135 create_testsuite_report --no-color; \
136 echo; \
137 echo ".. contents:: :depth: 2"; \
138 echo; \
139 for b in $$bases; do echo $$b; done; \
140 } >$(TEST_SUITE_LOG).tmp || exit 1; \
141 mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
142 if $$success; then \
143 col="$$grn"; \
144 else \
145 col="$$red"; \
146 test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
147 fi; \
148 echo "$${col}$$br$${std}"; \
149 echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
150 echo "$${col}$$br$${std}"; \
151 create_testsuite_report --maybe-color; \
152 echo "$$col$$br$$std"; \
153 if $$success; then :; else \
154 echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
155 echo "$$col$$br$$std"; \
156 fi; \
157 $$success || exit 1
158check-TESTS:
159 @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
160 @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
161 @set +e; $(am__set_TESTS_bases); \
162 log_list=`for i in $$bases; do echo $$i.log; done`; \
163 log_list=`echo $$log_list`; \
164 $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
165 exit $$?;
166pcre_stringpiece_unittest.log: pcre_stringpiece_unittest$(EXEEXT)
167 @p='pcre_stringpiece_unittest$(EXEEXT)'; \
168 b='pcre_stringpiece_unittest'; \
169 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
170 --log-file $$b.log --trs-file $$b.trs \
171 $(am__common_driver_flags) -- "$$tst"
172RunTest.log: RunTest
173 @p='RunTest'; \
174 b='RunTest'; \
175 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
176 --log-file $$b.log --trs-file $$b.trs \
177 $(am__common_driver_flags) -- "$$tst"
178RunGrepTest.log: RunGrepTest
179 @p='RunGrepTest'; \
180 b='RunGrepTest'; \
181 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
182 --log-file $$b.log --trs-file $$b.trs \
183 $(am__common_driver_flags) -- "$$tst"
diff --git a/meta/recipes-support/libpcre/libpcre/run-ptest b/meta/recipes-support/libpcre/libpcre/run-ptest
new file mode 100644
index 0000000000..990d4a12ad
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make check-TESTS
diff --git a/meta/recipes-support/libpcre/libpcre_8.34.bb b/meta/recipes-support/libpcre/libpcre_8.34.bb
index 0c2b0828b1..5c5072cb90 100644
--- a/meta/recipes-support/libpcre/libpcre_8.34.bb
+++ b/meta/recipes-support/libpcre/libpcre_8.34.bb
@@ -9,7 +9,10 @@ LICENSE = "BSD"
9LIC_FILES_CHKSUM = "file://LICENCE;md5=0920cc1a9f7ba95464491fa83c86afd8" 9LIC_FILES_CHKSUM = "file://LICENCE;md5=0920cc1a9f7ba95464491fa83c86afd8"
10SRC_URI = "${SOURCEFORGE_MIRROR}/project/pcre/pcre/${PV}/pcre-${PV}.tar.bz2 \ 10SRC_URI = "${SOURCEFORGE_MIRROR}/project/pcre/pcre/${PV}/pcre-${PV}.tar.bz2 \
11 file://pcre-cross.patch \ 11 file://pcre-cross.patch \
12 file://fix-pcre-name-collision.patch" 12 file://fix-pcre-name-collision.patch \
13 file://run-ptest \
14 file://Makefile \
15"
13 16
14SRC_URI[md5sum] = "5439e321351bddd5533551bbce128d07" 17SRC_URI[md5sum] = "5439e321351bddd5533551bbce128d07"
15SRC_URI[sha256sum] = "b6043ae1ff2720be665ffa28dc22b7c637cdde96f389a116c0c3020caeae583f" 18SRC_URI[sha256sum] = "b6043ae1ff2720be665ffa28dc22b7c637cdde96f389a116c0c3020caeae583f"
@@ -21,7 +24,7 @@ DEPENDS += "bzip2 zlib"
21 24
22PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline," 25PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline,"
23 26
24inherit autotools binconfig 27inherit autotools binconfig ptest
25 28
26PARALLEL_MAKE = "" 29PARALLEL_MAKE = ""
27 30
@@ -56,3 +59,15 @@ FILES_pcretest = "${bindir}/pcretest"
56FILES_pcretest-doc = "${mandir}/man1/pcretest.1" 59FILES_pcretest-doc = "${mandir}/man1/pcretest.1"
57 60
58BBCLASSEXTEND = "native nativesdk" 61BBCLASSEXTEND = "native nativesdk"
62
63do_install_ptest() {
64 t=${D}${PTEST_PATH}
65 cp ${WORKDIR}/Makefile $t
66 cp -r ${S}/testdata $t
67 for i in pcre_stringpiece_unittest pcregrep pcretest; \
68 do cp ${B}/.libs/$i $t; \
69 done
70 for i in RunTest RunGrepTest test-driver; \
71 do cp ${S}/$i $t; \
72 done
73}