Skip to content

Commit

Permalink
Вынес шаг Run
Browse files Browse the repository at this point in the history
  • Loading branch information
SoriUR committed Jul 30, 2022
1 parent 9f13954 commit aa1bb84
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Sources/Mutanus/Commands/Mutanus+Run.swift
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)
}
}

0 comments on commit aa1bb84

Please sign in to comment.