Merge lp:~dobey/indicator-power/fix-gtest into lp:indicator-power

Proposed by dobey on 2017-02-07
Status: Merged
Approved by: dobey on 2017-02-08
Approved revision: 304
Merged at revision: 305
Proposed branch: lp:~dobey/indicator-power/fix-gtest
Merge into: lp:indicator-power
Diff against target: 102 lines (+5/-49)
4 files modified
CMakeLists.txt (+0/-3)
debian/control (+2/-1)
tests/CMakeLists.txt (+3/-7)
tests/Makefile.am.strings (+0/-38)
To merge this branch: bzr merge lp:~dobey/indicator-power/fix-gtest
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve on 2017-02-10
Ted Gould (community) 2017-02-07 Approve on 2017-02-07
unity-api-1-bot continuous-integration Approve on 2017-02-07
Review via email: mp+316614@code.launchpad.net

Commit message

Use gmock module from cmake-extras.

To post a comment you must log in.
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:304
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-power-ci/7/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1623
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1630
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1408/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-power-ci/7/rebuild

review: Approve (continuous-integration)
Ted Gould (ted) :
review: Approve
Charles Kerr (charlesk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-05-16 18:09:57 +0000
3+++ CMakeLists.txt 2017-02-07 19:50:14 +0000
4@@ -85,9 +85,6 @@
5
6 # testing & coverage
7 if (${enable_tests})
8- set (GTEST_SOURCE_DIR /usr/src/gtest/src)
9- set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/..)
10- set (GTEST_LIBS -lpthread)
11 enable_testing ()
12 if (${enable_lcov})
13 include(GCov)
14
15=== modified file 'debian/control'
16--- debian/control 2016-07-19 10:25:12 +0000
17+++ debian/control 2017-02-07 19:50:14 +0000
18@@ -3,6 +3,7 @@
19 Priority: optional
20 Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
21 Build-Depends: cmake,
22+ cmake-extras (>= 0.10),
23 libnotify-dev (>= 0.7.6),
24 libglib2.0-dev (>= 2.36),
25 libgudev-1.0-dev,
26@@ -15,7 +16,7 @@
27 dh-translations,
28 intltool,
29 # for tests
30- libgtest-dev,
31+ googletest | google-mock,
32 python3-dbusmock,
33 dbus-test-runner,
34 libdbustest1-dev,
35
36=== modified file 'tests/CMakeLists.txt'
37--- tests/CMakeLists.txt 2016-05-16 17:59:03 +0000
38+++ tests/CMakeLists.txt 2017-02-07 19:50:14 +0000
39@@ -1,9 +1,5 @@
40-# build libgtest
41-add_library (gtest STATIC
42- ${GTEST_SOURCE_DIR}/gtest-all.cc
43- ${GTEST_SOURCE_DIR}/gtest_main.cc)
44-set_target_properties (gtest PROPERTIES INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GTEST_INCLUDE_DIR})
45-set_target_properties (gtest PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS} -w)
46+find_package(GMock)
47+include_directories(${GMOCK_INCLUDE_DIRS})
48
49 # dbustest
50 pkg_check_modules(DBUSTEST REQUIRED
51@@ -50,7 +46,7 @@
52 add_executable (${TEST_NAME} ${TEST_NAME}.cc gschemas.compiled)
53 add_test (${TEST_NAME} ${TEST_NAME})
54 add_dependencies (${TEST_NAME} ${SERVICE_LIB})
55- target_link_libraries (${TEST_NAME} ${SERVICE_LIB} gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
56+ target_link_libraries (${TEST_NAME} ${SERVICE_LIB} ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GMOCK_LIBRARIES})
57 endfunction()
58 add_test_by_name(test-notify)
59 add_test(NAME dear-reader-the-next-test-takes-80-seconds COMMAND true)
60
61=== removed file 'tests/Makefile.am.strings'
62--- tests/Makefile.am.strings 2012-05-24 14:49:30 +0000
63+++ tests/Makefile.am.strings 1970-01-01 00:00:00 +0000
64@@ -1,38 +0,0 @@
65-TESTS += \
66- test-ellipsis \
67- test-space-ellipsis \
68- test-ascii-quotes
69-
70-#####
71-# Tests for there being proper ellipsis instead of three periods in a row
72-#####
73-test-ellipsis: $(top_srcdir)/po
74- @echo "#!/bin/bash" > $@
75- @echo "(cd $(top_srcdir)/po && make $(GETTEXT_PACKAGE).pot)" >> $@
76- @echo "grep -c -e \"^msgid.*\.\.\.\\\"\" $(top_srcdir)/po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"Ellipsis found in user visible strings\" >&2 && exit 1" >> $@
77- @echo "exit 0" >> $@
78- @chmod +x $@
79-
80-#####
81-# Tests for there being a space before an ellipsis
82-#####
83-test-space-ellipsis: $(top_srcdir)/po
84- @echo "#!/bin/bash" > $@
85- @echo "(cd $(top_srcdir)/po && make $(GETTEXT_PACKAGE).pot)" >> $@
86- @echo "grep -c -e \"^msgid.* …\\\"\" $(top_srcdir)/po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"Space before ellipsis found in user visible strings\" >&2 && exit 1" >> $@
87- @echo "exit 0" >> $@
88- @chmod +x $@
89-
90-#####
91-# Tests for ASCII quote types
92-#####
93-test-ascii-quotes: $(top_srcdir)/po
94- @echo "#!/bin/bash" > $@
95- @echo "(cd $(top_srcdir)/po && make $(GETTEXT_PACKAGE).pot)" >> $@
96- @echo "grep -c -e \"^msgid \\\".*'.*\\\"\" $(top_srcdir)/po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"ASCII apostrophy found in user visible strings\" >&2 && exit 1" >> $@
97- @echo "grep -c -e \"^msgid \\\".*\\\".*\\\"\" $(top_srcdir)/po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"ASCII quote found in user visible strings\" >&2 && exit 1" >> $@
98- @echo "grep -c -e \"^msgid \\\".*\\\`.*\\\"\" $(top_srcdir)/po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"ASCII backtick found in user visible strings\" >&2 && exit 1" >> $@
99- @echo "exit 0" >> $@
100- @chmod +x $@
101-
102-CLEANFILES += $(TESTS)

Subscribers

People subscribed via source and target branches