aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2012-11-10 09:36:58 +0000
committerMike McQuaid2012-11-10 13:25:32 +0000
commite4045fa7e55fb69ffad69ba19e470889684b60d7 (patch)
treeda7107d1ae14d6287cd71f78e31745bddf892599 /Library
parent2901fd393e6dda1347b832c59ba258d1112622f7 (diff)
downloadbrew-e4045fa7e55fb69ffad69ba19e470889684b60d7.tar.bz2
brew-test-bot: general cleanup.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmds/brew-test-bot.rb26
1 files changed, 18 insertions, 8 deletions
diff --git a/Library/Contributions/cmds/brew-test-bot.rb b/Library/Contributions/cmds/brew-test-bot.rb
index 29bdd5041..d5cfa1281 100755
--- a/Library/Contributions/cmds/brew-test-bot.rb
+++ b/Library/Contributions/cmds/brew-test-bot.rb
@@ -70,21 +70,29 @@ class Step
end
end
- def self.run test, command, output_on_success = false
+ def self.run test, command, puts_output = false
step = new test, command
step.puts_command
- command = "#{step.command} &>#{step.log_file_path}"
+ command = "#{step.command}"
+ unless puts_output and not ARGV.include? "--log"
+ command += " &>#{step.log_file_path}"
+ end
+
+ output = nil
if command.start_with? 'git '
- Dir.chdir step.repository { `#{command}` }
+ Dir.chdir step.repository do
+ output = `#{command}`
+ end
else
- `#{command}`
+ output = `#{command}`
end
+ output = IO.read(step.log_file_path) if ARGV.include? "--log"
step.status = $?.success? ? :passed : :failed
step.puts_result
- puts IO.read(step.log_file_path) if output_on_success
step.write_html
+ puts output if puts_output and output and not output.empty?
end
end
@@ -215,8 +223,8 @@ class Test
test "brew audit #{formula}"
test "brew install --verbose --build-bottle #{formula}"
return unless steps.last.status == :passed
- test "brew test #{formula}" if defined? Formula.factory(formula).test
test "brew bottle #{formula}", true
+ test "brew test #{formula}" if defined? Formula.factory(formula).test
test "brew uninstall #{formula}"
end
@@ -230,7 +238,9 @@ class Test
if ARGV.include? "--cleanup"
test "git fetch origin"
test "git reset --hard origin/master"
+ test "brew cleanup"
test "git clean --force -dx"
+ test "git gc"
else
unless ARGV.include? "--skip-cleanup"
git('diff --exit-code HEAD 2>/dev/null')
@@ -240,8 +250,8 @@ class Test
end
end
- def test cmd, output_on_success = false
- Step.run self, cmd, output_on_success
+ def test cmd, puts_output = false
+ Step.run self, cmd, puts_output
end
def check_results