Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-astronomy/stellarium/, sci-astronomy/stellarium/files/
Date: Fri, 18 Jan 2019 11:01:20
Message-Id: 1547809257.d84d15c6f33b9af216df308f2cf03ef194915c08.asturm@gentoo
1 commit: d84d15c6f33b9af216df308f2cf03ef194915c08
2 Author: Alexey Sokolov <sokolov <AT> google <DOT> com>
3 AuthorDate: Sun Jan 6 16:12:00 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 18 11:00:57 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d84d15c6
7
8 sci-astronomy/stellarium: Fix tests
9
10 The patch is merged upstream at
11 https://github.com/Stellarium/stellarium/pull/586
12
13 Closes: https://bugs.gentoo.org/674472
14 Signed-off-by: Alexey Sokolov <sokolov <AT> google.com>
15 Package-Manager: Portage-2.3.51, Repoman-2.3.11
16 Closes: https://github.com/gentoo/gentoo/pull/10759
17 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
18
19 .../files/stellarium-0.18.2-fix-test.patch | 113 +++++++++++++++++++++
20 sci-astronomy/stellarium/stellarium-0.18.2.ebuild | 5 +-
21 2 files changed, 117 insertions(+), 1 deletion(-)
22
23 diff --git a/sci-astronomy/stellarium/files/stellarium-0.18.2-fix-test.patch b/sci-astronomy/stellarium/files/stellarium-0.18.2-fix-test.patch
24 new file mode 100644
25 index 00000000000..34089363498
26 --- /dev/null
27 +++ b/sci-astronomy/stellarium/files/stellarium-0.18.2-fix-test.patch
28 @@ -0,0 +1,113 @@
29 +From d20954d0a9a7890865a2d4b09a01d62f2ed0d8e9 Mon Sep 17 00:00:00 2001
30 +From: Alexey Sokolov <sokolov@××××××.com>
31 +Date: Sun, 6 Jan 2019 13:20:59 +0000
32 +Subject: [PATCH 1/2] Fix test, when building out of source.
33 +
34 +https://bugs.gentoo.org/674472 has details.
35 +---
36 + src/CMakeLists.txt | 2 ++
37 + src/core/StelFileMgr.cpp | 9 +++++----
38 + src/tests/testEphemeris.cpp | 5 -----
39 + 3 files changed, 7 insertions(+), 9 deletions(-)
40 +
41 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
42 +index 6a46d006b2..10db29593b 100644
43 +--- a/src/CMakeLists.txt
44 ++++ b/src/CMakeLists.txt
45 +@@ -646,5 +646,7 @@ IF(ENABLE_TESTING)
46 + ADD_DEPENDENCIES(buildTests testEphemeris)
47 + ADD_TEST(testEphemeris testEphemeris)
48 + SET_TARGET_PROPERTIES(testEphemeris PROPERTIES FOLDER "src/tests")
49 ++ SET_TESTS_PROPERTIES(testEphemeris PROPERTIES
50 ++ ENVIRONMENT "STELLARIUM_DATA_ROOT=${PROJECT_SOURCE_DIR}")
51 +
52 + ENDIF (ENABLE_TESTING)
53 +diff --git a/src/core/StelFileMgr.cpp b/src/core/StelFileMgr.cpp
54 +index c88fd72b86..95126152f2 100644
55 +--- a/src/core/StelFileMgr.cpp
56 ++++ b/src/core/StelFileMgr.cpp
57 +@@ -26,6 +26,7 @@
58 + #include <QString>
59 + #include <QDebug>
60 + #include <QStandardPaths>
61 ++#include <QProcessEnvironment>
62 +
63 + #include <stdio.h>
64 +
65 +@@ -78,11 +79,11 @@ void StelFileMgr::init()
66 +
67 +
68 + // Determine install data directory location
69 +-
70 +- // If we are running from the build tree, we use the files from the current directory
71 +- if (QFileInfo(CHECK_FILE).exists())
72 ++ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
73 ++ QString envRoot = env.value("STELLARIUM_DATA_ROOT", ".");
74 ++ if (QFileInfo(envRoot + QDir::separator() + QString(CHECK_FILE)).exists())
75 + {
76 +- installDir = ".";
77 ++ installDir = envRoot;
78 + }
79 + else
80 + {
81 +diff --git a/src/tests/testEphemeris.cpp b/src/tests/testEphemeris.cpp
82 +index 26b4d83b98..ba5ac2a315 100644
83 +--- a/src/tests/testEphemeris.cpp
84 ++++ b/src/tests/testEphemeris.cpp
85 +@@ -42,12 +42,7 @@ QTEST_GUILESS_MAIN(TestEphemeris)
86 +
87 + void TestEphemeris::initTestCase()
88 + {
89 +- #ifndef Q_OS_WIN
90 +- // FIXME: StelFileMgr::init(); is disabled on Windows due it will caused problem "could not find install location"
91 +- // on Windows machines without installed Stellarium (e.g. AppVeyor). So, it will be give "false positive
92 +- // test pass" at the moment for DE42x ephemeris.
93 + StelFileMgr::init();
94 +- #endif
95 +
96 + de430FilePath = StelFileMgr::findFile("ephem/" + QString(DE430_FILENAME), StelFileMgr::File);
97 + de431FilePath = StelFileMgr::findFile("ephem/" + QString(DE431_FILENAME), StelFileMgr::File);
98 +
99 +From 2620a64db14e5feb5db8cb085dacef592556ded1 Mon Sep 17 00:00:00 2001
100 +From: Alexey Sokolov <sokolov@××××××.com>
101 +Date: Sun, 6 Jan 2019 15:56:52 +0000
102 +Subject: [PATCH 2/2] Fix testExtinction on i686
103 +
104 +https://bugs.gentoo.org/674472
105 +---
106 + src/tests/testExtinction.cpp | 2 +-
107 + 1 file changed, 1 insertion(+), 1 deletion(-)
108 +
109 +diff --git a/src/tests/testExtinction.cpp b/src/tests/testExtinction.cpp
110 +index bfb6ff8479..6a4c22212c 100644
111 +--- a/src/tests/testExtinction.cpp
112 ++++ b/src/tests/testExtinction.cpp
113 +@@ -41,5 +41,5 @@ void TestExtinction::testBase()
114 + mag=2.0f;
115 + extCls.setExtinctionCoefficient(0.25);
116 + extCls.forward(vert, &mag);
117 +- QVERIFY(mag==2.25);
118 ++ QVERIFY(fabs(mag-2.25)<0.0001);
119 + }
120 +From 3ffebb1ce599e2f0062472ee05060a5de5838101 Mon Sep 17 00:00:00 2001
121 +From: Alexey Sokolov <sokolov@××××××.com>
122 +Date: Sun, 6 Jan 2019 18:00:41 +0000
123 +Subject: [PATCH 2/2] Try fix #587 differently
124 +
125 +---
126 + src/CMakeLists.txt | 2 ++
127 + 1 file changed, 2 insertions(+)
128 +
129 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
130 +index 10db29593b..18cae6be4d 100644
131 +--- a/src/CMakeLists.txt
132 ++++ b/src/CMakeLists.txt
133 +@@ -546,6 +546,8 @@ IF(ENABLE_TESTING)
134 + ADD_DEPENDENCIES(buildTests testStelFileMgr)
135 + ADD_TEST(testStelFileMgr testStelFileMgr)
136 + SET_TARGET_PROPERTIES(testStelFileMgr PROPERTIES FOLDER "src/tests")
137 ++ SET_TESTS_PROPERTIES(testStelFileMgr PROPERTIES
138 ++ ENVIRONMENT "STELLARIUM_DATA_ROOT=.")
139 +
140 + SET(tests_testStelSphereGeometry_SRCS
141 + tests/testStelSphereGeometry.hpp
142
143 diff --git a/sci-astronomy/stellarium/stellarium-0.18.2.ebuild b/sci-astronomy/stellarium/stellarium-0.18.2.ebuild
144 index 42b839f3719..78116c5ed4a 100644
145 --- a/sci-astronomy/stellarium/stellarium-0.18.2.ebuild
146 +++ b/sci-astronomy/stellarium/stellarium-0.18.2.ebuild
147 @@ -43,7 +43,10 @@ DEPEND="${RDEPEND}
148 test? ( dev-qt/qttest:5 )
149 "
150
151 -PATCHES=( "${FILESDIR}"/${P}-as-needed.patch )
152 +PATCHES=(
153 + "${FILESDIR}"/${P}-as-needed.patch
154 + "${FILESDIR}"/${P}-fix-test.patch
155 +)
156
157 src_prepare() {
158 cmake-utils_src_prepare