Merge lp:~charlesk/keeper/get-coverage-reports-working into lp:keeper

Proposed by Charles Kerr
Status: Merged
Merge reported by: Charles Kerr
Merged at revision: not available
Proposed branch: lp:~charlesk/keeper/get-coverage-reports-working
Merge into: lp:keeper
Diff against target: 716 lines (+375/-189)
14 files modified
CMakeLists.txt (+2/-1)
HACKING (+64/-0)
src/CMakeLists.txt (+6/-0)
src/helper/CMakeLists.txt (+21/-9)
src/service/CMakeLists.txt (+14/-0)
src/storage-framework/CMakeLists.txt (+22/-5)
src/tar/CMakeLists.txt (+29/-21)
tests/CMakeLists.txt (+6/-0)
tests/unit/CMakeLists.txt (+37/-66)
tests/unit/helper/CMakeLists.txt (+103/-45)
tests/unit/metadata-providers/CMakeLists.txt (+29/-0)
tests/unit/storage/test-factory.cpp (+0/-29)
tests/unit/tar/CMakeLists.txt (+29/-0)
tests/utils/CMakeLists.txt (+13/-13)
To merge this branch: bzr merge lp:~charlesk/keeper/get-coverage-reports-working
Reviewer Review Type Date Requested Status
Xavi Garcia (community) Approve
Review via email: mp+300833@code.launchpad.net

Commit message

Get coverage reports working.

Description of the change

Does what it says on the tin: coverage reports now work.

1. Added cmake variable COVERAGE_TEST_TARGETS, which gets appended to by the subdirectories in src/ with parent scope so that it's visible by the call to enable_coverage_report() in the toplevel CMakeLists.txt.

2. Added cmake variable UNIT_TEST_TARGETS which gets appended to by the subdirectories in tests/ with parent scope so so it, too, is visible to enable_coverage_report()

3. Recursively building UNIT_TEST_TARGETS means we no longer have to have a single 'unit-tests' executable, so break the unit tests into standalone executables. This was the secondary goal of this branch -- making it easier to run a single unit test again and again during a debugging cycle

4. Minor copyediting: use more consistent spacing (eg 2 spaces vs 4) in the CMakeLists.txt files, use target_link_libraries(Qt5::Core) instead of qt5_use_libraries(Core)

To post a comment you must log in.
46. By Charles Kerr

copyediting: whitespace

47. By Charles Kerr

sync with trunk

Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

I think you forgot to add/commit a couple of files:

CMake Error at tests/unit/CMakeLists.txt:33 (add_subdirectory):
  The source directory

    /tmp/get-coverage-reports-working/tests/unit/metadata-providers

  does not contain a CMakeLists.txt file.

CMake Error at tests/unit/CMakeLists.txt:34 (add_subdirectory):
  The source directory

    /tmp/get-coverage-reports-working/tests/unit/tar

  does not contain a CMakeLists.txt file.

review: Needs Fixing
48. By Charles Kerr

fix oops -- forgot to bzr add a couple of CMakeLists.txt

Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

