Skip to content

Commit 7f04e49

Browse files
authored
Add test validating global index store builds (#1070)
Previously only arguments were validated, now we validate that the actions actually succeed, which makes sure we successfully run index-import
1 parent 28a26ad commit 7f04e49

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

test/features_tests.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ load(
44
"@build_bazel_rules_swift//test/rules:action_command_line_test.bzl",
55
"make_action_command_line_test_rule",
66
)
7+
load(
8+
"@bazel_skylib//rules:build_test.bzl",
9+
"build_test",
10+
)
711

812
default_test = make_action_command_line_test_rule()
913
default_opt_test = make_action_command_line_test_rule(
@@ -235,3 +239,11 @@ def features_test_suite(name):
235239
target_under_test = "@build_bazel_rules_swift//test/fixtures/linking:cc_bin",
236240
target_compatible_with = ["@platforms//os:macos"],
237241
)
242+
243+
build_test(
244+
name = "{}_global_index_store_builds".format(name),
245+
tags = [name],
246+
targets = [
247+
"//test/fixtures/global_index_store:simple",
248+
],
249+
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
load("//swift:swift.bzl", "swift_library")
2+
load("//test/fixtures:common.bzl", "FIXTURE_TAGS")
3+
4+
package(
5+
default_visibility = ["//test:__subpackages__"],
6+
)
7+
8+
swift_library(
9+
name = "simple",
10+
srcs = [
11+
"first.swift",
12+
"second.swift",
13+
],
14+
features = [
15+
"swift.use_global_index_store",
16+
"swift.index_while_building",
17+
],
18+
tags = FIXTURE_TAGS,
19+
target_compatible_with = ["@platforms//os:macos"],
20+
)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
func first() {
2+
print("first")
3+
second()
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func second() {
2+
print("second")
3+
}

0 commit comments

Comments
 (0)