Skip to content

Commit

Permalink
Use target_compatible_with for macOS only tests (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith authored May 4, 2021
1 parent 52827d9 commit aab5e21
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 34 deletions.
8 changes: 0 additions & 8 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,3 @@ bzl_library(
"//test/rules:starlark_tests_bzls",
],
)

# TODO: Remove once https://github.com/bazelbuild/bazel/pull/10945 lands
config_setting(
name = "linux",
constraint_values = [
"@bazel_tools//platforms:linux",
],
)
12 changes: 5 additions & 7 deletions test/coverage_settings_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ def coverage_settings_test_suite(name = "coverage_settings"):
coverage_xcode_prefix_map_test(
name = "{}_xcode_prefix_map".format(name),
tags = [name],
expected_argv = select({
"//test:linux": [],
"//conditions:default": [
"-coverage-prefix-map",
"__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR",
],
}),
expected_argv = [
"-coverage-prefix-map",
"__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR",
],
target_compatible_with = ["@platforms//os:macos"],
mnemonic = "SwiftCompile",
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
)
12 changes: 5 additions & 7 deletions test/debug_settings_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,11 @@ def debug_settings_test_suite(name = "debug_settings"):

xcode_remap_command_line_test(
name = "{}_remap_xcode_path".format(name),
expected_argv = select({
"//test:linux": [],
"//conditions:default": [
"-debug-prefix-map",
"__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR",
],
}),
expected_argv = [
"-debug-prefix-map",
"__BAZEL_XCODE_DEVELOPER_DIR__=DEVELOPER_DIR",
],
target_compatible_with = ["@platforms//os:macos"],
mnemonic = "SwiftCompile",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
Expand Down
16 changes: 4 additions & 12 deletions test/split_derived_files_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,8 @@ def split_derived_files_test_suite(name = "split_derived_files"):

split_swiftmodule_bitcode_test(
name = "{}_bitcode_compile".format(name),
expected_argv = select({
"//test:linux": [],
"//conditions:default": [
"-embed-bitcode",
],
}),
expected_argv = ["-embed-bitcode"],
target_compatible_with = ["@platforms//os:macos"],
mnemonic = "SwiftCompile",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
Expand All @@ -297,12 +293,8 @@ def split_derived_files_test_suite(name = "split_derived_files"):

split_swiftmodule_bitcode_markers_test(
name = "{}_bitcode_markers_compile".format(name),
expected_argv = select({
"//test:linux": [],
"//conditions:default": [
"-embed-bitcode-marker",
],
}),
expected_argv = ["-embed-bitcode-marker"],
target_compatible_with = ["@platforms//os:macos"],
mnemonic = "SwiftCompile",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
Expand Down

0 comments on commit aab5e21

Please sign in to comment.