Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let package = Package(
targets: [
.target(name: "CIndexStore"),
.target(name: "IndexStore", dependencies: ["CIndexStore"], linkerSettings: indexLinkerSettings),
.testTarget(name: "IndexStoreTests", dependencies: ["IndexStore"], exclude: ["BUILD", "Data"]),
.testTarget(name: "IndexStoreTests", dependencies: ["IndexStore"], exclude: ["BUILD"]),
.target(
name: "CSwiftDemangle",
cxxSettings: [.headerSearchPath("PrivateHeaders/include")],
Expand Down
20 changes: 16 additions & 4 deletions Tests/IndexStoreTests/BUILD
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_test")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library", "swift_test")

swift_library(
name = "dummy",
testonly = True,
srcs = ["dummy.swift"],
features = ["swift.index_while_building"],
)

filegroup(
name = "dummy-index",
testonly = True,
srcs = [":dummy"],
output_group = "swift_index_store",
)

swift_test(
name = "IndexStoreTests",
srcs = [
"DetermineIndexStorePath.swift",
"IndexStoreTests.swift",
],
data = glob([
"Data/**",
]),
data = [":dummy-index"],
deps = [
"//:IndexStore",
],
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Tests/IndexStoreTests/DetermineIndexStorePath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
/// - Returns: Index store path for the current test environment
func determineIndexStorePath() -> String {
if let testSrcDir: String = ProcessInfo.processInfo.environment["TEST_SRCDIR"] {
return testSrcDir + "/_main/Tests/IndexStoreTests/Data/main.indexstore"
return testSrcDir + "/_main/Tests/IndexStoreTests/dummy.indexstore"
}
guard let service = ProcessInfo.processInfo.environment["XPC_SERVICE_NAME"] else {
preconditionFailure("Expected XPC_SERVICE_NAME environment variable")
Expand Down
2 changes: 1 addition & 1 deletion Tests/IndexStoreTests/IndexStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class IndexStoreTests: XCTestCase {
for recordName in unitReader.recordNames {
// Just find one record we know has some reasonable content
guard recordName.hasPrefix("IndexStoreTests.swift") ||
recordName.hasPrefix("main.swift") else {
recordName.hasPrefix("dummy.swift") else {
continue
}

Expand Down
3 changes: 3 additions & 0 deletions Tests/IndexStoreTests/dummy.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
func foo() -> Int {
return 5
}