Skip to content

Commit

Permalink
Setting the locale for tests didn't help to decimal point. Changed th…
Browse files Browse the repository at this point in the history
…e tests now until having time what the issue is here.
  • Loading branch information
Alex da Franca committed Jul 30, 2024
1 parent ed0606e commit cc69b64
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 10 deletions.
72 changes: 72 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/XcresultparserLib.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XcresultparserLib"
BuildableName = "XcresultparserLib"
BlueprintName = "XcresultparserLib"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:Tests/XcresultparserLib.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "XcresultparserLib"
BuildableName = "XcresultparserLib"
BlueprintName = "XcresultparserLib"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
23 changes: 23 additions & 0 deletions Tests/XcresultparserLib.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"configurations" : [
{
"id" : "E1E08303-EEF4-40FA-AEB1-1293563FB435",
"name" : "Test Scheme Action",
"options" : {

}
}
],
"defaultOptions" : {
"language" : "en",
"locationScenario" : {
"identifier" : "New York, NY, USA",
"referenceType" : "built-in"
},
"region" : "US"
},
"testTargets" : [

],
"version" : 1
}
21 changes: 11 additions & 10 deletions Tests/XcresultparserTests/XcresultparserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,20 @@ final class XcresultparserTests: XCTestCase {
return
}
XCTAssertEqual("", resultParser.documentPrefix(title: "XCResults"))

let expectedSummary = "Errors: 0; Warnings: 3; Analizer Warnings: 0; Tests: 7; Failed: 1; Skipped: 0"
XCTAssertEqual(expectedSummary, resultParser.summary)
XCTAssertEqual("\n---------------------\n", resultParser.divider)

XCTAssertTrue(resultParser.testDetails.starts(
with: "\n\n### XcresultparserTests.xctest (4.3274)\n### XcresultparserTests (4.3269)\n* <span"
))

XCTAssertTrue(resultParser.coverageDetails.starts(
with: "\nTotal coverage: 49.2% (1530/3108)\nXcresultparserLib: 46.2% (672/1454)" +
"\n## CLIResultFormatter.swift: 61.9% (39/63)"
))

let lines = resultParser.testDetails.components(separatedBy: .newlines)
XCTAssertTrue(lines[2].starts(with: "### XcresultparserTests.xctest"))
XCTAssertTrue(lines[3].starts(with: "### XcresultparserTests"))
XCTAssertTrue(lines[4].starts(with: "* <span"))

let cLines = resultParser.coverageDetails.components(separatedBy: .newlines)
XCTAssertTrue(cLines[1].starts(with: "Total coverage:"))
XCTAssertTrue(cLines[2].starts(with: "XcresultparserLib:"))
XCTAssertTrue(cLines[3].starts(with: "## CLIResultFormatter.swift:"))

XCTAssertEqual("", resultParser.documentSuffix)
}
Expand Down

0 comments on commit cc69b64

Please sign in to comment.