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
356c391d
Commit
356c391d
authored
10 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Rewrite fails_with tests as tests for CompilerFailure
parent
329e357d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/test/test_compiler_failure.rb
+52
-0
52 additions, 0 deletions
Library/Homebrew/test/test_compiler_failure.rb
Library/Homebrew/test/test_fails_with.rb
+0
-66
0 additions, 66 deletions
Library/Homebrew/test/test_fails_with.rb
with
52 additions
and
66 deletions
Library/Homebrew/test/test_compiler_failure.rb
0 → 100644
+
52
−
0
View file @
356c391d
require
"testing_env"
require
"compilers"
class
CompilerFailureTests
<
Homebrew
::
TestCase
Compiler
=
Struct
.
new
(
:name
,
:version
)
def
assert_fails_with
(
compiler
,
failure
)
assert_operator
failure
,
:===
,
compiler
end
def
refute_fails_with
(
compiler
,
failure
)
refute_operator
failure
,
:===
,
compiler
end
def
compiler
(
name
,
version
)
Compiler
.
new
(
name
,
version
)
end
def
create
(
spec
,
&
block
)
CompilerFailure
.
create
(
spec
,
&
block
)
end
def
test_create_with_symbol
failure
=
create
(
:clang
)
assert_fails_with
compiler
(
:clang
,
425
),
failure
end
def
test_create_with_block
failure
=
create
(
:clang
)
{
build
211
}
assert_fails_with
compiler
(
:clang
,
210
),
failure
refute_fails_with
compiler
(
:clang
,
318
),
failure
end
def
test_create_with_block_without_build
failure
=
create
(
:clang
)
{
}
assert_fails_with
compiler
(
:clang
,
425
),
failure
end
def
test_create_with_hash
failure
=
create
(
:gcc
=>
"4.8"
)
assert_fails_with
compiler
(
"gcc-4.8"
,
"4.8"
),
failure
assert_fails_with
compiler
(
"gcc-4.8"
,
"4.8.1"
),
failure
refute_fails_with
compiler
(
"gcc-4.7"
,
"4.7"
),
failure
end
def
test_create_with_hash_and_version
failure
=
create
(
:gcc
=>
"4.8"
)
{
version
"4.8.1"
}
assert_fails_with
compiler
(
"gcc-4.8"
,
"4.8"
),
failure
assert_fails_with
compiler
(
"gcc-4.8"
,
"4.8.1"
),
failure
refute_fails_with
compiler
(
"gcc-4.8"
,
"4.8.2"
),
failure
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/test_fails_with.rb
deleted
100644 → 0
+
0
−
66
View file @
329e357d
require
'testing_env'
require
'software_spec'
class
FailsWithTests
<
Homebrew
::
TestCase
def
assert_fails_with
(
cc
)
assert
@spec
.
fails_with?
(
cc
)
end
def
refute_fails_with
(
cc
)
refute
@spec
.
fails_with?
(
cc
)
end
def
fails_with
(
*
args
,
&
block
)
@spec
.
fails_with
(
*
args
,
&
block
)
end
def
build_cc
(
name
,
version
)
Compiler
.
new
(
name
,
version
)
end
def
setup
@spec
=
SoftwareSpec
.
new
end
def
test_fails_with_symbol
fails_with
:clang
cc
=
build_cc
(
:clang
,
425
)
assert_fails_with
cc
end
def
test_fails_with_build
fails_with
(
:clang
)
{
build
211
}
cc
=
build_cc
(
:clang
,
318
)
refute_fails_with
cc
end
def
test_fails_with_block_without_build
fails_with
(
:clang
)
cc
=
build_cc
(
:clang
,
425
)
assert_fails_with
cc
end
def
test_non_apple_gcc_version
fails_with
(
:gcc
=>
'4.8'
)
assert_fails_with
build_cc
(
"gcc-4.8"
,
"4.8"
)
assert_fails_with
build_cc
(
"gcc-4.8"
,
"4.8.1"
)
end
def
test_multiple_failures
fails_with
(
:llvm
)
fails_with
(
:clang
)
gcc
=
build_cc
(
:gcc
,
5666
)
llvm
=
build_cc
(
:llvm
,
2336
)
clang
=
build_cc
(
:clang
,
425
)
assert_fails_with
llvm
assert_fails_with
clang
refute_fails_with
gcc
end
def
test_fails_with_version
fails_with
(
:gcc
=>
'4.8'
)
{
version
'4.8.1'
}
assert_fails_with
build_cc
(
"gcc-4.8"
,
"4.8"
)
assert_fails_with
build_cc
(
"gcc-4.8"
,
"4.8.1"
)
refute_fails_with
build_cc
(
"gcc-4.8"
,
"4.8.2"
)
end
end
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