Merge lp:~michihenning/storage-framework/stand-alone-provider-headers into lp:storage-framework/devel

Proposed by Michi Henning
Status: Merged
Approved by: James Henstridge
Approved revision: 56
Merged at revision: 58
Proposed branch: lp:~michihenning/storage-framework/stand-alone-provider-headers
Merge into: lp:storage-framework/devel
Diff against target: 117 lines (+17/-13)
3 files modified
include/unity/storage/provider/internal/dbusmarshal.h (+2/-0)
tests/headers/CMakeLists.txt (+5/-0)
tests/headers/compile_headers.py (+10/-13)
To merge this branch: bzr merge lp:~michihenning/storage-framework/stand-alone-provider-headers
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve
James Henstridge Approve
Review via email: mp+303509@code.launchpad.net

Commit message

Added provider headers to unit tests.

Description of the change

Added provider headers to unit tests.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Continuous integration, rev:54
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/83/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/439/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/445
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/351
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/351
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/351
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/281
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/281/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/281
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/281/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/281/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/281
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/281/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/281
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/281/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/281/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/281
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/281/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/281
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/281/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/281/console

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/83/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
James Henstridge (jamesh) wrote :

Looks good.

review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-autoland/29/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/449/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/455
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/360
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/360
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/360
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/290
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/290/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/290
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/290/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/290/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/290
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/290/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/290
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/290/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/290/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/290
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/290/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/290
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/290/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/290/console

review: Needs Fixing (continuous-integration)
55. By Michi Henning

Merged devel.

56. By Michi Henning

