diff options
author | Tudor Florea <tudor.florea@enea.com> | 2013-07-19 17:10:59 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-07-24 11:35:34 +0100 |
commit | de52f892dbbd330db2c05a9da691ca679a260070 (patch) | |
tree | e9b6e458bc3ef48593a5b53f417a7b01b92d590c /meta/recipes-devtools/python | |
parent | 4f9c5a086a48ebdc2977ca57a6216d61d581f20a (diff) | |
download | poky-de52f892dbbd330db2c05a9da691ca679a260070.tar.gz |
python: Add ptest
Install python test suite and run it as ptest
(From OE-Core rev: a768047cb8fc00ecf13f4db08117c348a9312c47)
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r-- | meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch | 33 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python/run-ptest | 5 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python_2.7.3.bb | 10 |
3 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch new file mode 100644 index 0000000000..669112dab0 --- /dev/null +++ b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests | ||
2 | cross-compiled. | ||
3 | |||
4 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
5 | Upstream-Status: Pending | ||
6 | --- | ||
7 | diff -ruN a/Makefile.pre.in b/Makefile.pre.in | ||
8 | --- a/Makefile.pre.in 2013-06-27 10:44:11.033840532 +0200 | ||
9 | +++ b/Makefile.pre.in 2013-06-27 10:44:39.572635273 +0200 | ||
10 | @@ -709,14 +709,19 @@ | ||
11 | # generated bytecode. This is sometimes a very shy bug needing a lot of | ||
12 | # sample data. | ||
13 | |||
14 | -TESTOPTS= -l $(EXTRATESTOPTS) | ||
15 | +TESTOPTS= -l -v $(EXTRATESTOPTS) | ||
16 | TESTPROG= $(srcdir)/Lib/test/regrtest.py | ||
17 | -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) | ||
18 | -test: all platform | ||
19 | - -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f | ||
20 | +TESTPYTHON= $(RUNSHARED) $(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) | ||
21 | +test: build-test | ||
22 | + $(MAKE) runtest-TESTS | ||
23 | + | ||
24 | +runtest-TESTS: | ||
25 | + -find $(srcdir) -name '*.py[co]' -print | xargs rm -f | ||
26 | -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) | ||
27 | $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) | ||
28 | |||
29 | +build-test: all platform | ||
30 | + | ||
31 | testall: all platform | ||
32 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f | ||
33 | $(TESTPYTHON) $(srcdir)/Lib/compileall.py | ||
diff --git a/meta/recipes-devtools/python/python/run-ptest b/meta/recipes-devtools/python/python/run-ptest new file mode 100644 index 0000000000..a2f9eed444 --- /dev/null +++ b/meta/recipes-devtools/python/python/run-ptest | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | #This script is used to run python test suites | ||
4 | |||
5 | make -f LIBDIR/python/ptest/Makefile -k runtest-TESTS srcdir=LIBDIR/python2.7 TESTPROG=LIBDIR/python2.7/test/regrtest.py | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g' | ||
diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb index 59d189d862..2e35da60c4 100644 --- a/meta/recipes-devtools/python/python_2.7.3.bb +++ b/meta/recipes-devtools/python/python_2.7.3.bb | |||
@@ -28,6 +28,8 @@ SRC_URI += "\ | |||
28 | file://builddir.patch \ | 28 | file://builddir.patch \ |
29 | file://python-2.7.3-CVE-2012-2135.patch \ | 29 | file://python-2.7.3-CVE-2012-2135.patch \ |
30 | file://gcc-4.8-fix-configure-Wformat.patch \ | 30 | file://gcc-4.8-fix-configure-Wformat.patch \ |
31 | file://fix-makefile-for-ptest.patch \ | ||
32 | file://run-ptest \ | ||
31 | " | 33 | " |
32 | 34 | ||
33 | S = "${WORKDIR}/Python-${PV}" | 35 | S = "${WORKDIR}/Python-${PV}" |
@@ -119,6 +121,11 @@ do_install_append_class-nativesdk () { | |||
119 | create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' | 121 | create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' |
120 | } | 122 | } |
121 | 123 | ||
124 | do_install_ptest() { | ||
125 | cp ${B}/Makefile ${D}${PTEST_PATH} | ||
126 | sed -i s:LIBDIR:${libdir}:g ${D}${PTEST_PATH}/run-ptest | ||
127 | } | ||
128 | |||
122 | SSTATE_SCAN_FILES += "Makefile" | 129 | SSTATE_SCAN_FILES += "Makefile" |
123 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | 130 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" |
124 | 131 | ||
@@ -148,6 +155,9 @@ FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" | |||
148 | # catch all the rest (unsorted) | 155 | # catch all the rest (unsorted) |
149 | PACKAGES += "${PN}-misc" | 156 | PACKAGES += "${PN}-misc" |
150 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | 157 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" |
158 | RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc" | ||
159 | #inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten | ||
160 | inherit ptest | ||
151 | 161 | ||
152 | # catch manpage | 162 | # catch manpage |
153 | PACKAGES += "${PN}-man" | 163 | PACKAGES += "${PN}-man" |