Merge lp:~ted/ubuntu-app-launch/zg-reenable into lp:ubuntu-app-launch/14.04

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 90
Merged at revision: 85
Proposed branch: lp:~ted/ubuntu-app-launch/zg-reenable
Merge into: lp:ubuntu-app-launch/14.04
Prerequisite: lp:~ted/ubuntu-app-launch/mock-lib-tests
Diff against target: 203 lines (+90/-17)
7 files modified
CMakeLists.txt (+3/-3)
application-click.conf.in (+2/-5)
application-legacy.conf.in (+2/-5)
debian/control (+2/-1)
tests/CMakeLists.txt (+10/-0)
tests/zg-test.cc (+68/-0)
zg-report-app.c (+3/-3)
To merge this branch: bzr merge lp:~ted/ubuntu-app-launch/zg-reenable
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+194570@code.launchpad.net

Commit message

Reenable ZG and port to libzg-2.0

Description of the change

Switches back on ZG after we turned it off for the release, so that it's back for this one. Also upgrades to libzg-2 and adds a test for it.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

The code looks ok and the tests are a nice plus, just need to make Jenkins happy...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
88. By Ted Gould

Updating mock lib branch

89. By Ted Gould

Put ZG in the wrong package

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
90. By Ted Gould

Avoid an error in the ZG headers

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-11-19 04:12:01 +0000
+++ CMakeLists.txt 2013-11-19 04:12:01 +0000
@@ -25,7 +25,7 @@
2525
26set(pkglibexecdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")26set(pkglibexecdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
2727
28set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")28set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-error=unused-function")
2929
30enable_testing()30enable_testing()
3131
@@ -41,7 +41,7 @@
41pkg_check_modules(JSONGLIB REQUIRED json-glib-1.0)41pkg_check_modules(JSONGLIB REQUIRED json-glib-1.0)
42include_directories(${JSONGLIB_INCLUDE_DIRS})42include_directories(${JSONGLIB_INCLUDE_DIRS})
4343
44pkg_check_modules(ZEITGEIST REQUIRED zeitgeist-1.0)44pkg_check_modules(ZEITGEIST REQUIRED zeitgeist-2.0)
45include_directories(${ZEITGEIST_INCLUDE_DIRS})45include_directories(${ZEITGEIST_INCLUDE_DIRS})
4646
47pkg_check_modules(LIBUPSTART REQUIRED libupstart libnih libnih-dbus dbus-1)47pkg_check_modules(LIBUPSTART REQUIRED libupstart libnih libnih-dbus dbus-1)
@@ -157,7 +157,7 @@
157157
158add_executable(zg-report-app zg-report-app.c)158add_executable(zg-report-app zg-report-app.c)
159set_target_properties(zg-report-app PROPERTIES OUTPUT_NAME "zg-report-app")159set_target_properties(zg-report-app PROPERTIES OUTPUT_NAME "zg-report-app")
160target_link_libraries(zg-report-app ${ZEITGEIST_LIBRARIES})160target_link_libraries(zg-report-app ${ZEITGEIST_LIBRARIES} ${GOBJECT2_LIBRARIES} ${GLIB2_LIBRARIES})
161install(TARGETS zg-report-app RUNTIME DESTINATION "${pkglibexecdir}")161install(TARGETS zg-report-app RUNTIME DESTINATION "${pkglibexecdir}")
162162
163#######################163#######################
164164
=== modified file 'application-click.conf.in'
--- application-click.conf.in 2013-10-02 15:01:22 +0000
+++ application-click.conf.in 2013-11-19 04:12:01 +0000
@@ -26,8 +26,5 @@
26# Remember, this is confined26# Remember, this is confined
27exec @pkglibexecdir@/exec-line-exec27exec @pkglibexecdir@/exec-line-exec
2828
29# Disabled for Phone 1.0 which doesn't yet have ZG installed on it,29post-start exec @pkglibexecdir@/zg-report-app open
30# so we don't need to log the data.30post-stop exec @pkglibexecdir@/zg-report-app close
31#
32# post-start exec @pkglibexecdir@/zg-report-app open
33# post-stop exec @pkglibexecdir@/zg-report-app close
3431
=== modified file 'application-legacy.conf.in'
--- application-legacy.conf.in 2013-10-02 15:01:22 +0000
+++ application-legacy.conf.in 2013-11-19 04:12:01 +0000
@@ -26,8 +26,5 @@
2626
27exec @pkglibexecdir@/exec-line-exec27exec @pkglibexecdir@/exec-line-exec
2828
29# Disabled for Phone 1.0 which doesn't yet have ZG installed on it,29post-start exec @pkglibexecdir@/zg-report-app open
30# so we don't need to log the data.30post-stop exec @pkglibexecdir@/zg-report-app close
31#
32# post-start exec @pkglibexecdir@/zg-report-app open
33# post-stop exec @pkglibexecdir@/zg-report-app close
3431
=== modified file 'debian/control'
--- debian/control 2013-11-19 04:12:01 +0000
+++ debian/control 2013-11-19 04:12:01 +0000
@@ -15,7 +15,7 @@
15 libnih-dbus-dev,15 libnih-dbus-dev,
16 libnih-dev,16 libnih-dev,
17 libupstart-dev,17 libupstart-dev,
18 libzeitgeist-dev,18 libzeitgeist-2.0-dev,
19 python3-dbusmock,19 python3-dbusmock,
20Standards-Version: 3.9.420Standards-Version: 3.9.4
21Homepage: http://launchpad.net/upstart-app-launch21Homepage: http://launchpad.net/upstart-app-launch
@@ -30,6 +30,7 @@
30 ${misc:Depends},30 ${misc:Depends},
31 click (>= 0.4.9),31 click (>= 0.4.9),
32 click-apparmor,32 click-apparmor,
33 zeitgeist,
33Description: Upstart Job for Launching Applications34Description: Upstart Job for Launching Applications
34 Upstart Job file and associated utilities that is used to launch35 Upstart Job file and associated utilities that is used to launch
35 applications in a standard and confined way.36 applications in a standard and confined way.
3637
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2013-11-19 04:12:01 +0000
+++ tests/CMakeLists.txt 2013-11-19 04:12:01 +0000
@@ -43,3 +43,13 @@
43add_test (NAME libual-test-pid COMMAND libual-test --gtest_filter=*ApplicationPid)43add_test (NAME libual-test-pid COMMAND libual-test --gtest_filter=*ApplicationPid)
44add_test (NAME libual-test-list COMMAND libual-test --gtest_filter=*ApplicationList)44add_test (NAME libual-test-list COMMAND libual-test --gtest_filter=*ApplicationList)
45add_test (NAME libual-test-observer COMMAND libual-test --gtest_filter=*StartStopObserver)45add_test (NAME libual-test-observer COMMAND libual-test --gtest_filter=*StartStopObserver)
46
47# ZG Test
48
49add_definitions ( -DZG_EVENT_TOOL="${CMAKE_BINARY_DIR}/zg-report-app" )
50
51add_executable (zg-test
52 zg-test.cc)
53target_link_libraries (zg-test gtest ${GTEST_LIBS} ${DBUSTEST_LIBRARIES} ${GIO2_LIBRARIES})
54add_test (zg-test zg-test)
55
4656
=== added file 'tests/zg-test.cc'
--- tests/zg-test.cc 1970-01-01 00:00:00 +0000
+++ tests/zg-test.cc 2013-11-19 04:12:01 +0000
@@ -0,0 +1,68 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Ted Gould <ted.gould@canonical.com>
18 */
19
20#include <gtest/gtest.h>
21#include <gio/gio.h>
22#include <libdbustest/dbus-test.h>
23
24TEST(ZGEvent, OpenTest)
25{
26 DbusTestService * service = dbus_test_service_new(NULL);
27
28 DbusTestDbusMock * mock = dbus_test_dbus_mock_new("org.gnome.zeitgeist.Engine");
29 DbusTestDbusMockObject * obj = dbus_test_dbus_mock_get_object(mock, "/org/gnome/zeitgeist/log/activity", "org.gnome.zeitgeist.Log", NULL);
30
31 dbus_test_dbus_mock_object_add_method(mock, obj,
32 "InsertEvents",
33 G_VARIANT_TYPE("a(asaasay)"),
34 G_VARIANT_TYPE("au"),
35 "ret = [ 0 ]",
36 NULL);
37
38 dbus_test_service_add_task(service, DBUS_TEST_TASK(mock));
39
40 DbusTestProcess * zgevent = dbus_test_process_new(ZG_EVENT_TOOL);
41 dbus_test_process_append_param(zgevent, "open");
42 g_setenv("APP_ID", "foo", 1);
43 dbus_test_task_set_wait_for(DBUS_TEST_TASK(zgevent), "org.gnome.zeitgeist.Engine");
44 dbus_test_task_set_name(DBUS_TEST_TASK(zgevent), "ZGEvent");
45
46 dbus_test_service_add_task(service, DBUS_TEST_TASK(zgevent));
47
48 dbus_test_service_start_tasks(service);
49
50 /* Give it time to send the event and exit */
51 g_usleep(100000);
52 while (g_main_pending()) {
53 g_main_iteration(TRUE);
54 }
55
56 ASSERT_EQ(dbus_test_task_get_state(DBUS_TEST_TASK(zgevent)), DBUS_TEST_TASK_STATE_FINISHED);
57 ASSERT_TRUE(dbus_test_task_passed(DBUS_TEST_TASK(zgevent)));
58
59 guint numcalls = 0;
60 const DbusTestDbusMockCall * calls = dbus_test_dbus_mock_object_get_method_calls(mock, obj, "InsertEvents", &numcalls, NULL);
61
62 ASSERT_NE(calls, nullptr);
63 ASSERT_EQ(numcalls, 1);
64
65 g_object_unref(zgevent);
66 g_object_unref(mock);
67 g_object_unref(service);
68}
069
=== modified file 'zg-report-app.c'
--- zg-report-app.c 2013-09-22 18:43:26 +0000
+++ zg-report-app.c 2013-11-19 04:12:01 +0000
@@ -23,7 +23,7 @@
23static gboolean23static gboolean
24watchdog_timeout (gpointer user_data)24watchdog_timeout (gpointer user_data)
25{25{
26 g_error("Watchdog triggered, took to long to submit into Zeitgeist Database!");26 g_error("Watchdog triggered, took too long to submit into Zeitgeist Database!");
27 g_main_loop_quit((GMainLoop *)user_data);27 g_main_loop_quit((GMainLoop *)user_data);
2828
29 return G_SOURCE_REMOVE;29 return G_SOURCE_REMOVE;
@@ -35,7 +35,7 @@
35 GError * error = NULL;35 GError * error = NULL;
36 GArray * result = NULL;36 GArray * result = NULL;
3737
38 result = zeitgeist_log_insert_events_finish(ZEITGEIST_LOG(obj), res, &error);38 result = zeitgeist_log_insert_event_finish(ZEITGEIST_LOG(obj), res, &error);
3939
40 if (error != NULL) {40 if (error != NULL) {
41 g_error("Unable to submit Zeitgeist Event: %s", error->message);41 g_error("Unable to submit Zeitgeist Event: %s", error->message);
@@ -83,7 +83,7 @@
8383
84 GMainLoop * main_loop = g_main_loop_new(NULL, FALSE);84 GMainLoop * main_loop = g_main_loop_new(NULL, FALSE);
8585
86 zeitgeist_log_insert_events(log, NULL, insert_complete, main_loop, event, NULL);86 zeitgeist_log_insert_event(log, event, NULL, insert_complete, main_loop);
87 g_timeout_add_seconds(4, watchdog_timeout, main_loop);87 g_timeout_add_seconds(4, watchdog_timeout, main_loop);
8888
89 g_main_loop_run(main_loop);89 g_main_loop_run(main_loop);

Subscribers

People subscribed via source and target branches