Skip to content

Commit

Permalink
[data-driven] - Fix CLI tests - TT
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler-Keith-Thompson committed Mar 31, 2022
1 parent 554fe57 commit 2005c55
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,21 @@ final class SwiftCurrent_TypeRegistryGeneratorTests: XCTestCase {

let source = typeDefs.joined(separator: "\n")
measure {
if let output = try? shellOut(to: "\(generatorCommand) \"\(source)\""),
let data = output.data(using: .utf8) {
let IR = try? JSONDecoder().decode([IRType].self, from: data)
XCTAssertEqual(IR?.count, 1000)
} else {
XCTFail("No output from shell")
do {
if let output = try? shellOut(to: "\(generatorCommand) \"\(source)\"") {
let data = try XCTUnwrap(SourceKittenFramework.Structure(file: File(contents: output)).description.data(using: .utf8))
let structure = try JSONDecoder().decode(SyntaxStructure.self, from: data)

try assertTypeRegistryStructExists(on: structure)
try assertTypesArrayExistsOnRegistry(in: structure)

let actualTypes = try getTypeArrayLiteralFromRegistry(in: structure, fromCode: output)
XCTAssertEqual(actualTypes?.count, 1000)
} else {
XCTFail("No output from shell")
}
} catch {
XCTFail(error.localizedDescription)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.199969</real>
<real>0.434000</real>
<key>baselineIntegrationDisplayName</key>
<string>Local Baseline</string>
</dict>
Expand Down

0 comments on commit 2005c55

Please sign in to comment.