Skip to content
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

Hk cluster run #76

Merged
merged 13 commits into from
Dec 16, 2019
Next Next commit
Introduce run class
hanneskaeufler committed Dec 15, 2019
commit 9bf26938e1330be0a90a6b89ca4a3ee506e6d2d7
14 changes: 14 additions & 0 deletions spec/runner/run_spec.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "../../src/crytic/runner/run"
require "../spec_helper"

describe Crytic::Runner::Run do
it "is just another wrapper for options" do
opts = Opts.new(99.0, [] of Crytic::Reporter::Reporter, [] of String, [] of Crytic::Subject)

Crytic::Runner::Run.from_options(opts).msi_threshold.should eq 99.0
end
end

# Must have the same implicit interface as CliOptions
private record Opts, msi_threshold : Float64, reporters : Array(Crytic::Reporter::Reporter), spec_files : Array(String), subject : Array(Crytic::Subject) do
end
10 changes: 10 additions & 0 deletions src/crytic/runner/run.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require "../reporter/reporter"
require "../subject"

module Crytic::Runner
record Run, msi_threshold : Float64, reporters : Array(Crytic::Reporter::Reporter), spec_files : Array(String), subject : Array(Subject) do
def self.from_options(options)
new(options.msi_threshold, options.reporters, options.spec_files, options.subject)
end
end
end