Skip to content

Commit 07c5bbd

Browse files
committed
Moved fixture
1 parent 8e33fa6 commit 07c5bbd

File tree

12 files changed

+56
-28
lines changed

12 files changed

+56
-28
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import XCTest
2+
import Commands
3+
import ArgumentParser
4+
import Shared
5+
import System
6+
7+
8+
public enum Fixture: String {
9+
case defaultiOSProject = "Tests/FrontendTests/DefaultiOSProject/DefaultiOSProject.xcodeproj"
10+
}
11+
12+
public class AcceptanceTestCase: XCTestCase {
13+
let packageRootPath = URL(fileURLWithPath: #file).pathComponents
14+
.prefix(while: { $0 != "Tests" }).joined(separator: "/").dropFirst()
15+
16+
public override class func setUp() {
17+
Configuration.shared.reset()
18+
super.setUp()
19+
}
20+
21+
public override class func tearDown() {
22+
Configuration.shared.reset()
23+
super.tearDown()
24+
}
25+
26+
public func run(command: FrontendCommand.Type, arguments: String...) throws {
27+
var command = try command
28+
.parse(arguments)
29+
try command.run()
30+
}
31+
32+
public func setupFixture(fixture: Fixture) -> FilePath {
33+
var file = FilePath(String(packageRootPath))
34+
file.append(fixture.rawValue)
35+
return file
36+
}
37+
38+
public func XCTOutputDefaultOutputWithoutUnusedCode(scheme: String) {
39+
XCTAssertTrue(LoggerStorage.collectedLogs.contains(
40+
[
41+
"* Inspecting project...",
42+
"* Building \(scheme)...",
43+
"* Indexing...",
44+
"* Analyzing...",
45+
"",
46+
"* No unused code detected."
47+
]
48+
))
49+
}
50+
51+
}

0 commit comments

Comments
 (0)