1 |
commit: 21332a01b0600087a93411ca7524bd76e14d82d9 |
2 |
Author: Davide Pesavento <davidepesa <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Jun 30 00:40:02 2012 +0000 |
4 |
Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 30 00:40:02 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=21332a01 |
7 |
|
8 |
[qt5-build.eclass] Initial implementation of src_test(). |
9 |
|
10 |
Still a work-in-progress. |
11 |
|
12 |
--- |
13 |
eclass/qt5-build.eclass | 27 +++++++++++++++++++++++---- |
14 |
1 files changed, 23 insertions(+), 4 deletions(-) |
15 |
|
16 |
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass |
17 |
index cf5df3a..f69eed6 100644 |
18 |
--- a/eclass/qt5-build.eclass |
19 |
+++ b/eclass/qt5-build.eclass |
20 |
@@ -48,12 +48,15 @@ case ${QT5_BUILD_TYPE} in |
21 |
;; |
22 |
esac |
23 |
|
24 |
-IUSE="+c++11 debug +pch" |
25 |
+IUSE="+c++11 debug +pch test" |
26 |
|
27 |
DEPEND="virtual/pkgconfig" |
28 |
-if [[ ${QT5_BUILD_TYPE} == live ]]; then |
29 |
+if [[ ${QT5_BUILD_TYPE} == "live" ]]; then |
30 |
DEPEND+=" dev-lang/perl" |
31 |
fi |
32 |
+if [[ ${PN} != "qt-core" && ${PN} != "qt-test" ]]; then |
33 |
+ DEPEND+=" test? ( ~x11-libs/qt-test-${PV}[debug=] )" |
34 |
+fi |
35 |
|
36 |
# @ECLASS-VARIABLE: PATCHES |
37 |
# @DEFAULT_UNSET |
38 |
@@ -282,8 +285,17 @@ qt5-build_src_compile() { |
39 |
# @DESCRIPTION: |
40 |
# Runs tests in target directories. |
41 |
qt5-build_src_test() { |
42 |
- # TODO |
43 |
- : |
44 |
+ # TODO: find a way to avoid a circular dep between qt-core and qt-test |
45 |
+ # TODO: generate a custom TESTRUNNER script that setups LD_LIBRARY_PATH |
46 |
+ if [[ ${PN} != "qt-core" ]]; then |
47 |
+ tests() { |
48 |
+ "${QT5_BUILD_DIR}"/bin/qmake \ |
49 |
+ "${S}/${subdir}/${subdir##*/}.pro" \ |
50 |
+ || die "qmake failed" |
51 |
+ emake check |
52 |
+ } |
53 |
+ qt5_foreach_target_subdir tests |
54 |
+ fi |
55 |
} |
56 |
|
57 |
# @FUNCTION: qt5-build_src_install |
58 |
@@ -387,10 +399,17 @@ qt5_symlink_tools_to_buildtree() { |
59 |
qt5_foreach_target_subdir() { |
60 |
local subdir |
61 |
for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do |
62 |
+ if [[ ${EBUILD_PHASE} == "test" ]]; then |
63 |
+ subdir=${subdir/#src/tests\/auto} |
64 |
+ [[ -d ${subdir} ]] || continue |
65 |
+ fi |
66 |
+ |
67 |
mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die |
68 |
pushd "${QT5_BUILD_DIR}/${subdir}" > /dev/null || die |
69 |
+ |
70 |
einfo "Running $* in ${subdir}" |
71 |
"$@" |
72 |
+ |
73 |
popd > /dev/null || die |
74 |
done |
75 |
} |