Skip to content

Commit

Permalink
Fix test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrymarino committed Oct 8, 2021
1 parent b2a9946 commit 5138482
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
run: sudo xcode-select -s /Applications/Xcode_12.2.app
- name: Build and Test
run: |
# Host config
bazelisk test --local_test_jobs=1 -- //... -//tests/ios/...
# `deleted_packages` is needed below in order to override the value of the .bazelrc file
bazelisk test --local_test_jobs=1 --apple_platform_type=ios --deleted_packages='' -- //tests/ios/...
- uses: actions/upload-artifact@v2
Expand All @@ -28,16 +30,24 @@ jobs:
# Build the entire tree with this feature enabled. Longer term, we'll likely
# consider merging this feature into the default behavior and can re-align
# the CI job
name: Build ( Virtual Frameworks )
name: Build and Test ( Virtual Frameworks )
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Select Xcode 12.2
run: sudo xcode-select -s /Applications/Xcode_12.2.app
- name: Build and Test
run: |
bazelisk build //... --features apple.virtualize_frameworks
bazelisk test //... --features apple.virtualize_frameworks
# Host config
bazelisk test --features apple.virtualize_frameworks --local_test_jobs=1 -- //... -//tests/ios/...
# `deleted_packages` is needed below in order to override the value of the .bazelrc file
bazelisk test --features apple.virtualize_frameworks \
--local_test_jobs=1 \
--apple_platform_type=ios \
--deleted_packages='' \
-- //tests/ios/... \
-//tests/ios/frameworks/sources-with-prebuilt-binaries/... # Needs more work for pre-built binaries
- uses: actions/upload-artifact@v2
if: failure()
with:
Expand Down
5 changes: 5 additions & 0 deletions rules/analysis_tests/transitive_header_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ def _transitive_header_test_impl(ctx):
dep_headers = dep[CcInfo].compilation_context.headers.to_list()
for dep_header in dep_headers:
# Assert that all of the dep headers are in the target
if not dep_header.extension == "h":
continue

has_header = dep_header in target_headers
if not has_header:
print("Missing header", dep_header, target_headers)
asserts.true(env, has_header)
return analysistest.end(env)

Expand Down
1 change: 1 addition & 0 deletions rules/apple_patched.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def _get_framework_info_providers(ctx, old_cc_info, old_objc_provider):
private_hdrs = [],
has_swift = False,
framework_name = imported_framework_name,
extra_search_paths = imported_framework_name,
)
framework_info = FrameworkInfo(
vfsoverlay_infos = [vfs.vfs_info],
Expand Down
4 changes: 2 additions & 2 deletions rules/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def _get_virtual_framework_info(ctx, framework_files, compilation_context_fields
# transitive headers
if not CcInfo in dep:
continue
for h in dep[CcInfo].compilation_context.headers.to_list():
propagated_interface_headers.append(depset([h]))
compilation_context = dep[CcInfo].compilation_context
propagated_interface_headers.append(compilation_context.headers)

if not FrameworkInfo in dep:
continue
Expand Down
7 changes: 0 additions & 7 deletions tests/ios/app/analysis-tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,9 @@ def make_tests():
deps = [":AppWithSelectableCopts", ":SwiftLib"],
)

transitive_header_test(
name = "test_SwiftCompilationHeaders",
target_under_test = ":AppWithSelectableCopts_objc",
deps = [":SwiftLib"],
)

native.test_suite(
name = "AnalysisTests",
tests = [
":test_DependencyEquivilance",
":test_SwiftCompilationHeaders",
],
)

0 comments on commit 5138482

Please sign in to comment.