Class: MutationTester::BatchRunner::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/mutation_tester/batch_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#interruptedObject

Returns the value of attribute interrupted

Returns:

  • (Object)

    the current value of interrupted



37
38
39
# File 'lib/mutation_tester/batch_runner.rb', line 37

def interrupted
  @interrupted
end

#processedObject

Returns the value of attribute processed

Returns:

  • (Object)

    the current value of processed



37
38
39
# File 'lib/mutation_tester/batch_runner.rb', line 37

def processed
  @processed
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



37
38
39
# File 'lib/mutation_tester/batch_runner.rb', line 37

def skipped
  @skipped
end

#unchangedObject

Returns the value of attribute unchanged

Returns:

  • (Object)

    the current value of unchanged



37
38
39
# File 'lib/mutation_tester/batch_runner.rb', line 37

def unchanged
  @unchanged
end

Instance Method Details

#gate_passed?Boolean

Returns:

  • (Boolean)


66
67
68
69
70
71
72
# File 'lib/mutation_tester/batch_runner.rb', line 66

def gate_passed?
  return false unless matched_any?
  return false if nothing_measured?
  return true if processed.empty?

  success?
end

#interrupted?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/mutation_tester/batch_runner.rb', line 74

def interrupted?
  !!interrupted
end

#matched_any?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/mutation_tester/batch_runner.rb', line 58

def matched_any?
  !(processed.empty? && skipped.empty? && (unchanged || []).empty?)
end

#nothing_measured?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/mutation_tester/batch_runner.rb', line 62

def nothing_measured?
  processed.empty? && !skipped.empty?
end

#success?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/mutation_tester/batch_runner.rb', line 38

def success?
  processed.all?(&:passed?)
end

#survivorsObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/mutation_tester/batch_runner.rb', line 42

def survivors
  processed.flat_map do |entry|
    (entry.results || [])
      .select { |r| Reporters::BaseReporter.status_for(r) == :survived }
      .map do |r|
        {
          file: entry.source_file,
          line: r[:line],
          type: r[:type],
          original: r[:original],
          mutated: r[:mutated]
        }
      end
  end
end