Skip to content

Commit 86eeb54

Browse files
author
Max Moiseev
committed
Introduce .skip tag and properly handle --skip-tags parameter
1 parent 68cdba2 commit 86eeb54

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

benchmark/utils/DriverUtils.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct TestConfig {
111111
var tags = Set<BenchmarkCategory>()
112112

113113
/// Tests tagged with any of these will not be executed
114-
var skipTags: Set<BenchmarkCategory> = [.unstable, .String]
114+
var skipTags: Set<BenchmarkCategory> = [.unstable, .skip]
115115

116116
/// The scalar multiple of the amount of times a test should be run. This
117117
/// enables one to cause tests to run for N iterations longer than they
@@ -194,7 +194,9 @@ struct TestConfig {
194194
}
195195

196196
if let x = benchArgs.optionalArgsMap["--skip-tags"] {
197-
if x.isEmpty { return .fail("--skip-tags requires a value") }
197+
// if the --skip-tags parameter is specified, we need to ignore the
198+
// default and start from a clean slate.
199+
skipTags = []
198200

199201
// We support specifying multiple tags by splitting on comma, i.e.:
200202
//

benchmark/utils/TestsUtils.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public enum BenchmarkCategory : String {
6565
// reimplementing or call into code paths that have known opportunities for
6666
// significant optimization.
6767
case cpubench
68+
69+
// Explict skip marker
70+
case skip
6871
}
6972

7073
public struct BenchmarkInfo {

0 commit comments

Comments
 (0)