Sha256: 0fca31d9e78e1a1eca637b9900fa197136daf5c1721d5ab1958c9e1ca9a6fb2b

Contents?: true

Size: 668 Bytes

Versions: 7

Compression:

Stored size: 668 Bytes

Contents

# frozen_string_literal: true

module RubyMemcheck
  class RubyRunner
    attr_reader :configuration
    attr_reader :reporter

    def initialize(*args)
      @configuration =
        if !args.empty? && args[0].is_a?(Configuration)
          args.shift
        else
          RubyMemcheck.default_configuration
        end
    end

    def run(*args, **options)
      command = configuration.command(args.map { |a| Shellwords.escape(a) })

      @reporter = TestTaskReporter.new(configuration)

      @reporter.setup

      system(command, options)
      exit_code = $CHILD_STATUS.exitstatus

      @reporter.report_valgrind_errors

      exit_code
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby_memcheck-3.0.0 lib/ruby_memcheck/ruby_runner.rb
ruby_memcheck-2.3.0 lib/ruby_memcheck/ruby_runner.rb
ruby_memcheck-2.2.1 lib/ruby_memcheck/ruby_runner.rb
ruby_memcheck-2.2.0 lib/ruby_memcheck/ruby_runner.rb
ruby_memcheck-2.1.2 lib/ruby_memcheck/ruby_runner.rb
ruby_memcheck-2.1.1 lib/ruby_memcheck/ruby_runner.rb
ruby_memcheck-2.1.0 lib/ruby_memcheck/ruby_runner.rb