Merge pull request #6917 from GauthamGoli/test-args-fix
Reuse `test_args` and `postinstall_args` methods
This commit is contained in:
commit
d837734a89
@ -7,17 +7,10 @@ require "debrew"
|
|||||||
require "fcntl"
|
require "fcntl"
|
||||||
require "socket"
|
require "socket"
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
|
require "cmd/postinstall"
|
||||||
def postinstall_args
|
|
||||||
Homebrew::CLI::Parser.new do
|
|
||||||
switch :force
|
|
||||||
switch :verbose
|
|
||||||
switch :debug
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
postinstall_args.parse
|
Homebrew.postinstall_args.parse
|
||||||
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
|
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
|
||||||
error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
||||||
|
|
||||||
|
@ -10,19 +10,12 @@ require "formula_assertions"
|
|||||||
require "fcntl"
|
require "fcntl"
|
||||||
require "socket"
|
require "socket"
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
|
require "dev-cmd/test"
|
||||||
def test_args
|
|
||||||
Homebrew::CLI::Parser.new do
|
|
||||||
switch :force
|
|
||||||
switch :verbose
|
|
||||||
switch :debug
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
TEST_TIMEOUT_SECONDS = 5 * 60
|
TEST_TIMEOUT_SECONDS = 5 * 60
|
||||||
|
|
||||||
begin
|
begin
|
||||||
test_args.parse
|
Homebrew.test_args.parse
|
||||||
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
|
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
|
||||||
error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user