Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
5cbab370
Commit
5cbab370
authored
15 years ago
by
Adam Vandenberg
Browse files
Options
Downloads
Patches
Plain Diff
Switch test_bucket over to use testing_env.
parent
e4766639
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Library/Homebrew/test/test_bucket.rb
+37
-0
37 additions, 0 deletions
Library/Homebrew/test/test_bucket.rb
Library/Homebrew/test/tests
+9
-21
9 additions, 21 deletions
Library/Homebrew/test/tests
Library/Homebrew/test/unittest.rb
+0
-96
0 additions, 96 deletions
Library/Homebrew/test/unittest.rb
with
46 additions
and
117 deletions
Library/Homebrew/test/test_bucket.rb
+
37
−
0
View file @
5cbab370
require
'testing_env'
require
'extend/ARGV'
# needs to be after test/unit to avoid conflict with OptionsParser
ARGV
.
extend
(
HomebrewArgvExtension
)
require
'test/testball'
require
'utils'
require
'brew.h'
class
MockFormula
<
Formula
def
initialize
url
@url
=
url
@homepage
=
'http://example.com/'
super
'test'
end
end
class
MostlyAbstractFormula
<
Formula
@url
=
''
@homepage
=
'http://example.com/'
end
class
TestZip
<
Formula
def
initialize
zip
=
HOMEBREW_CACHE
.
parent
+
'test-0.1.zip'
Kernel
.
system
'/usr/bin/zip'
,
'-0'
,
zip
,
ABS__FILE__
@url
=
"file://
#{
zip
}
"
@homepage
=
'http://example.com/'
super
'testzip'
end
end
class
TestBallOverrideBrew
<
Formula
def
initialize
super
"foo"
end
def
brew
end
end
# All other tests so far -- feel free to break them out into
# separate TestCase classes.
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/tests
+
9
−
21
View file @
5cbab370
...
...
@@ -5,36 +5,24 @@
# Note: "formula_test" is omitted; these aren't unit tests but sanity checks
# on the real formulae.
#
# Run as:
# ./tests -- --skip-update
# to omit the update tests which only seem to work for mxcl
#
#
Bulk of the tests
ruby
unittes
t.rb
$*
#
Feel free to split out test_bucket
ruby
test_bucke
t.rb
$*
ruby test_versions.rb
$*
ruby test_checksums.rb
$*
ruby test_inreplace.rb
$*
# Test hardware sniffers
ruby test_hardware.rb
$*
# Test formula installs
ruby test_formula_install.rb
$*
# Update tests (only seem to work for mxcl)
ruby test_updater.rb
$*
# Patching tests
ruby test_patching.rb
$*
# External dependency tests
ruby test_external_deps.rb
$*
# Test Pathname.install
ruby test_pathname_install.rb
$*
# Test utility functions
ruby test_utils.rb
$*
# Test ARGV extensions
ruby test_ARGV.rb
$*
# Update tests (only seem to work for mxcl)
ruby test_updater.rb
$*
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/unittest.rb
deleted
100755 → 0
+
0
−
96
View file @
e4766639
#!/usr/bin/ruby
# This software is in the public domain, furnished "as is", without technical
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
ABS__FILE__
=
File
.
expand_path
(
__FILE__
)
$:
.
push
(
File
.
expand_path
(
__FILE__
+
'/../..'
))
require
'extend/pathname'
# these are defined in global.rb, but we don't want to break our actual
# homebrew tree, and we do want to test everything :)
HOMEBREW_PREFIX
=
Pathname
.
new
'/private/tmp/testbrew/prefix'
HOMEBREW_REPOSITORY
=
HOMEBREW_PREFIX
HOMEBREW_CACHE
=
HOMEBREW_PREFIX
.
parent
+
"cache"
HOMEBREW_CELLAR
=
HOMEBREW_PREFIX
.
parent
+
"cellar"
HOMEBREW_USER_AGENT
=
"Homebrew"
HOMEBREW_WWW
=
'http://example.com'
MACOS_VERSION
=
10.6
(
HOMEBREW_PREFIX
+
'Library'
+
'Formula'
).
mkpath
Dir
.
chdir
HOMEBREW_PREFIX
at_exit
{
HOMEBREW_PREFIX
.
parent
.
rmtree
}
require
'utils'
require
'formula'
require
'keg'
require
'brew.h'
# for some reason our utils.rb safe_system behaves completely differently
# during these tests. This is worrying for sure.
def
safe_system
*
args
Kernel
.
system
*
args
end
class
ExecutionError
<
RuntimeError
attr
:status
def
initialize
cmd
,
args
=
[],
status
=
nil
super
"Failure while executing:
#{
cmd
}
#{
args
*
' '
}
"
@status
=
status
end
end
class
BuildError
<
ExecutionError
;
end
require
'test/unit'
# must be after at_exit
require
'extend/ARGV'
# needs to be after test/unit to avoid conflict with OptionsParser
ARGV
.
extend
(
HomebrewArgvExtension
)
class
MockFormula
<
Formula
def
initialize
url
@url
=
url
@homepage
=
'http://example.com/'
super
'test'
end
end
class
MostlyAbstractFormula
<
Formula
@url
=
''
@homepage
=
'http://example.com/'
end
class
TestBall
<
Formula
# name parameter required for some Formula::factory
def
initialize
name
=
nil
@url
=
"file:///
#{
Pathname
.
new
(
ABS__FILE__
).
parent
.
realpath
}
/testball-0.1.tbz"
@homepage
=
'http://example.com/'
super
"testball"
end
def
install
prefix
.
install
"bin"
prefix
.
install
"libexec"
end
end
class
TestZip
<
Formula
def
initialize
zip
=
HOMEBREW_CACHE
.
parent
+
'test-0.1.zip'
Kernel
.
system
'/usr/bin/zip'
,
'-0'
,
zip
,
ABS__FILE__
@url
=
"file://
#{
zip
}
"
@homepage
=
'http://example.com/'
super
'testzip'
end
end
class
TestBallOverrideBrew
<
Formula
def
initialize
super
"foo"
end
def
brew
end
end
require
'test/test_bucket'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment