Gentoo Archives: gentoo-commits

From: Davide Pesavento <pesa@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/qt:master commit in: eclass/
Date: Sun, 01 Jul 2012 23:40:11
Message-Id: 1341185550.ef083e063c8adc2a2d06499a7642a64dc1635dfc.pesa@gentoo
1 commit: ef083e063c8adc2a2d06499a7642a64dc1635dfc
2 Author: Davide Pesavento <davidepesa <AT> gmail <DOT> com>
3 AuthorDate: Sun Jul 1 23:32:30 2012 +0000
4 Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 1 23:32:30 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=ef083e06
7
8 [qt5-build.eclass] Finish src_test() implementation.
9
10 We have to use a custom testunner script that sets LD_LIBRARY_PATH
11 before executing the tests, otherwise ld.so won't find the correct
12 libraries.
13
14 Most tests should pass now. Yay!
15
16 ---
17 eclass/qt5-build.eclass | 31 +++++++++++++++++++++----------
18 1 files changed, 21 insertions(+), 10 deletions(-)
19
20 diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
21 index f69eed6..55e58bb 100644
22 --- a/eclass/qt5-build.eclass
23 +++ b/eclass/qt5-build.eclass
24 @@ -286,16 +286,27 @@ qt5-build_src_compile() {
25 # Runs tests in target directories.
26 qt5-build_src_test() {
27 # TODO: find a way to avoid a circular dep between qt-core and qt-test
28 - # TODO: generate a custom TESTRUNNER script that setups LD_LIBRARY_PATH
29 - if [[ ${PN} != "qt-core" ]]; then
30 - tests() {
31 - "${QT5_BUILD_DIR}"/bin/qmake \
32 - "${S}/${subdir}/${subdir##*/}.pro" \
33 - || die "qmake failed"
34 - emake check
35 - }
36 - qt5_foreach_target_subdir tests
37 - fi
38 + [[ ${PN} == "qt-core" ]] && return
39 +
40 + # create a custom testrunner script that correctly sets
41 + # {,DY}LD_LIBRARY_PATH before executing the given test
42 + local testrunner=${QT5_BUILD_DIR}/gentoo-testrunner
43 + cat <<-EOF > "${testrunner}"
44 + #!/bin/sh
45 + export LD_LIBRARY_PATH="${QT5_BUILD_DIR}/lib:${QTLIBDIR}"
46 + export DYLD_LIBRARY_PATH="${QT5_BUILD_DIR}/lib:${QTLIBDIR}"
47 + "\$@"
48 + EOF
49 + chmod +x "${testrunner}"
50 +
51 + qmake() {
52 + "${QT5_BUILD_DIR}"/bin/qmake \
53 + "${S}/${subdir}/${subdir##*/}.pro" \
54 + || die "qmake failed"
55 + }
56 + qt5_foreach_target_subdir qmake
57 + qt5_foreach_target_subdir emake
58 + qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check
59 }
60
61 # @FUNCTION: qt5-build_src_install