-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e33fa6
commit 07c5bbd
Showing
12 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import XCTest | ||
import Commands | ||
import ArgumentParser | ||
import Shared | ||
import System | ||
|
||
|
||
public enum Fixture: String { | ||
case defaultiOSProject = "Tests/FrontendTests/DefaultiOSProject/DefaultiOSProject.xcodeproj" | ||
} | ||
|
||
public class AcceptanceTestCase: XCTestCase { | ||
let packageRootPath = URL(fileURLWithPath: #file).pathComponents | ||
.prefix(while: { $0 != "Tests" }).joined(separator: "/").dropFirst() | ||
|
||
public override class func setUp() { | ||
Configuration.shared.reset() | ||
super.setUp() | ||
} | ||
|
||
public override class func tearDown() { | ||
Configuration.shared.reset() | ||
super.tearDown() | ||
} | ||
|
||
public func run(command: FrontendCommand.Type, arguments: String...) throws { | ||
var command = try command | ||
.parse(arguments) | ||
try command.run() | ||
} | ||
|
||
public func setupFixture(fixture: Fixture) -> FilePath { | ||
var file = FilePath(String(packageRootPath)) | ||
file.append(fixture.rawValue) | ||
return file | ||
} | ||
|
||
public func XCTOutputDefaultOutputWithoutUnusedCode(scheme: String) { | ||
XCTAssertTrue(LoggerStorage.collectedLogs.contains( | ||
[ | ||
"* Inspecting project...", | ||
"* Building \(scheme)...", | ||
"* Indexing...", | ||
"* Analyzing...", | ||
"", | ||
"* No unused code detected." | ||
] | ||
)) | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import Shared | ||
import SystemPackage | ||
import XCTest | ||
|
||
|