Skip to content

Commit 1024243

Browse files
committed
Adds RxTest only if TEST=1 environmental variable is set.
1 parent 5004c6c commit 1024243

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Package.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import PackageDescription
2+
import Foundation
23

34
let buildTests = false
5+
let RxTestIsTarget = buildTests || ProcessInfo.processInfo.environment["TEST"] == "1"
46

57
#if os(Linux)
68
let rxCocoaDependencies: [Target.Dependency] = [
@@ -26,14 +28,15 @@ let library = [
2628
Target(
2729
name: "RxCocoa",
2830
dependencies: rxCocoaDependencies
29-
),
31+
)
32+
] + (RxTestIsTarget ? [
3033
Target(
3134
name: "RxTest",
3235
dependencies: [
3336
.Target(name: "RxSwift")
3437
]
3538
),
36-
]
39+
] : [])
3740

3841
#if os(Linux)
3942
let cocoaRuntime: [Target] = []
@@ -60,7 +63,7 @@ let tests: [Target] = (buildTests ? [
6063
)
6164
] : [])
6265

63-
let testExcludes: [String] = (!buildTests ? ["Sources/AllTestz"] : [])
66+
let testExcludes: [String] = (buildTests ? [] : ["Sources/AllTestz"]) + (RxTestIsTarget ? [] : ["Sources/RxTest"])
6467

6568
#if os(Linux)
6669

0 commit comments

Comments
 (0)