Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/allegro/swift-junit

A Swift library for creating JUnit XML test results that can be interpreted by tools such as Bamboo or Jenkins. Macos and Linux ready.
https://github.com/allegro/swift-junit

junit junit-report junit-xml server-side-swift swift xctest xctest-linux xml

Last synced: about 2 months ago
JSON representation

A Swift library for creating JUnit XML test results that can be interpreted by tools such as Bamboo or Jenkins. Macos and Linux ready.

Awesome Lists containing this project

README

        

# Swift Test Reporter

[![CI](https://github.com/allegro/swift-junit/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/allegro/swift-junit/actions/workflows/ci.yml)

A Swift library for creating JUnit XML test results that can be interpreted by tools such as Bamboo or Jenkins.

Sample output:

```









```

# How to use it?
## Linux
Add ``SwiftTestReporter`` to ``Package.swift``:

```
import PackageDescription

let package = Package(
dependencies: [
...
.package(url: "https://github.com/allegro/swift-junit.git", from: "2.0.0"),
// or for Swift 4.x
// .package(url: "https://github.com/allegro/swift-junit.git", from: .upToNextMajor(from: "1.0.0")),

]
...
targets: [
...
.testTarget(
name: "AppTests",
dependencies: [
"App",
"SwiftTestReporter"
]
),
]
)
```

Next, add:
```
import SwiftTestReporter

_ = TestObserver()
```
To ``LinuxMain.swift``. Done.

## XCode
In ``Project Navigator``, select particular project:

![test](doc/intro-mac-1.png)

Next, select test target:

![test](doc/intro-mac-2.png)

Add a new property named ``Principal class`` and set it to ``SwiftTestReporter.TestObserver``

![test](doc/intro-mac-3.png)