Fixed stand-alone header test failure on yakkety.

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:56
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/89/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/459
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/465
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/370
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/370
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/370
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/300/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/300
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/300/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/89/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/unity/storage/provider/internal/dbusmarshal.h'
2--- include/unity/storage/provider/internal/dbusmarshal.h 2016-08-11 03:49:32 +0000
3+++ include/unity/storage/provider/internal/dbusmarshal.h 2016-08-23 23:50:49 +0000
4@@ -18,6 +18,8 @@
5
6 #pragma once
7
8+#include <unity/storage/provider/ProviderBase.h>
9+
10 #pragma GCC diagnostic push
11 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
12 #include <QDBusArgument>
13
14=== modified file 'tests/headers/CMakeLists.txt'
15--- tests/headers/CMakeLists.txt 2016-06-28 06:35:19 +0000
16+++ tests/headers/CMakeLists.txt 2016-08-23 23:50:49 +0000
17@@ -6,6 +6,7 @@
18
19 set(subdirs
20 unity/storage
21+ unity/storage/provider
22 unity/storage/qt/client
23 unity/storage/qt/client/internal/local_client
24 unity/storage/qt/client/internal/remote_client
25@@ -17,6 +18,8 @@
26 set(extra_inc_dirs "${extra_inc_dirs};${GIO_DEPS_INCLUDE_DIRS}")
27 set(extra_inc_dirs "${extra_inc_dirs};${ONLINEACCOUNTS_DEPS_INCLUDE_DIRS}")
28
29+set(extra_defines "-D BOOST_THREAD_VERSION=4")
30+
31 # Replace ; with -I as the include directories are separated by ";"
32 string(REPLACE ";" " -I/" extra_inc_dirs "${extra_inc_dirs}")
33 set(extra_inc_dirs " -I${extra_inc_dirs}")
34@@ -36,12 +39,14 @@
35 # Test that each public header compiles stand-alone.
36 add_test(stand-alone-${location}-headers
37 ${CMAKE_CURRENT_SOURCE_DIR}/compile_headers.py
38+ ${extra_defines}
39 ${public_inc_dir} ${CMAKE_CXX_COMPILER} "${CMAKE_CXX_COMPILER_ARG1} -fPIC -fsyntax-only -I${root_inc_dir} -I${public_inc_dir} ${other_inc_dirs} ${CMAKE_CXX_FLAGS} ${extra_inc_dirs}")
40
41 # Test that each internal header compiles stand-alone.
42 if (IS_DIRECTORY ${internal_inc_dir})
43 add_test(stand-alone-${location}-internal-headers
44 ${CMAKE_CURRENT_SOURCE_DIR}/compile_headers.py
45+ ${extra_defines}
46 ${internal_inc_dir} ${CMAKE_CXX_COMPILER} "${CMAKE_CXX_COMPILER_ARG1} -fPIC -fsyntax-only -I${root_inc_dir} -I${internal_inc_dir} ${other_inc_dirs} ${CMAKE_CXX_FLAGS} ${extra_inc_dirs}")
47 endif()
48
49
50=== modified file 'tests/headers/compile_headers.py'
51--- tests/headers/compile_headers.py 2016-04-20 01:56:37 +0000
52+++ tests/headers/compile_headers.py 2016-08-23 23:50:49 +0000
53@@ -55,11 +55,6 @@
54 import tempfile
55 import concurrent.futures, multiprocessing
56
57-# Additional #defines that should be set before including a header.
58-# This is intended for things such as enabling additional features
59-# that are conditionally compiled in the source.
60-extra_defines =[]
61-
62 #
63 # Write the supplied message to stderr, preceded by the program name.
64 #
65@@ -77,13 +72,13 @@
66 # and check exit status from the compiler. Throw if the compile command itself fails,
67 # return False if the compile command worked but reported errors, True if the compile succeeded.
68 #
69-def run_compiler(hdr, compiler, copts, verbose, hdr_dir):
70+def run_compiler(hdr, compiler, copts, define, verbose, hdr_dir):
71 try:
72 src = tempfile.NamedTemporaryFile(suffix='.cpp', dir='.')
73
74- # Add any extra defines at the beginning of the temporary file.
75- for flag in extra_defines:
76- src.write(bytes("#define " + flag + "" + "\n", 'UTF-8'))
77+ # Add any extra defines to the command line.
78+ for flag in define:
79+ copts = "-D" + flag + " " + copts
80
81 src.write(bytes("#include <" + hdr + ">" + "\n", 'UTF-8'))
82 src.flush() # Need this to make the file visible
83@@ -119,10 +114,10 @@
84 # and then try to compile the header. Returns normally if all files could be compiled successfully and
85 # throws, otherwise.
86 #
87-def test_files(hdrs, compiler, copts, verbose, hdr_dir):
88+def test_files(hdrs, compiler, copts, define, verbose, hdr_dir):
89 num_errs = 0
90 executor = concurrent.futures.ThreadPoolExecutor(max_workers=multiprocessing.cpu_count())
91- futures = [executor.submit(run_compiler, h, compiler, copts, verbose, hdr_dir) for h in hdrs]
92+ futures = [executor.submit(run_compiler, h, compiler, copts, define, verbose, hdr_dir) for h in hdrs]
93 for f in futures:
94 try:
95 if not f.result():
96@@ -144,10 +139,12 @@
97 #
98 parser = argparse.ArgumentParser(description = 'Test that all headers in the passed directory compile stand-alone.')
99 parser.add_argument('-v', '--verbose', action='store_true', help = 'Trace invocations of the compiler')
100+ parser.add_argument('-D', '--define', action='append', default=[],
101+ help = 'Additional -D directives to be added to the compiler command line')
102 parser.add_argument('dir', nargs = 1, help = 'The directory to look for header files ending in ".h"')
103 parser.add_argument('compiler', nargs = 1, help = 'The compiler executable, such as "gcc"')
104 parser.add_argument('copts', nargs = '?', default="",
105- help = 'The compiler options (excluding -c), such as "-g -Wall -I." as a single string.')
106+ help = 'The compiler options (excluding -c), such as "-g -Wall -I.", as a single string')
107 args = parser.parse_args()
108
109 #
110@@ -163,7 +160,7 @@
111 hdrs = [hdr for hdr in files if hdr.endswith('.h')]
112
113 try:
114- test_files(hdrs, args.compiler[0], args.copts, args.verbose, hdr_dir)
115+ test_files(hdrs, args.compiler[0], args.copts, args.define, args.verbose, hdr_dir)
116 except OSError:
117 sys.exit(1) # Errors were written earlier
118

Subscribers

People subscribed via source and target branches

to all changes: