diff --git a/test/features_tests.bzl b/test/features_tests.bzl index c23d28af4..8c4128458 100644 --- a/test/features_tests.bzl +++ b/test/features_tests.bzl @@ -4,6 +4,10 @@ load( "@build_bazel_rules_swift//test/rules:action_command_line_test.bzl", "make_action_command_line_test_rule", ) +load( + "@bazel_skylib//rules:build_test.bzl", + "build_test", +) default_test = make_action_command_line_test_rule() default_opt_test = make_action_command_line_test_rule( @@ -235,3 +239,11 @@ def features_test_suite(name): target_under_test = "@build_bazel_rules_swift//test/fixtures/linking:cc_bin", target_compatible_with = ["@platforms//os:macos"], ) + + build_test( + name = "{}_global_index_store_builds".format(name), + tags = [name], + targets = [ + "//test/fixtures/global_index_store:simple", + ], + ) diff --git a/test/fixtures/global_index_store/BUILD b/test/fixtures/global_index_store/BUILD new file mode 100644 index 000000000..4dcb5503b --- /dev/null +++ b/test/fixtures/global_index_store/BUILD @@ -0,0 +1,20 @@ +load("//swift:swift.bzl", "swift_library") +load("//test/fixtures:common.bzl", "FIXTURE_TAGS") + +package( + default_visibility = ["//test:__subpackages__"], +) + +swift_library( + name = "simple", + srcs = [ + "first.swift", + "second.swift", + ], + features = [ + "swift.use_global_index_store", + "swift.index_while_building", + ], + tags = FIXTURE_TAGS, + target_compatible_with = ["@platforms//os:macos"], +) diff --git a/test/fixtures/global_index_store/first.swift b/test/fixtures/global_index_store/first.swift new file mode 100644 index 000000000..8e55a49bd --- /dev/null +++ b/test/fixtures/global_index_store/first.swift @@ -0,0 +1,4 @@ +func first() { + print("first") + second() +} diff --git a/test/fixtures/global_index_store/second.swift b/test/fixtures/global_index_store/second.swift new file mode 100644 index 000000000..583210c55 --- /dev/null +++ b/test/fixtures/global_index_store/second.swift @@ -0,0 +1,3 @@ +func second() { + print("second") +}