1 |
commit: 4a6e82ab8fdfe2c9c7c2b0398a7c429c56534552 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 30 08:59:55 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 30 09:01:48 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a6e82ab |
7 |
|
8 |
x11-misc/synergy: Reenable tests in 1.9.1 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
x11-misc/synergy/files/synergy-1.9.1-gtest.patch | 28 ------------------ |
13 |
.../files/synergy-1.9.1-internal-gmock-gtest.patch | 23 --------------- |
14 |
x11-misc/synergy/files/synergy-1.9.1-test.patch | 33 ++++++++++++++++++++++ |
15 |
...ynergy-1.9.1.ebuild => synergy-1.9.1-r1.ebuild} | 32 +++++++++++++++++---- |
16 |
4 files changed, 60 insertions(+), 56 deletions(-) |
17 |
|
18 |
diff --git a/x11-misc/synergy/files/synergy-1.9.1-gtest.patch b/x11-misc/synergy/files/synergy-1.9.1-gtest.patch |
19 |
deleted file mode 100644 |
20 |
index f7a5e614e81..00000000000 |
21 |
--- a/x11-misc/synergy/files/synergy-1.9.1-gtest.patch |
22 |
+++ /dev/null |
23 |
@@ -1,28 +0,0 @@ |
24 |
---- a/src/lib/synergy/KeyMap.h |
25 |
-+++ b/src/lib/synergy/KeyMap.h |
26 |
-@@ -24,7 +24,9 @@ |
27 |
- #include "common/stdset.h" |
28 |
- #include "common/stdvector.h" |
29 |
- |
30 |
-+#if WITH_GENTOO_TEST |
31 |
- #include <gtest/gtest_prod.h> |
32 |
-+#endif |
33 |
- |
34 |
- namespace synergy { |
35 |
- |
36 |
-@@ -327,6 +329,7 @@ |
37 |
- //@} |
38 |
- |
39 |
- |
40 |
-+#if WITH_GENTOO_TEST |
41 |
- private: |
42 |
- FRIEND_TEST(KeyMapTests, |
43 |
- findBestKey_requiredDown_matchExactFirstItem); |
44 |
-@@ -341,6 +344,7 @@ |
45 |
- FRIEND_TEST(KeyMapTests, |
46 |
- findBestKey_onlyOneRequiredDown_matchTwoRequiredChangesItem); |
47 |
- FRIEND_TEST(KeyMapTests, findBestKey_noRequiredDown_cannotMatch); |
48 |
-+#endif |
49 |
- |
50 |
- private: |
51 |
- //! Ways to synthesize a key |
52 |
|
53 |
diff --git a/x11-misc/synergy/files/synergy-1.9.1-internal-gmock-gtest.patch b/x11-misc/synergy/files/synergy-1.9.1-internal-gmock-gtest.patch |
54 |
deleted file mode 100644 |
55 |
index bc8a9613057..00000000000 |
56 |
--- a/x11-misc/synergy/files/synergy-1.9.1-internal-gmock-gtest.patch |
57 |
+++ /dev/null |
58 |
@@ -1,23 +0,0 @@ |
59 |
---- a/src/test/CMakeLists.txt |
60 |
-+++ b/src/test/CMakeLists.txt |
61 |
-@@ -14,20 +14,5 @@ |
62 |
- # You should have received a copy of the GNU General Public License |
63 |
- # along with this program. If not, see <http://www.gnu.org/licenses/>. |
64 |
- |
65 |
--include_directories( |
66 |
-- ../../ext/gtest |
67 |
-- ../../ext/gtest/include |
68 |
-- ../../ext/gmock |
69 |
-- ../../ext/gmock/include) |
70 |
-- |
71 |
--add_library(gtest STATIC ../../ext/gtest/src/gtest-all.cc) |
72 |
--add_library(gmock STATIC ../../ext/gmock/src/gmock-all.cc) |
73 |
-- |
74 |
--if (UNIX) |
75 |
-- # ignore warnings in gtest and gmock |
76 |
-- set_target_properties(gtest PROPERTIES COMPILE_FLAGS "-w") |
77 |
-- set_target_properties(gmock PROPERTIES COMPILE_FLAGS "-w") |
78 |
--endif() |
79 |
-- |
80 |
- add_subdirectory(integtests) |
81 |
- add_subdirectory(unittests) |
82 |
|
83 |
diff --git a/x11-misc/synergy/files/synergy-1.9.1-test.patch b/x11-misc/synergy/files/synergy-1.9.1-test.patch |
84 |
new file mode 100644 |
85 |
index 00000000000..d0c44e9dd7f |
86 |
--- /dev/null |
87 |
+++ b/x11-misc/synergy/files/synergy-1.9.1-test.patch |
88 |
@@ -0,0 +1,33 @@ |
89 |
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt |
90 |
+index ab63a06..ec7a3e0 100644 |
91 |
+--- a/src/CMakeLists.txt |
92 |
++++ b/src/CMakeLists.txt |
93 |
+@@ -22,3 +22,8 @@ add_subdirectory(cmd) |
94 |
+ if (SYNERGY_BUILD_LEGACY_GUI) |
95 |
+ add_subdirectory(gui) |
96 |
+ endif (SYNERGY_BUILD_LEGACY_GUI) |
97 |
++ |
98 |
++option(BUILD_TESTS "Build tests" OFF) |
99 |
++if (BUILD_TESTS) |
100 |
++ add_subdirectory(test) |
101 |
++endif() |
102 |
+diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt |
103 |
+index f39968a..bfc886c 100644 |
104 |
+--- a/src/test/integtests/CMakeLists.txt |
105 |
++++ b/src/test/integtests/CMakeLists.txt |
106 |
+@@ -68,4 +68,4 @@ endif() |
107 |
+ |
108 |
+ add_executable(integtests ${sources}) |
109 |
+ target_link_libraries(integtests |
110 |
+- arch base client common io ipc mt net platform server synergy gtest gmock ${libs} ${OPENSSL_LIBS}) |
111 |
++ arch base client common io ipc mt net platform server gtest gmock ${libs} ${OPENSSL_LIBS}) |
112 |
+diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt |
113 |
+index 54131eb..ef84dba 100644 |
114 |
+--- a/src/test/unittests/CMakeLists.txt |
115 |
++++ b/src/test/unittests/CMakeLists.txt |
116 |
+@@ -68,4 +68,4 @@ endif() |
117 |
+ |
118 |
+ add_executable(unittests ${sources}) |
119 |
+ target_link_libraries(unittests |
120 |
+- arch base client server common io net platform server synergy mt ipc gtest gmock shared ${libs} ${OPENSSL_LIBS}) |
121 |
++ arch base client server common io net platform server mt ipc gtest gmock shared ${libs} ${OPENSSL_LIBS}) |
122 |
|
123 |
diff --git a/x11-misc/synergy/synergy-1.9.1.ebuild b/x11-misc/synergy/synergy-1.9.1-r1.ebuild |
124 |
similarity index 76% |
125 |
rename from x11-misc/synergy/synergy-1.9.1.ebuild |
126 |
rename to x11-misc/synergy/synergy-1.9.1-r1.ebuild |
127 |
index 0c5c3b75592..021b8d2d54b 100644 |
128 |
--- a/x11-misc/synergy/synergy-1.9.1.ebuild |
129 |
+++ b/x11-misc/synergy/synergy-1.9.1-r1.ebuild |
130 |
@@ -3,7 +3,7 @@ |
131 |
|
132 |
EAPI=6 |
133 |
|
134 |
-inherit cmake-utils desktop gnome2-utils |
135 |
+inherit cmake-utils desktop gnome2-utils virtualx |
136 |
|
137 |
DESCRIPTION="Lets you easily share a single mouse and keyboard between multiple computers" |
138 |
HOMEPAGE="https://symless.com/synergy https://github.com/symless/synergy-core" |
139 |
@@ -15,8 +15,8 @@ SRC_URI=" |
140 |
LICENSE="GPL-2" |
141 |
SLOT="0" |
142 |
KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x86-solaris" |
143 |
-IUSE="libressl qt5" |
144 |
-RESTRICT="test" |
145 |
+IUSE="libressl qt5 test" |
146 |
+RESTRICT="!test? ( test )" |
147 |
|
148 |
S=${WORKDIR}/${PN}-core-${PV}-stable |
149 |
|
150 |
@@ -53,21 +53,43 @@ DOCS=( ChangeLog doc/synergy.conf.example{,-advanced,-basic} ) |
151 |
|
152 |
PATCHES=( |
153 |
"${FILESDIR}"/${P}-pthread.patch |
154 |
- "${FILESDIR}"/${P}-internal-gmock-gtest.patch |
155 |
- "${FILESDIR}"/${P}-gtest.patch |
156 |
"${FILESDIR}"/${P}-cmake-version.patch |
157 |
"${FILESDIR}"/${P}-qt-5.11.patch |
158 |
+ "${FILESDIR}"/${P}-test.patch |
159 |
) |
160 |
|
161 |
+src_prepare() { |
162 |
+ # requires Internet, and relies on old site anyway |
163 |
+ rm src/test/integtests/arch/ArchInternetTests.cpp || die |
164 |
+ # broken on Xvfb |
165 |
+ rm src/test/integtests/platform/XWindowsScreenTests.cpp || die |
166 |
+ |
167 |
+ cmake-utils_src_prepare |
168 |
+} |
169 |
+ |
170 |
src_configure() { |
171 |
+ # otherwise unit tests segfault |
172 |
+ local -x CFLAGS="${CFLAGS} -O0" |
173 |
+ local -x CXXFLAGS="${CXXFLAGS} -O0" |
174 |
+ |
175 |
local mycmakeargs=( |
176 |
-DSYNERGY_BUILD_LEGACY_GUI=$(usex qt5) |
177 |
-DSYNERGY_BUILD_LEGACY_INSTALLER=OFF |
178 |
+ -DBUILD_TESTS=$(usex test) |
179 |
) |
180 |
|
181 |
cmake-utils_src_configure |
182 |
} |
183 |
|
184 |
+my_test() { |
185 |
+ "${BUILD_DIR}"/bin/unittests && |
186 |
+ "${BUILD_DIR}"/bin/integtests |
187 |
+} |
188 |
+ |
189 |
+src_test() { |
190 |
+ virtx my_test |
191 |
+} |
192 |
+ |
193 |
src_install() { |
194 |
dobin "${BUILD_DIR}"/bin/{synergy{c,s},syntool} |