Skip to content

Parallelize tests by default. #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Sources/Testing/Running/EntryPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ func configurationForSwiftPMEntryPoint(withArguments args: [String]) throws -> C
// Do not consider the executable path AKA argv[0].
let args = args.dropFirst()

// Parallelization
if args.contains("--parallel") {
configuration.isParallelizationEnabled = true
// Parallelization (on by default)
configuration.isParallelizationEnabled = true
if args.contains("--no-parallel") {
configuration.isParallelizationEnabled = false
}

#if !SWT_NO_FILE_IO
Expand Down
7 changes: 5 additions & 2 deletions Tests/TestingTests/SwiftPMTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ struct SwiftPMTests {
#expect(!CommandLine.arguments().isEmpty)
}

@Test("--parallel argument")
@Test("--parallel/--no-parallel argument")
func parallel() throws {
var configuration = try configurationForSwiftPMEntryPoint(withArguments: ["PATH"])
#expect(!configuration.isParallelizationEnabled)
#expect(configuration.isParallelizationEnabled)

configuration = try configurationForSwiftPMEntryPoint(withArguments: ["PATH", "--parallel"])
#expect(configuration.isParallelizationEnabled)

configuration = try configurationForSwiftPMEntryPoint(withArguments: ["PATH", "--no-parallel"])
#expect(!configuration.isParallelizationEnabled)
}

@Test("No --filter or --skip argument")
Expand Down