-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update xUnit to display output on failures (XCTest only)
For XCTest, the generated xUnit XML file is not helpful when tests fail as it contains the message "failure", which is redundant with the test results. Update the XML output to dipslay the result output instead of static "failure" message.
- Loading branch information
Showing
19 changed files
with
441 additions
and
9 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
Fixtures/Miscellaneous/TestMultipleFailureSwiftTesting/.gitignore
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,8 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc |
24 changes: 24 additions & 0 deletions
24
Fixtures/Miscellaneous/TestMultipleFailureSwiftTesting/Package.swift
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,24 @@ | ||
// swift-tools-version: 6.0 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "TestMultipleFailureSwiftTesting", | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "TestMultipleFailureSwiftTesting", | ||
targets: ["TestMultipleFailureSwiftTesting"]), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "TestMultipleFailureSwiftTesting"), | ||
.testTarget( | ||
name: "TestMultipleFailureSwiftTestingTests", | ||
dependencies: ["TestMultipleFailureSwiftTesting"] | ||
), | ||
] | ||
) |
2 changes: 2 additions & 0 deletions
2
...wiftTesting/Sources/TestMultipleFailureSwiftTesting/TestMultipleFailureSwiftTesting.swift
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,2 @@ | ||
// The Swift Programming Language | ||
// https://docs.swift.org/swift-book |
42 changes: 42 additions & 0 deletions
42
...ing/Tests/TestMultipleFailureSwiftTestingTests/TestMultipleFailureSwiftTestingTests.swift
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,42 @@ | ||
import Testing | ||
@testable import TestMultipleFailureSwiftTesting | ||
|
||
@Test func testFailure1() async throws { | ||
#expect(Bool(false), "ST Test failure 1") | ||
} | ||
|
||
@Test func testFailure2() async throws { | ||
#expect(Bool(false), "ST Test failure 2") | ||
} | ||
|
||
@Test func testFailure3() async throws { | ||
#expect(Bool(false), "ST Test failure 3") | ||
} | ||
|
||
@Test func testFailure4() async throws { | ||
#expect(Bool(false), "ST Test failure 4") | ||
} | ||
|
||
@Test func testFailure5() async throws { | ||
#expect(Bool(false), "ST Test failure 5") | ||
} | ||
|
||
@Test func testFailure6() async throws { | ||
#expect(Bool(false), "ST Test failure 6") | ||
} | ||
|
||
@Test func testFailure7() async throws { | ||
#expect(Bool(false), "ST Test failure 7") | ||
} | ||
|
||
@Test func testFailure8() async throws { | ||
#expect(Bool(false), "ST Test failure 8") | ||
} | ||
|
||
@Test func testFailure9() async throws { | ||
#expect(Bool(false), "ST Test failure 9") | ||
} | ||
|
||
@Test func testFailure10() async throws { | ||
#expect(Bool(false), "ST Test failure 10") | ||
} |
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,8 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc |
24 changes: 24 additions & 0 deletions
24
Fixtures/Miscellaneous/TestMultipleFailureXCTest/Package.swift
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,24 @@ | ||
// swift-tools-version: 6.0 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "TestMultipleFailureXCTest", | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "TestMultipleFailureXCTest", | ||
targets: ["TestMultipleFailureXCTest"]), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "TestMultipleFailureXCTest"), | ||
.testTarget( | ||
name: "TestMultipleFailureXCTestTests", | ||
dependencies: ["TestMultipleFailureXCTest"] | ||
), | ||
] | ||
) |
2 changes: 2 additions & 0 deletions
2
...stMultipleFailureXCTest/Sources/TestMultipleFailureXCTest/TestMultipleFailureXCTest.swift
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,2 @@ | ||
// The Swift Programming Language | ||
// https://docs.swift.org/swift-book |
45 changes: 45 additions & 0 deletions
45
...leFailureXCTest/Tests/TestMultipleFailureXCTestTests/TestMultipleFailureXCTestTests.swift
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,45 @@ | ||
import XCTest | ||
@testable import TestMultipleFailureXCTest | ||
|
||
final class TestMultipleFailureXCTestTests: XCTestCase { | ||
func testFailure1() throws { | ||
XCTAssertFalse(true, "Test failure 1") | ||
} | ||
|
||
func testFailure2() throws { | ||
XCTAssertFalse(true, "Test failure 2") | ||
} | ||
|
||
func testFailure3() throws { | ||
XCTAssertFalse(true, "Test failure 3") | ||
} | ||
|
||
func testFailure4() throws { | ||
XCTAssertFalse(true, "Test failure 4") | ||
} | ||
|
||
func testFailure5() throws { | ||
XCTAssertFalse(true, "Test failure 5") | ||
} | ||
|
||
func testFailure6() throws { | ||
XCTAssertFalse(true, "Test failure 6") | ||
} | ||
|
||
func testFailure7() throws { | ||
XCTAssertFalse(true, "Test failure 7") | ||
} | ||
|
||
func testFailure8() throws { | ||
XCTAssertFalse(true, "Test failure 8") | ||
} | ||
|
||
func testFailure9() throws { | ||
XCTAssertFalse(true, "Test failure 9") | ||
} | ||
|
||
func testFailure10() throws { | ||
XCTAssertFalse(true, "Test failure 10") | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
Fixtures/Miscellaneous/TestSingleFailureSwiftTesting/.gitignore
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,9 @@ | ||
.DS_Store | ||
/.build | ||
/.index-build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc |
24 changes: 24 additions & 0 deletions
24
Fixtures/Miscellaneous/TestSingleFailureSwiftTesting/Package.swift
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,24 @@ | ||
// swift-tools-version: 5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "TestFailuresSwiftTesting", | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "TestFailuresSwiftTesting", | ||
targets: ["TestFailuresSwiftTesting"]) | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "TestFailuresSwiftTesting"), | ||
.testTarget( | ||
name: "TestFailuresSwiftTestingTests", | ||
dependencies: ["TestFailuresSwiftTesting"] | ||
) | ||
] | ||
) |
2 changes: 2 additions & 0 deletions
2
...SingleFailureSwiftTesting/Sources/TestFailuresSwiftTesting/TestFailuresSwiftTesting.swift
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,2 @@ | ||
// The Swift Programming Language | ||
// https://docs.swift.org/swift-book |
6 changes: 6 additions & 0 deletions
6
...ilureSwiftTesting/Tests/TestFailuresSwiftTestingTests/TestFailuresSwiftTestingTests.swift
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,6 @@ | ||
import Testing | ||
@testable import TestFailuresSwiftTesting | ||
|
||
@Test func example() async throws { | ||
#expect(Bool(false), "Purposely failing & validating XML espace \"'<>") | ||
} |
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,9 @@ | ||
.DS_Store | ||
/.build | ||
/.index-build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc |
24 changes: 24 additions & 0 deletions
24
Fixtures/Miscellaneous/TestSingleFailureXCTest/Package.swift
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,24 @@ | ||
// swift-tools-version: 5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "TestFailures", | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "TestFailures", | ||
targets: ["TestFailures"]) | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "TestFailures"), | ||
.testTarget( | ||
name: "TestFailuresTests", | ||
dependencies: ["TestFailures"] | ||
) | ||
] | ||
) |
2 changes: 2 additions & 0 deletions
2
Fixtures/Miscellaneous/TestSingleFailureXCTest/Sources/TestFailures/TestFailures.swift
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,2 @@ | ||
// The Swift Programming Language | ||
// https://docs.swift.org/swift-book |
9 changes: 9 additions & 0 deletions
9
...res/Miscellaneous/TestSingleFailureXCTest/Tests/TestFailuresTests/TestFailuresTests.swift
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,9 @@ | ||
import XCTest | ||
@testable import TestFailures | ||
|
||
final class TestFailuresTests: XCTestCase { | ||
func testExample() throws { | ||
XCTAssertFalse(true, "Purposely failing & validating XML espace \"'<>") | ||
} | ||
} | ||
|
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
Oops, something went wrong.