-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Created Iurii Sorokin on 08.03.2022. | ||
// | ||
|
||
import ArgumentParser | ||
import Foundation | ||
|
||
extension Mutanus { | ||
final class Run: ParsableCommand, PathValidator, ConfigValidator { | ||
|
||
static let configuration = CommandConfiguration(abstract: "Starts Mutation testing") | ||
lazy var fileManager: MutanusFileManger = CustomFileManager() | ||
|
||
@Argument(help: "Relative or absolute path to the configuration file") | ||
var configPath: String | ||
|
||
func run() throws { | ||
|
||
let configuration = try validateConfig(atPath: configPath) | ||
|
||
Logger.logEvent(.receivedConfiguration(configuration)) | ||
|
||
try MutanusHelper( | ||
configuration: configuration, | ||
executor: Executor(configuration: configuration), | ||
fileManager: fileManager, | ||
reportCompiler: ReportCompiler(configuration: configuration) | ||
).start() | ||
} | ||
} | ||
} | ||
|
||
// MARK: - Validation | ||
extension Mutanus.Run { | ||
func validate() throws { | ||
configPath = try validatePath(configPath) | ||
} | ||
} |