aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/test.rb
diff options
context:
space:
mode:
authorAndrew Janke2016-04-10 22:53:56 -0400
committerAndrew Janke2016-04-18 12:23:08 -0400
commitacc9a7ca8554bc2413dee2d6d0f407b3a59c628c (patch)
tree4fb68e17149a73d9d123d9538e2d5fdccdd0ffd9 /Library/Homebrew/cmd/test.rb
parent0e8140b012181413438002b65290c84284721694 (diff)
downloadbrew-acc9a7ca8554bc2413dee2d6d0f407b3a59c628c.tar.bz2
brew test, install, update-test: add --keep-tmp option
Also enables sandbox for --interactive and --debug use of install and test, using automatic retention. Closes #66. Signed-off-by: Andrew Janke <andrew@apjanke.net>
Diffstat (limited to 'Library/Homebrew/cmd/test.rb')
-rw-r--r--Library/Homebrew/cmd/test.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/test.rb b/Library/Homebrew/cmd/test.rb
index ffb9c169d..0218e1c80 100644
--- a/Library/Homebrew/cmd/test.rb
+++ b/Library/Homebrew/cmd/test.rb
@@ -1,4 +1,4 @@
-#: * `test` [`--devel`|`--HEAD`] [`--debug`] <formula>:
+#: * `test` [`--devel`|`--HEAD`] [`--debug`] [`--keep-tmp`] <formula>:
#: A few formulae provide a test method. `brew test` <formula> runs this
#: test method. There is no standard output or return code, but it should
#: generally indicate to the user if something is wrong with the installed
@@ -10,6 +10,9 @@
#: If `--debug` is passed and the test fails, an interactive debugger will be
#: launched with access to IRB or a shell inside the temporary test directory.
#:
+#: If `--keep-tmp` is passed, the temporary files created for the test are
+#: not deleted.
+#:
#: Example: `brew install jruby && brew test jruby`
require "extend/ENV"
@@ -55,15 +58,11 @@ module Homebrew
end
if Sandbox.available? && !ARGV.no_sandbox?
- if Sandbox.auto_disable?
- Sandbox.print_autodisable_warning
- else
- Sandbox.print_sandbox_message
- end
+ Sandbox.print_sandbox_message
end
Utils.safe_fork do
- if Sandbox.available? && !ARGV.no_sandbox? && !Sandbox.auto_disable?
+ if Sandbox.available? && !ARGV.no_sandbox?
sandbox = Sandbox.new
f.logs.mkpath
sandbox.record_log(f.logs/"sandbox.test.log")