Sha256: b279a9bf25abac6b251120bc6be7abec06b3c8ff2c2e3fd3576a410fbe7ce50c

Contents?: true

Size: 711 Bytes

Versions: 5

Compression:

Stored size: 711 Bytes

Contents

module Mutant
  class Killer

    class Forked < self
      def initialize(killer, strategy, mutation)
        @killer = killer
        super(strategy, mutation)
      end

      def type
        @killer.type
      end

      def run
        fork do
          killer = @killer.new(strategy, mutation)
          Kernel.exit(killer.fail? ? 1 : 0)
        end

        status = Process.wait2.last
        status.exitstatus.zero?
      end
    end

    class Forking < self
      include Equalizer.new(:killer)

      attr_reader :killer

      def initialize(killer)
        @killer = killer
      end

      def new(strategy, mutation)
        Forked.new(killer, strategy, mutation)
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mutant-0.2.4 lib/mutant/killer/forking.rb
mutant-0.2.3 lib/mutant/killer/forking.rb
mutant-0.2.2 lib/mutant/killer/forking.rb
mutant-0.2.1 lib/mutant/killer/forking.rb
mutant-0.2.0 lib/mutant/killer/forking.rb