Class Uttk::Strategies::Bootstrap
In: lib/uttk/strategies/Bootstrap.rb
Parent: Strategy

Run the bootstrap(.sh)? script or a classic autoreconf. This strategy is used by the Package strategy in case of the tested package does use the autotools or not.

Methods

Included Modules

Concrete

Constants

BOOTSTRAP = /bootstrap(\.sh)?/
AUTORECONF = 'autoreconf -fvi'

Public Class methods

[Source]

# File lib/uttk/strategies/Bootstrap.rb, line 71
      def self.have_bootstrap? ( dir=Pathname.new('.') )
        res = dir.entries.find { |ent| ent.to_s =~ BOOTSTRAP }
        (res.nil?) ? nil : dir + res
      end

Public Instance methods

[Source]

# File lib/uttk/strategies/Bootstrap.rb, line 66
      def dir= ( dir )
        @dir = Pathname.new(dir)
      end

Protected Instance methods

[Source]

# File lib/uttk/strategies/Bootstrap.rb, line 52
      def abort_hook
        @runner.abort @my_data if @runner and defined? @my_data
        super
      end

[Source]

# File lib/uttk/strategies/Bootstrap.rb, line 44
      def assertion
        assert_cmd UM::StreamMatcher, @my_data,
                   :exit => 0, :error => nil, :output => nil
        pass
      end

[Source]

# File lib/uttk/strategies/Bootstrap.rb, line 59
      def epilogue
        @my_data.clean if defined? @my_data
        super
      end

[Source]

# File lib/uttk/strategies/Bootstrap.rb, line 20
      def prologue
        super
        @runner = mk_system_runner
        cmd = self.class.have_bootstrap? @dir
        if cmd.nil? and Configure.have_configure_input? @dir
          cmd = AUTORECONF
        end
        if cmd.nil? or Configure.have_configure? @dir
          @bootstrap = nil
        else
          @bootstrap = cmd.to_ocmd
          @bootstrap.dir = @dir
        end
      end

[Source]

# File lib/uttk/strategies/Bootstrap.rb, line 37
      def run_impl
        skip_pass if @bootstrap.nil?
        @my_data = @bootstrap.run @runner
      end

[Validate]