File tree Expand file tree Collapse file tree 8 files changed +82
-0
lines changed
Expand file tree Collapse file tree 8 files changed +82
-0
lines changed Original file line number Diff line number Diff line change 1+ .DS_Store
2+ /.build
3+ /Packages
4+ /* .xcodeproj
Original file line number Diff line number Diff line change 1+ // swift-tools-version:4.2
2+
3+ import PackageDescription
4+
5+ let package = Package (
6+ name: " foo " ,
7+ products: [
8+ . library(
9+ name: " foo " ,
10+ targets: [ " foo " ] ) ,
11+ ] ,
12+ targets: [
13+ . target(
14+ name: " foo " ,
15+ dependencies: [ ] ) ,
16+ . testTarget(
17+ name: " fooTests " ,
18+ dependencies: [ " foo " ] ) ,
19+ ]
20+ )
Original file line number Diff line number Diff line change 1+ # foo
2+
3+ A description of this package.
Original file line number Diff line number Diff line change 1+ public struct foo {
2+ public var text = " Hello, World! "
3+
4+ public init ( ) { }
5+ }
Original file line number Diff line number Diff line change 1+ import XCTest
2+
3+ import fooTests
4+
5+ var tests = [ XCTestCaseEntry] ( )
6+ tests += fooTests. allTests ( )
7+ XCTMain ( tests)
Original file line number Diff line number Diff line change 1+ import XCTest
2+
3+ #if !os(macOS)
4+ public func allTests( ) -> [ XCTestCaseEntry ] {
5+ return [
6+ testCase ( fooTests. allTests) ,
7+ ]
8+ }
9+ #endif
Original file line number Diff line number Diff line change 1+ import XCTest
2+ import foo
3+
4+ final class fooTests : XCTestCase {
5+ func testExample( ) {
6+ // This is an example of a functional test case.
7+ // Use XCTAssert and related functions to verify your tests produce the correct
8+ // results.
9+ XCTAssertEqual ( foo ( ) . text, " Hello, World! " )
10+ }
11+
12+ static var allTests = [
13+ ( " testExample " , testExample) ,
14+ ]
15+ }
Original file line number Diff line number Diff line change 1+ // Sanity check for SwiftPM's code coverage support.
2+ //
3+ // Make a sandbox dir.
4+ // RUN: rm -rf %t.dir
5+ // RUN: mkdir -p %t.dir
6+ // RUN: cp -r %S/foo %t.dir/
7+ // RUN: %{swift-test} --package-path %t.dir/foo --enable-code-coverage -v 2>&1 | tee %t.build-log
8+ //
9+ // Check the build log.
10+ //
11+ // RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
12+ //
13+ // CHECK-BUILD-LOG: 'fooTests' passed
14+ //
15+ // Check the exported codecov file.
16+ //
17+ // RUN: %{FileCheck} --check-prefix CHECK-CODECOV-JSON --input-file %t.dir/foo/.build/debug/codecov/foo.json %s
18+ //
19+ // CHECK-CODECOV-JSON: llvm.coverage.json.export
You can’t perform that action at this time.
0 commit comments