Skip to content
Snippets Groups Projects
Commit c159539c authored by P.Y. Laligand's avatar P.Y. Laligand Committed by CQ bot account: commit-bot@chromium.org
Browse files

[sdk][bazel] Generate one header inclusion test per library.

Bug: DX-697
Change-Id: Iecc8f6498f568965b35566ba84e0b01576891efc
parent b0a89056
No related branches found
No related tags found
No related merge requests found
......@@ -79,16 +79,17 @@ def create_test_workspace(sdk, output, workspace_info):
is_executable=True)
if workspace_info.with_cc:
# Generate test to verify that headers compile fine.
headers = workspace_info.headers
header_base = os.path.join(output, 'headers')
write_file(make_dir(os.path.join(header_base, 'BUILD')),
'headers_build', {
'deps': list(filter(lambda k: headers[k], headers.keys())),
})
write_file(make_dir(os.path.join(header_base, 'headers.cc')),
'headers', {
'headers': headers,
})
# Generate tests to verify that headers compile fine.
for target, files in workspace_info.headers.iteritems():
if not files:
continue
dir = os.path.join(output, 'headers', target[2:])
write_file(make_dir(os.path.join(dir, 'BUILD')),
'headers_build', {
'dep': target,
'headers': files,
})
write_file(make_dir(os.path.join(dir, 'headers.cc')),
'headers', {'headers': files})
return True
......@@ -2,13 +2,8 @@
// This file verifies that all headers included in an SDK are valid.
% for dep, headers in sorted(data['headers'].iteritems()):
% if headers:
// ${dep}
% for header in headers:
% for header in sorted(data['headers']):
#include "${header}"
% endfor
% endif
% endfor
int main(int argc, const char** argv) {}
......@@ -6,8 +6,6 @@ cc_binary(
"headers.cc",
],
deps = [
% for dep in sorted(data['deps']):
"@fuchsia_sdk${dep}",
% endfor
"@fuchsia_sdk${data['dep']}",
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment