Skip to content

Commit 456a370

Browse files
committed
wip
1 parent e39fd3d commit 456a370

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

Fixtures/Miscellaneous/TestableExe/Tests/TestableExeTests/TestableExeTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
2-
import TestableExe1
3-
import TestableExe2
2+
@testable import TestableExe1
3+
@testable import TestableExe2
44
// import TestableExe3
55
import class Foundation.Bundle
66

@@ -9,7 +9,7 @@ final class TestableExeTests: XCTestCase {
99
// This is an example of a functional test case.
1010
// Use XCTAssert and related functions to verify your tests produce the correct
1111
// results.
12-
12+
1313
print(GetGreeting1())
1414
XCTAssertEqual(GetGreeting1(), "Hello, world")
1515
print(GetGreeting2())

Sources/LLBuildManifest/BuildManifest.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public struct BuildManifest {
5151
inputs: [Node],
5252
outputs: [Node]
5353
) {
54-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
54+
assert(commands[name] == nil, "already had a command named '\(name)'")
5555
let tool = PhonyTool(inputs: inputs, outputs: outputs)
5656
commands[name] = Command(name: name, tool: tool)
5757
}
@@ -61,7 +61,7 @@ public struct BuildManifest {
6161
inputs: [Node],
6262
outputs: [Node]
6363
) {
64-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
64+
assert(commands[name] == nil, "already had a command named '\(name)'")
6565
let tool = TestDiscoveryTool(inputs: inputs, outputs: outputs)
6666
commands[name] = Command(name: name, tool: tool)
6767
}
@@ -71,7 +71,7 @@ public struct BuildManifest {
7171
inputs: [Node],
7272
outputs: [Node]
7373
) {
74-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
74+
assert(commands[name] == nil, "already had a command named '\(name)'")
7575
let tool = CopyTool(inputs: inputs, outputs: outputs)
7676
commands[name] = Command(name: name, tool: tool)
7777
}
@@ -81,7 +81,7 @@ public struct BuildManifest {
8181
inputs: [Node],
8282
outputs: [Node]
8383
) {
84-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
84+
assert(commands[name] == nil, "already had a command named '\(name)'")
8585
let tool = PackageStructureTool(inputs: inputs, outputs: outputs)
8686
commands[name] = Command(name: name, tool: tool)
8787
}
@@ -91,7 +91,7 @@ public struct BuildManifest {
9191
inputs: [Node],
9292
outputs: [Node]
9393
) {
94-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
94+
assert(commands[name] == nil, "already had a command named '\(name)'")
9595
let tool = ArchiveTool(inputs: inputs, outputs: outputs)
9696
commands[name] = Command(name: name, tool: tool)
9797
}
@@ -106,7 +106,7 @@ public struct BuildManifest {
106106
workingDirectory: String? = nil,
107107
allowMissingInputs: Bool = false
108108
) {
109-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
109+
assert(commands[name] == nil, "already had a command named '\(name)'")
110110
let tool = ShellTool(
111111
description: description,
112112
inputs: inputs,
@@ -127,7 +127,7 @@ public struct BuildManifest {
127127
outputs: [Node],
128128
arguments: [String]
129129
) {
130-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
130+
assert(commands[name] == nil, "already had a command named '\(name)'")
131131
let tool = SwiftFrontendTool(
132132
moduleName: moduleName,
133133
description: description,
@@ -146,7 +146,7 @@ public struct BuildManifest {
146146
arguments: [String],
147147
dependencies: String? = nil
148148
) {
149-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
149+
assert(commands[name] == nil, "already had a command named '\(name)'")
150150
let tool = ClangTool(
151151
description: description,
152152
inputs: inputs,
@@ -173,7 +173,7 @@ public struct BuildManifest {
173173
isLibrary: Bool,
174174
wholeModuleOptimization: Bool
175175
) {
176-
assert(commands[name] == nil, "aleady had a command named '\(name)'")
176+
assert(commands[name] == nil, "already had a command named '\(name)'")
177177
let tool = SwiftCompilerTool(
178178
inputs: inputs,
179179
outputs: outputs,

Tests/CommandsTests/TestToolTests.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,22 @@ final class TestToolTests: CommandsTestCase {
6161

6262
func testEnableDisableTestability() {
6363
fixture(name: "Miscellaneous/TestableExe") { path in
64+
// default should run with testability
6465
do {
6566
let result = try execute(["--vv"], packagePath: path)
66-
// default should run with testability
6767
XCTAssertMatch(result.stdout, .contains("-enable-testing"))
6868
}
6969

70+
// disabled
7071
do {
71-
// disable
7272
let result = try execute(["--disable-testable-imports", "--vv"], packagePath: path)
73-
XCTAssertNoMatch(result.stdout, .contains("-enable-testing"))
73+
} catch SwiftPMProductError.executionFailure(_, let stdout, _) {
74+
XCTAssertNoMatch(stdout, .contains("-enable-testing"))
75+
XCTAssertMatch(stdout, .contains("was not compiled for testing"))
7476
}
7577

78+
// enabled
7679
do {
77-
// enable
7880
let result = try execute(["--enable-testable-imports", "--vv"], packagePath: path)
7981
XCTAssertMatch(result.stdout, .contains("-enable-testing"))
8082
}

0 commit comments

Comments
 (0)