Looks good now, thanks!

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-07-05 21:09:03 +0000
3+++ CMakeLists.txt 2016-07-22 13:14:22 +0000
4@@ -254,9 +254,10 @@
5
6 enable_coverage_report(
7 TARGETS
8+ ${COVERAGE_REPORT_TARGETS}
9 FILTER
10 ${CMAKE_SOURCE_DIR}/tests/*
11 ${CMAKE_BINARY_DIR}/*
12 TESTS
13- unit-tests
14+ ${UNIT_TEST_TARGETS}
15 )
16
17=== added file 'HACKING'
18--- HACKING 1970-01-01 00:00:00 +0000
19+++ HACKING 2016-07-22 13:14:22 +0000
20@@ -0,0 +1,64 @@
21+Building the code
22+-----------------
23+
24+By default, the code is built in release mode. To build a debug version, use
25+
26+ $ mkdir builddebug
27+ $ cd builddebug
28+ $ cmake -DCMAKE_BUILD_TYPE=debug ..
29+ $ make
30+
31+For a release version, use -DCMAKE_BUILD_TYPE=release
32+
33+
34+Running the tests
35+-----------------
36+
37+ $ make
38+ $ make test
39+
40+Note that "make test" alone is dangerous because it does not rebuild
41+any tests if either the library or the test files themselves need
42+rebuilding. It's not possible to fix this with cmake because cmake cannot
43+add build dependencies to built-in targets. To make sure that everything
44+is up-to-date, run "make" before running "make test"!
45+
46+
47+Coverage
48+--------
49+
50+To build with the flags for coverage testing enabled and get coverage:
51+
52+ $ mkdir buildcoverage
53+ $ cd buildcoverage
54+ $ cmake -DCMAKE_BUILD_TYPE=coverage ..
55+ $ make
56+ $ make test
57+ $ make coverage
58+ $ make coverage-html
59+
60+After "make coverage-html" a report will be viewable in
61+./buildcoverage/coveragereport/index.html
62+
63+Unfortunately, it is not possible to get 100% coverage for some files,
64+mainly due to gcc's generation of two destructors for dynamic and non-
65+dynamic instances. For abstract base classes and for classes that
66+prevent stack and static allocation, this causes one of the destructors
67+to be reported as uncovered.
68+
69+There are also issues with some functions in header files that are
70+incorrectly reported as uncovered due to inlining, as well as
71+the impossibility of covering defensive assert(false) statements,
72+such as an assert in the default branch of a switch, where the
73+switch is meant to handle all possible cases explicitly.
74+
75+If you run a binary and get lots of warnings about a "merge mismatch for summaries",
76+this is caused by having made changes to the source that add or remove code
77+that was previously run, so the new coverage output cannot sensibly be merged
78+into the old coverage output. You can get rid of this problem by running
79+
80+ $ make clean-coverage
81+
82+This deletes all the .gcda files, allowing the merge to (sometimes) succeed again.
83+If this doesn't work either, the only remedy is to do a clean build.
84+
85
86=== modified file 'src/CMakeLists.txt'
87--- src/CMakeLists.txt 2016-07-13 16:09:04 +0000
88+++ src/CMakeLists.txt 2016-07-22 13:14:22 +0000
89@@ -11,3 +11,9 @@
90 add_subdirectory(storage-framework)
91 add_subdirectory(simple-helper)
92 add_subdirectory(tar)
93+
94+set(
95+ COVERAGE_REPORT_TARGETS
96+ ${COVERAGE_REPORT_TARGETS}
97+ PARENT_SCOPE
98+)
99
100=== modified file 'src/helper/CMakeLists.txt'
101--- src/helper/CMakeLists.txt 2016-07-12 20:17:22 +0000
102+++ src/helper/CMakeLists.txt 2016-07-22 13:14:22 +0000
103@@ -1,9 +1,13 @@
104-
105 include(FindPkgConfig)
106-pkg_check_modules(UAL REQUIRED ubuntu-app-launch-2)
107-include_directories(SYSTEM ${UAL_INCLUDE_DIRS})
108-pkg_check_modules(PROP-CPP REQUIRED properties-cpp)
109-include_directories(SYSTEM ${PROP-CPP_INCLUDE_DIRS})
110+pkg_check_modules(BACKUP_HELPER_DEPENDENCIES REQUIRED
111+ ubuntu-app-launch-2
112+ properties-cpp
113+)
114+
115+include_directories(
116+ SYSTEM
117+ ${BACKUP_HELPER_DEPENDENCIES_INCLUDE_DIRS}
118+)
119
120 add_library(
121 backup-helper
122@@ -14,11 +18,19 @@
123 ${CMAKE_SOURCE_DIR}/include/helper/backup-helper.h
124 )
125
126-qt5_use_modules(backup-helper Core DBus Network)
127-set_target_properties(backup-helper PROPERTIES AUTOMOC TRUE)
128+set_target_properties(
129+ backup-helper
130+ PROPERTIES
131+ AUTOMOC TRUE
132+)
133
134-target_link_libraries(backup-helper
135- ${UAL_LIBRARIES})
136+target_link_libraries(
137+ backup-helper
138+ ${BACKUP_HELPER_DEPENDENCIES_LIBRARIES}
139+ Qt5::Core
140+ Qt5::DBus
141+ Qt5::Network
142+)
143
144 install(
145 FILES ${CMAKE_SOURCE_DIR}/src/helper/exec-tool
146
147=== modified file 'src/service/CMakeLists.txt'
148--- src/service/CMakeLists.txt 2016-07-13 16:09:04 +0000
149+++ src/service/CMakeLists.txt 2016-07-22 13:14:22 +0000
150@@ -19,6 +19,13 @@
151 ${SERVICE_LIB_SOURCES}
152 )
153
154+set(
155+ COVERAGE_REPORT_TARGETS
156+ ${COVERAGE_REPORT_TARGETS}
157+ ${SERVICE_LIB}
158+ PARENT_SCOPE
159+)
160+
161 set(SERVICE_EXEC_SOURCES
162 main.cpp
163 )
164@@ -49,3 +56,10 @@
165 ${SERVICE_EXEC}
166 RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}
167 )
168+
169+set(
170+ COVERAGE_REPORT_TARGETS
171+ ${COVERAGE_REPORT_TARGETS}
172+ ${SERVICE_EXEC}
173+ PARENT_SCOPE
174+)
175
176=== modified file 'src/storage-framework/CMakeLists.txt'
177--- src/storage-framework/CMakeLists.txt 2016-06-25 19:34:21 +0000
178+++ src/storage-framework/CMakeLists.txt 2016-07-22 13:14:22 +0000
179@@ -1,13 +1,30 @@
180+set(
181+ LIB_NAME
182+ storage-framework
183+)
184
185 add_library(
186- storage-framework
187+ ${LIB_NAME}
188 STATIC
189 storage_framework_client.cpp
190 storage_framework_client.h
191 )
192
193-qt5_use_modules(storage-framework Core Network)
194-set_target_properties(backup-helper PROPERTIES AUTOMOC TRUE)
195+set_target_properties(
196+ ${LIB_NAME}
197+ PROPERTIES
198+ AUTOMOC TRUE
199+)
200+target_link_libraries(
201+ ${LIB_NAME}
202+ -lstorage-framework-qt-local-client
203+ Qt5::Core
204+ Qt5::Network
205+)
206
207-target_link_libraries(storage-framework
208- -lstorage-framework-qt-local-client)
209+set(
210+ COVERAGE_REPORT_TARGETS
211+ ${COVERAGE_REPORT_TARGETS}
212+ ${LIB_NAME}
213+ PARENT_SCOPE
214+)
215
216=== modified file 'src/tar/CMakeLists.txt'
217--- src/tar/CMakeLists.txt 2016-07-07 12:35:22 +0000
218+++ src/tar/CMakeLists.txt 2016-07-22 13:14:22 +0000
219@@ -2,45 +2,53 @@
220 set(APP_NAME "keeper-tar-create")
221
222 set(LIB_SOURCES
223- tar-creator.cpp
224+ tar-creator.cpp
225 )
226 add_library(
227- ${LIB_NAME}
228- STATIC
229- ${LIB_SOURCES}
230+ ${LIB_NAME}
231+ STATIC
232+ ${LIB_SOURCES}
233 )
234
235 set_property(
236- SOURCE main.cpp
237- PROPERTIES APPEND_STRING PROPERTY COMPILE_DEFINITIONS APP_NAME=\"${APP_NAME}\"
238+ SOURCE main.cpp
239+ PROPERTIES APPEND_STRING PROPERTY COMPILE_DEFINITIONS APP_NAME=\"${APP_NAME}\"
240 )
241
242 set(APP_SOURCES
243- main.cpp
244+ main.cpp
245 )
246
247 add_executable(
248- ${APP_NAME}
249- ${APP_SOURCES}
250+ ${APP_NAME}
251+ ${APP_SOURCES}
252 )
253
254 link_directories(
255- ${SERVICE_DEPS_LIBRARY_DIRS}
256+ ${SERVICE_DEPS_LIBRARY_DIRS}
257 )
258
259 target_link_libraries(
260- ${APP_NAME}
261- ${LIB_NAME}
262- qdbus-stubs
263- storage-framework
264- backup-helper
265- ${SERVICE_DEPS_LIBRARIES}
266- Qt5::Core
267- Qt5::DBus
268+ ${APP_NAME}
269+ ${LIB_NAME}
270+ qdbus-stubs
271+ storage-framework
272+ backup-helper
273+ ${SERVICE_DEPS_LIBRARIES}
274+ Qt5::Core
275+ Qt5::DBus
276 )
277
278 install(
279- TARGETS
280- ${APP_NAME}
281- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}
282+ TARGETS
283+ ${APP_NAME}
284+ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}
285+)
286+
287+set(
288+ COVERAGE_REPORT_TARGETS
289+ ${COVERAGE_REPORT_TARGETS}
290+ ${LIB_NAME}
291+ ${APP_NAME}
292+ PARENT_SCOPE
293 )
294
295=== modified file 'tests/CMakeLists.txt'
296--- tests/CMakeLists.txt 2016-07-08 01:59:54 +0000
297+++ tests/CMakeLists.txt 2016-07-22 13:14:22 +0000
298@@ -52,3 +52,9 @@
299 add_subdirectory(dbusmock)
300 add_subdirectory(unit)
301 add_subdirectory(utils)
302+
303+set(
304+ UNIT_TEST_TARGETS
305+ ${UNIT_TEST_TARGETS}
306+ PARENT_SCOPE
307+)
308\ No newline at end of file
309
310=== modified file 'tests/unit/CMakeLists.txt'
311--- tests/unit/CMakeLists.txt 2016-07-21 04:43:41 +0000
312+++ tests/unit/CMakeLists.txt 2016-07-22 13:14:22 +0000
313@@ -1,69 +1,40 @@
314-
315-
316-add_definitions (-DCMAKE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
317-add_definitions (-DTEST_SIMPLE_HELPER="${CMAKE_BINARY_DIR}/src/simple-helper/simple-helper")
318-add_definitions (-DKEEPER_SERVICE_BIN="${CMAKE_BINARY_DIR}/src/service/keeper-service")
319-add_definitions (-DKEEPER_CLIENT_BIN="${CMAKE_BINARY_DIR}/src/cli/keeper")
320-add_definitions (-DTEST_SIMPLE_HELPER_SH="${CMAKE_SOURCE_DIR}/src/simple-helper/helper-test.sh")
321-add_definitions (-DKEEPER_TAR_CREATE_BIN="${CMAKE_BINARY_DIR}/src/tar/keeper-tar-create")
322-
323-pkg_check_modules(HELPERS_TEST_DEPS REQUIRED
324- ubuntu-app-launch-2
325- properties-cpp
326- dbustest-1>=14.04.0
327- glib-2.0>=2.26
328- gio-2.0>=2.26
329- gio-unix-2.0
330-)
331-
332-include_directories(
333- "${CMAKE_SOURCE_DIR}/src"
334-)
335-
336-include_directories(
337- SYSTEM
338- ${HELPERS_TEST_DEPS_INCLUDE_DIRS}
339-)
340-
341-add_executable(
342- unit-tests
343-
344- tar/tar-creator-test.cpp
345-
346- storage/test-factory.cpp
347-
348- helper/fake-helper.h
349- helper/speed-test.cpp
350-
351- helper/helpers-test.cc
352- helper/mir-mock.cpp
353-
354- metadata-providers/user-dirs-test.cpp
355-)
356-
357-qt5_use_modules(
358- unit-tests
359- Core
360- DBus
361- Test
362-)
363-
364-target_link_libraries(
365- unit-tests
366- backup-helper
367- test-utils
368- keeperservice
369- keepertar
370- ${SERVICE_DEPS_LDFLAGS}
371- ${HELPERS_TEST_DEPS_LDFLAGS}
372- ${TEST_DEPENDENCIES_LDFLAGS}
373- ${GTEST_LIBRARIES}
374- ${GMOCK_LIBRARIES}
375-)
376-
377-add_test(
378- unit-tests
379- unit-tests
380+add_definitions(
381+ -DCMAKE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
382+ -DTEST_SIMPLE_HELPER="${CMAKE_BINARY_DIR}/src/simple-helper/simple-helper"
383+ -DKEEPER_SERVICE_BIN="${CMAKE_BINARY_DIR}/src/service/keeper-service"
384+ -DKEEPER_CLIENT_BIN="${CMAKE_BINARY_DIR}/src/cli/keeper"
385+ -DTEST_SIMPLE_HELPER_SH="${CMAKE_SOURCE_DIR}/src/simple-helper/helper-test.sh"
386+ -DKEEPER_TAR_CREATE_BIN="${CMAKE_BINARY_DIR}/src/tar/keeper-tar-create"
387+)
388+
389+include_directories(
390+ "${CMAKE_SOURCE_DIR}/src"
391+)
392+
393+include_directories(
394+ SYSTEM
395+ ${HELPERS_TEST_DEPS_INCLUDE_DIRS}
396+)
397+
398+set(
399+ UNIT_TEST_LIBRARIES
400+ backup-helper
401+ test-utils
402+ keeperservice
403+ keepertar
404+ ${SERVICE_DEPS_LDFLAGS}
405+ ${HELPERS_TEST_DEPS_LDFLAGS}
406+ ${TEST_DEPENDENCIES_LDFLAGS}
407+ ${GTEST_LIBRARIES}
408+ ${GMOCK_LIBRARIES}
409 )
410
411 add_subdirectory(helper)
412+add_subdirectory(metadata-providers)
413+add_subdirectory(tar)
414+
415+set(
416+ UNIT_TEST_TARGETS
417+ ${UNIT_TEST_TARGETS}
418+ PARENT_SCOPE
419+)
420
421=== modified file 'tests/unit/helper/CMakeLists.txt'
422--- tests/unit/helper/CMakeLists.txt 2016-07-22 12:30:46 +0000
423+++ tests/unit/helper/CMakeLists.txt 2016-07-22 13:14:22 +0000
424@@ -1,45 +1,103 @@
425-add_definitions ( -DCMAKE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" )
426-add_definitions ( -DCMAKE_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}" )
427-
428-include(FindPkgConfig)
429-pkg_check_modules(UAL REQUIRED ubuntu-app-launch-2)
430-pkg_check_modules(PROP-CPP REQUIRED properties-cpp)
431-
432-pkg_check_modules(DBUSTEST REQUIRED dbustest-1>=14.04.0)
433-include_directories(${DBUSTEST_INCLUDE_DIRS})
434-
435-pkg_check_modules(GIO2 REQUIRED gio-2.0 gio-unix-2.0)
436-include_directories(${GIO2_INCLUDE_DIRS})
437-
438-# Google Test
439-
440-include_directories(${GTEST_INCLUDE_DIR})
441-
442-#add_library (gtest2 STATIC
443-# ${GTEST_SOURCE_DIR}/gtest-all.cc
444-# ${GTEST_SOURCE_DIR}/gtest_main.cc)
445-
446-# libUAL Test
447-include_directories(${UAL_INCLUDE_DIRS})
448-include_directories(${PROP-CPP_INCLUDE_DIRS})
449-
450-add_executable (helpers-test
451- helpers-test.cc
452- mir-mock.cpp
453-)
454-
455-set_target_properties(helpers-test PROPERTIES COMPILE_FLAGS -fPIC)
456-set_target_properties(helpers-test PROPERTIES AUTOMOC TRUE)
457-qt5_use_modules(helpers-test Core DBus Test)
458-
459-target_link_libraries(helpers-test
460- gtest
461- backup-helper
462- test-utils
463- ${GTEST_LIBS}
464- ${LIBUPSTART_LIBRARIES}
465- ${DBUSTEST_LIBRARIES}
466- ${UAL_LIBRARIES}
467- ${GIO2_LIBRARIES})
468-
469-add_test (NAME helpers-test COMMAND helpers-test)
470+add_definitions(
471+ -DCMAKE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
472+ -DCMAKE_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}"
473+)
474+
475+#
476+# helpers-test
477+#
478+
479+pkg_check_modules(HELPERS_TEST_DEPS REQUIRED
480+ ubuntu-app-launch-2
481+ properties-cpp
482+ dbustest-1>=14.04.0
483+ glib-2.0>=2.26
484+ gio-2.0>=2.26
485+ gio-unix-2.0
486+)
487+
488+include_directories(
489+ SYSTEM
490+ ${UAL_INCLUDE_DIRS}
491+ ${PROP-CPP_INCLUDE_DIRS}
492+ ${HELPERS_TEST_DEPS_INCLUDE_DIRS}
493+)
494+
495+set(
496+ HELPERS_TEST
497+ helpers-test
498+)
499+
500+add_executable(
501+ ${HELPERS_TEST}
502+ helpers-test.cc
503+ mir-mock.cpp
504+)
505+
506+set_target_properties(
507+ ${HELPERS_TEST}
508+ PROPERTIES
509+ COMPILE_FLAGS -fPIC
510+ AUTOMOC TRUE
511+)
512+
513+target_link_libraries(
514+ ${HELPERS_TEST}
515+ ${HELPERS_TEST_DEPS_LDFLAGS}
516+ ${UNIT_TEST_LIBRARIES}
517+ Qt5::Core
518+ Qt5::DBus
519+ Qt5::Test
520+)
521+
522+add_test(
523+ NAME ${HELPERS_TEST}
524+ COMMAND ${HELPERS_TEST}
525+)
526+
527+#
528+# speed-test
529+#
530+
531+set(
532+ SPEED_TEST
533+ helper-speed-test
534+)
535+
536+add_executable(
537+ ${SPEED_TEST}
538+ speed-test.cpp
539+ fake-helper.h
540+)
541+
542+set_target_properties(
543+ ${SPEED_TEST}
544+ PROPERTIES
545+ COMPILE_FLAGS -fPIC
546+ AUTOMOC TRUE
547+)
548+
549+target_link_libraries(
550+ ${SPEED_TEST}
551+ ${UNIT_TEST_LIBRARIES}
552+ Qt5::Core
553+ Qt5::DBus
554+ Qt5::Test
555+)
556+
557+add_test(
558+ NAME ${SPEED_TEST}
559+ COMMAND ${SPEED_TEST}
560+)
561+
562+#
563+#
564+#
565+
566+set(
567+ UNIT_TEST_TARGETS
568+ ${UNIT_TEST_TARGETS}
569+ ${HELPERS_TEST}
570+ ${SPEED_TEST}
571+ PARENT_SCOPE
572+)
573
574=== added file 'tests/unit/metadata-providers/CMakeLists.txt'
575--- tests/unit/metadata-providers/CMakeLists.txt 1970-01-01 00:00:00 +0000
576+++ tests/unit/metadata-providers/CMakeLists.txt 2016-07-22 13:14:22 +0000
577@@ -0,0 +1,29 @@
578+set(
579+ TEST_NAME
580+ user-dirs-test
581+)
582+
583+add_executable(
584+ ${TEST_NAME}
585+ user-dirs-test.cpp
586+)
587+
588+target_link_libraries(
589+ ${TEST_NAME}
590+ ${UNIT_TEST_LIBRARIES}
591+ Qt5::Core
592+ Qt5::DBus
593+ Qt5::Test
594+)
595+
596+add_test(
597+ ${TEST_NAME}
598+ ${TEST_NAME}
599+)
600+
601+set(
602+ UNIT_TEST_TARGETS
603+ ${UNIT_TEST_TARGETS}
604+ ${TEST_NAME}
605+ PARENT_SCOPE
606+)
607
608=== removed directory 'tests/unit/storage'
609=== removed file 'tests/unit/storage/test-factory.cpp'
610--- tests/unit/storage/test-factory.cpp 2016-05-28 01:52:46 +0000
611+++ tests/unit/storage/test-factory.cpp 1970-01-01 00:00:00 +0000
612@@ -1,29 +0,0 @@
613-/*
614- * Copyright (C) 2015 Canonical, Ltd.
615- *
616- * This program is free software: you can redistribute it and/or modify it
617- * under the terms of the GNU General Public License version 3, as published
618- * by the Free Software Foundation.
619- *
620- * This program is distributed in the hope that it will be useful, but
621- * WITHOUT ANY WARRANTY; without even the implied warranties of
622- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
623- * PURPOSE. See the GNU General Public License for more details.
624- *
625- * You should have received a copy of the GNU General Public License along
626- * with this program. If not, see <http://www.gnu.org/licenses/>.
627- *
628- * Authors:
629- * Charles Kerr <charles.kerr@canonical.com>
630- */
631-
632-#include <gmock/gmock.h>
633-#include <gtest/gtest.h>
634-
635-class TestFactory : public ::testing::Test
636-{
637-};
638-
639-TEST_F(TestFactory, HelloWorld)
640-{
641-}
642
643=== added file 'tests/unit/tar/CMakeLists.txt'
644--- tests/unit/tar/CMakeLists.txt 1970-01-01 00:00:00 +0000
645+++ tests/unit/tar/CMakeLists.txt 2016-07-22 13:14:22 +0000
646@@ -0,0 +1,29 @@
647+set(
648+ TEST_NAME
649+ tar-creator-test
650+)
651+
652+add_executable(
653+ ${TEST_NAME}
654+ tar-creator-test.cpp
655+)
656+
657+target_link_libraries(
658+ ${TEST_NAME}
659+ ${UNIT_TEST_LIBRARIES}
660+ Qt5::Core
661+ Qt5::DBus
662+ Qt5::Test
663+)
664+
665+add_test(
666+ ${TEST_NAME}
667+ ${TEST_NAME}
668+)
669+
670+set(
671+ UNIT_TEST_TARGETS
672+ ${UNIT_TEST_TARGETS}
673+ ${TEST_NAME}
674+ PARENT_SCOPE
675+)
676
677=== modified file 'tests/utils/CMakeLists.txt'
678--- tests/utils/CMakeLists.txt 2016-07-13 19:09:59 +0000
679+++ tests/utils/CMakeLists.txt 2016-07-22 13:14:22 +0000
680@@ -1,23 +1,23 @@
681-
682 include_directories(
683- ${CMAKE_SOURCE_DIR}/src
684- ${CMAKE_CURRENT_BINARY_DIR}
685+ ${CMAKE_SOURCE_DIR}/src
686+ ${CMAKE_CURRENT_BINARY_DIR}
687 )
688
689 set(
690- LIB_NAME
691- test-utils
692+ LIB_NAME
693+ test-utils
694 )
695
696 add_library(
697- ${LIB_NAME}
698- STATIC
699- main.cpp
700- dummy-file.cpp
701- xdg-user-dirs-sandbox.cpp
702+ ${LIB_NAME}
703+ STATIC
704+ main.cpp
705+ dummy-file.cpp
706+ xdg-user-dirs-sandbox.cpp
707 )
708
709-qt5_use_modules(
710- ${LIB_NAME}
711- Core
712+target_link_libraries(
713+ ${LIB_NAME}
714+ backup-helper
715+ Qt5::Core
716 )

Subscribers

People subscribed via source and target branches

to all changes: