Merge lp:~dobey/unity-scope-click/oot-build into lp:unity-scope-click

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 91
Merged at revision: 91
Proposed branch: lp:~dobey/unity-scope-click/oot-build
Merge into: lp:unity-scope-click
Diff against target: 347 lines (+100/-141)
7 files modified
acinclude.m4 (+86/-0)
configure.ac (+0/-2)
m4/gcov.m4 (+0/-86)
src/Makefile.am (+11/-3)
src/config.vala.in (+1/-7)
src/test-click-webservice.vala (+2/-5)
src/test-extras/fake-click (+0/-38)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/oot-build
Reviewer Review Type Date Requested Status
Mike McCracken (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+199327@code.launchpad.net

Commit message

Fix test_get_dotdesktop to use fake data, and remove the fake script.
Move the contents of gcov.m4 to acinclude.m4 and remove the m4 directory.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mike McCracken (mikemc) wrote :

+1 because although oot building still doesn't work, it's not the fault of any code in this tree, and this branch does fix the linked bugs.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'acinclude.m4'
2--- acinclude.m4 2013-07-18 18:05:15 +0000
3+++ acinclude.m4 2013-12-17 17:33:42 +0000
4@@ -38,3 +38,89 @@
5 prefix=$prefix_save
6 exec_prefix=$exec_prefix_save
7 ])
8+# Checks for existence of coverage tools:
9+# * gcov
10+# * lcov
11+# * genhtml
12+# * gcovr
13+#
14+# Sets ac_cv_check_gcov to yes if tooling is present
15+# and reports the executables to the variables LCOV, GCOVR and GENHTML.
16+AC_DEFUN([AC_TDD_GCOV],
17+[
18+ AC_ARG_ENABLE(gcov,
19+ AS_HELP_STRING([--enable-gcov],
20+ [enable coverage testing with gcov]),
21+ [use_gcov=$enableval], [use_gcov=no])
22+
23+ if test "x$use_gcov" = "xyes"; then
24+ # we need gcc:
25+ if test "$GCC" != "yes"; then
26+ AC_MSG_ERROR([GCC is required for --enable-gcov])
27+ fi
28+
29+ # Check if ccache is being used
30+ AC_CHECK_PROG(SHTOOL, shtool, shtool)
31+ case `$SHTOOL path $CC` in
32+ *ccache*[)] gcc_ccache=yes;;
33+ *[)] gcc_ccache=no;;
34+ esac
35+
36+ if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
37+ AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
38+ fi
39+
40+ lcov_version_list="1.6 1.7 1.8 1.9"
41+ AC_CHECK_PROG(LCOV, lcov, lcov)
42+ AC_CHECK_PROG(GENHTML, genhtml, genhtml)
43+
44+ if test "$LCOV"; then
45+ AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
46+ glib_cv_lcov_version=invalid
47+ lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
48+ for lcov_check_version in $lcov_version_list; do
49+ if test "$lcov_version" = "$lcov_check_version"; then
50+ glib_cv_lcov_version="$lcov_check_version (ok)"
51+ fi
52+ done
53+ ])
54+ else
55+ lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
56+ AC_MSG_ERROR([$lcov_msg])
57+ fi
58+
59+ case $glib_cv_lcov_version in
60+ ""|invalid[)]
61+ lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
62+ AC_MSG_ERROR([$lcov_msg])
63+ LCOV="exit 0;"
64+ ;;
65+ esac
66+
67+ if test -z "$GENHTML"; then
68+ AC_MSG_ERROR([Could not find genhtml from the lcov package])
69+ fi
70+
71+ ac_cv_check_gcov=yes
72+ ac_cv_check_lcov=yes
73+
74+ # Remove all optimization flags from CFLAGS
75+ changequote({,})
76+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
77+ changequote([,])
78+
79+ # Add the special gcc flags
80+ COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
81+ COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
82+ COVERAGE_LDFLAGS="-lgcov"
83+
84+ # Check availability of gcovr
85+ AC_CHECK_PROG(GCOVR, gcovr, gcovr)
86+ if test -z "$GCOVR"; then
87+ ac_cv_check_gcovr=no
88+ else
89+ ac_cv_check_gcovr=yes
90+ fi
91+
92+fi
93+]) # AC_TDD_GCOV
94
95=== modified file 'configure.ac'
96--- configure.ac 2013-12-10 22:21:24 +0000
97+++ configure.ac 2013-12-17 17:33:42 +0000
98@@ -28,7 +28,6 @@
99 ###########################
100 # gcov coverage reporting
101 ###########################
102-m4_include([m4/gcov.m4])
103 AC_TDD_GCOV
104 AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
105 AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
106@@ -115,7 +114,6 @@
107 Makefile
108 data/Makefile
109 src/Makefile
110- src/config.vala
111 ])
112 AC_OUTPUT
113
114
115=== removed directory 'm4'
116=== removed file 'm4/gcov.m4'
117--- m4/gcov.m4 2013-07-18 18:05:15 +0000
118+++ m4/gcov.m4 1970-01-01 00:00:00 +0000
119@@ -1,86 +0,0 @@
120-# Checks for existence of coverage tools:
121-# * gcov
122-# * lcov
123-# * genhtml
124-# * gcovr
125-#
126-# Sets ac_cv_check_gcov to yes if tooling is present
127-# and reports the executables to the variables LCOV, GCOVR and GENHTML.
128-AC_DEFUN([AC_TDD_GCOV],
129-[
130- AC_ARG_ENABLE(gcov,
131- AS_HELP_STRING([--enable-gcov],
132- [enable coverage testing with gcov]),
133- [use_gcov=$enableval], [use_gcov=no])
134-
135- if test "x$use_gcov" = "xyes"; then
136- # we need gcc:
137- if test "$GCC" != "yes"; then
138- AC_MSG_ERROR([GCC is required for --enable-gcov])
139- fi
140-
141- # Check if ccache is being used
142- AC_CHECK_PROG(SHTOOL, shtool, shtool)
143- case `$SHTOOL path $CC` in
144- *ccache*[)] gcc_ccache=yes;;
145- *[)] gcc_ccache=no;;
146- esac
147-
148- if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
149- AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
150- fi
151-
152- lcov_version_list="1.6 1.7 1.8 1.9"
153- AC_CHECK_PROG(LCOV, lcov, lcov)
154- AC_CHECK_PROG(GENHTML, genhtml, genhtml)
155-
156- if test "$LCOV"; then
157- AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
158- glib_cv_lcov_version=invalid
159- lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
160- for lcov_check_version in $lcov_version_list; do
161- if test "$lcov_version" = "$lcov_check_version"; then
162- glib_cv_lcov_version="$lcov_check_version (ok)"
163- fi
164- done
165- ])
166- else
167- lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
168- AC_MSG_ERROR([$lcov_msg])
169- fi
170-
171- case $glib_cv_lcov_version in
172- ""|invalid[)]
173- lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
174- AC_MSG_ERROR([$lcov_msg])
175- LCOV="exit 0;"
176- ;;
177- esac
178-
179- if test -z "$GENHTML"; then
180- AC_MSG_ERROR([Could not find genhtml from the lcov package])
181- fi
182-
183- ac_cv_check_gcov=yes
184- ac_cv_check_lcov=yes
185-
186- # Remove all optimization flags from CFLAGS
187- changequote({,})
188- CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
189- changequote([,])
190-
191- # Add the special gcc flags
192- COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
193- COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
194- COVERAGE_LDFLAGS="-lgcov"
195-
196- # Check availability of gcovr
197- AC_CHECK_PROG(GCOVR, gcovr, gcovr)
198- if test -z "$GCOVR"; then
199- ac_cv_check_gcovr=no
200- else
201- ac_cv_check_gcovr=yes
202- fi
203-
204-fi
205-]) # AC_TDD_GCOV
206
207=== modified file 'src/Makefile.am'
208--- src/Makefile.am 2013-12-11 16:46:03 +0000
209+++ src/Makefile.am 2013-12-17 17:33:42 +0000
210@@ -1,6 +1,7 @@
211
212-INCLUDES = \
213+AM_CPPFLAGS = \
214 -g -w \
215+ $(COVERAGE_CFLAGS) \
216 -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
217 -D_LOG_DOMAIN=\"unity-scope-click\" \
218 $(SCOPE_DAEMON_CFLAGS) \
219@@ -8,7 +9,6 @@
220 -I$(srcdir) \
221 -I$(builddir)
222
223-AM_CPPFLAGS = $(COVERAGE_CFLAGS)
224 AM_LDFLAGS = $(COVERAGE_LDFLAGS) -R $(PROTOCOLPRIVATELIBDIR)
225
226 pkglibexec_PROGRAMS = \
227@@ -23,6 +23,7 @@
228 libclickscope_la_VALAFLAGS = \
229 --thread \
230 --vapidir $(srcdir) \
231+ --vapidir $(builddir) \
232 --pkg unity-protocol \
233 --pkg oauth \
234 --pkg signon \
235@@ -45,6 +46,13 @@
236 non-click-scope.vala \
237 utils.vala
238
239+config.vala: config.vala.in
240+ sed -e "s|\@DATADIR\@|${datadir}|g" \
241+ -e "s|\@LOCALEDIR\@|${localedir}|g" \
242+ -e "s|\@PACKAGE\@|${PACKAGE}|g" \
243+ -e "s|\@VERSION\@|${VERSION}|g" \
244+ < $< > $@
245+
246 click_scope_VALAFLAGS = \
247 --thread \
248 --vapidir=$(builddir) \
249@@ -65,7 +73,7 @@
250 $(SCOPE_DAEMON_VALAFLAGS) \
251 --vapidir=$(srcdir) \
252 --vapidir=$(builddir) \
253- $(srcdir)/assertions.vapi \
254+ assertions.vapi \
255 --pkg clickscope
256
257 test_click_scope_LDFLAGS = \
258
259=== modified file 'src/config.vala.in'
260--- src/config.vala.in 2013-10-04 12:26:27 +0000
261+++ src/config.vala.in 2013-12-17 17:33:42 +0000
262@@ -1,12 +1,6 @@
263 namespace Config {
264-
265- const string PREFIX = "@prefix@";
266-
267 const string DATADIR = "@DATADIR@";
268-
269- const string LOCALEDIR = "@DATADIR@/locale";
270-
271+ const string LOCALEDIR = "@LOCALEDIR@";
272 const string PACKAGE = "@PACKAGE@";
273-
274 const string VERSION = "@VERSION@";
275 }
276
277=== modified file 'src/test-click-webservice.vala'
278--- src/test-click-webservice.vala 2013-12-06 18:27:14 +0000
279+++ src/test-click-webservice.vala 2013-12-17 17:33:42 +0000
280@@ -194,11 +194,9 @@
281 public static void test_click_get_dotdesktop ()
282 {
283 MainLoop mainloop = new MainLoop ();
284- var click_if = new ClickInterface ();
285- var real_path = GLib.Environment.get_variable("PATH");
286- GLib.Environment.set_variable("PATH", "test-extras", true);
287+ var click_if = new FakeClickInterface ();
288
289- click_if.get_dotdesktop.begin("com.example.corner-weather", (obj, res) => {
290+ click_if.get_dotdesktop.begin("com.ubuntu.ubuntu-weather", (obj, res) => {
291 mainloop.quit ();
292 try {
293 var dotdesktop = click_if.get_dotdesktop.end (res);
294@@ -208,7 +206,6 @@
295 }
296 });
297 assert (run_with_timeout (mainloop, 10000));
298- GLib.Environment.set_variable("PATH", real_path, true);
299 }
300
301 private static bool preview_has_info_hint(Unity.Preview preview, string id, Variant val)
302
303=== removed directory 'src/test-extras'
304=== removed symlink 'src/test-extras/click'
305=== target was u'fake-click'
306=== removed file 'src/test-extras/fake-click'
307--- src/test-extras/fake-click 2013-12-04 18:37:49 +0000
308+++ src/test-extras/fake-click 1970-01-01 00:00:00 +0000
309@@ -1,38 +0,0 @@
310-#!/bin/bash
311-
312-if [ "$1 $2" == "list --manifest" ] ; then
313- /bin/cat <<- EOF
314- [
315- {
316- "description": "Generate HDQR Codes",
317- "framework": "ubuntu-sdk-13.10",
318- "hooks": {
319- "hdqr-code": {
320- "apparmor": "hdqr-code.json",
321- "desktop": "hdqr-code.desktop"
322- }
323- },
324- "installed-size": "57000",
325- "maintainer": "John Doe <jdoe@example.com>",
326- "name": "com.example.developer.hdoe.hdqr-code",
327- "title": "Fake HDQR Codes",
328- "version": "0.3.2"
329- },
330- {
331- "description": "Go to the corner, check out the weather",
332- "framework": "ubuntu-sdk-13.10",
333- "hooks": {
334- "corner-weather": {
335- "apparmor": "corner-weather.json",
336- "desktop": "corner-weather.desktop"
337- }
338- },
339- "installed-size": "38000",
340- "maintainer": "Somebody Else <sbelse@example.com>",
341- "name": "com.example.corner-weather",
342- "title": "Fake Corner Weather",
343- "version": "0.8.3"
344- }
345- ]
346-EOF
347-fi

Subscribers

People subscribed via source and target branches

to all changes: