Class: Autoproj::CLI::MainTest

Inherits:
Thor
  • Object
show all
Defined in:
lib/autoproj/cli/main_test.rb

Instance Method Summary collapse

Instance Method Details

#default(on_or_off) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/autoproj/cli/main_test.rb', line 27

def default(on_or_off)
    require "autoproj/cli/test"
    report(silent: true) do
        cli = Test.new
        args = cli.validate_options([], options)
        enabled = case on_or_off
                  when "on" then true
                  when "off" then false
                  else raise ArgumentError, "expected 'on' or 'off'"
                  end
        cli.default(enabled)
    end
end

#disable(*packages) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/autoproj/cli/main_test.rb', line 56

def disable(*packages)
    require "autoproj/cli/test"
    report(silent: true) do
        cli = Test.new
        args = cli.validate_options(packages, options)
        cli.disable(*args)
    end
end

#enable(*packages) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/autoproj/cli/main_test.rb', line 44

def enable(*packages)
    require "autoproj/cli/test"
    report(silent: true) do
        cli = Test.new
        args = cli.validate_options(packages, options)
        cli.enable(*args)
    end
end

#exec(*packages) ⇒ Object



95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/autoproj/cli/main_test.rb', line 95

def exec(*packages)
    require "autoproj/cli/test"
    options = self.options.merge(parent_options)
    report do |extra_options|
        cli = Test.new
        Autobuild.pass_test_errors = options.delete(:fail)
        Autobuild.ignore_errors = options.delete(:keep_going)
        Autobuild::TestUtility.coverage_enabled = options.delete(:coverage)
        options.delete(:tool)
        args = cli.validate_options(packages, options.merge(extra_options))
        cli.run(*args)
    end
end

#list(*packages) ⇒ Object



68
69
70
71
72
73
74
75
# File 'lib/autoproj/cli/main_test.rb', line 68

def list(*packages)
    require "autoproj/cli/test"
    report(silent: true) do
        cli = Test.new
        args = cli.validate_options(packages, options)
        cli.list(*args)
    end
end