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
b89c0f16
Commit
b89c0f16
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert CxxStdlib test to spec.
parent
ec27b69b
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/cxxstdlib_spec.rb
+68
-0
68 additions, 0 deletions
Library/Homebrew/test/cxxstdlib_spec.rb
Library/Homebrew/test/stdlib_test.rb
+0
-63
0 additions, 63 deletions
Library/Homebrew/test/stdlib_test.rb
with
68 additions
and
63 deletions
Library/Homebrew/test/cxxstdlib_spec.rb
0 → 100644
+
68
−
0
View file @
b89c0f16
require
"formula"
require
"cxxstdlib"
describe
CxxStdlib
do
let
(
:clang
)
{
CxxStdlib
.
create
(
:libstdcxx
,
:clang
)
}
let
(
:gcc
)
{
CxxStdlib
.
create
(
:libstdcxx
,
:gcc
)
}
let
(
:gcc40
)
{
CxxStdlib
.
create
(
:libstdcxx
,
:gcc_4_0
)
}
let
(
:gcc42
)
{
CxxStdlib
.
create
(
:libstdcxx
,
:gcc_4_2
)
}
let
(
:gcc48
)
{
CxxStdlib
.
create
(
:libstdcxx
,
"gcc-4.8"
)
}
let
(
:gcc49
)
{
CxxStdlib
.
create
(
:libstdcxx
,
"gcc-4.9"
)
}
let
(
:lcxx
)
{
CxxStdlib
.
create
(
:libcxx
,
:clang
)
}
let
(
:purec
)
{
CxxStdlib
.
create
(
nil
,
:clang
)
}
describe
"#compatible_with?"
do
specify
"Apple libstdcxx intercompatibility"
do
expect
(
clang
).
to
be_compatible_with
(
gcc
)
expect
(
clang
).
to
be_compatible_with
(
gcc42
)
end
specify
"compatibility with itself"
do
expect
(
gcc
).
to
be_compatible_with
(
gcc
)
expect
(
gcc48
).
to
be_compatible_with
(
gcc48
)
expect
(
clang
).
to
be_compatible_with
(
clang
)
end
specify
"Apple/GNU libstdcxx incompatibility"
do
expect
(
clang
).
not_to
be_compatible_with
(
gcc48
)
expect
(
gcc48
).
not_to
be_compatible_with
(
clang
)
end
specify
"GNU cross-version incompatibility"
do
expect
(
gcc48
).
not_to
be_compatible_with
(
gcc49
)
expect
(
gcc49
).
not_to
be_compatible_with
(
gcc48
)
end
specify
"libstdcxx and libcxx incompatibility"
do
expect
(
clang
).
not_to
be_compatible_with
(
lcxx
)
expect
(
lcxx
).
not_to
be_compatible_with
(
clang
)
end
specify
"compatibility for non-cxx software"
do
expect
(
purec
).
to
be_compatible_with
(
clang
)
expect
(
clang
).
to
be_compatible_with
(
purec
)
expect
(
purec
).
to
be_compatible_with
(
purec
)
expect
(
purec
).
to
be_compatible_with
(
gcc48
)
expect
(
gcc48
).
to
be_compatible_with
(
purec
)
end
end
describe
"#apple_compiler?"
do
it
"returns true for Apple compilers"
do
expect
(
clang
).
to
be_an_apple_compiler
expect
(
gcc
).
to
be_an_apple_compiler
expect
(
gcc42
).
to
be_an_apple_compiler
end
it
"returns false for non-Apple compilers"
do
expect
(
gcc48
).
not_to
be_an_apple_compiler
end
end
describe
"#type_string"
do
specify
"formatting"
do
expect
(
clang
.
type_string
).
to
eq
(
"libstdc++"
)
expect
(
lcxx
.
type_string
).
to
eq
(
"libc++"
)
end
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/stdlib_test.rb
deleted
100644 → 0
+
0
−
63
View file @
ec27b69b
require
"testing_env"
require
"formula"
require
"cxxstdlib"
class
CxxStdlibTests
<
Homebrew
::
TestCase
def
setup
super
@clang
=
CxxStdlib
.
create
(
:libstdcxx
,
:clang
)
@gcc
=
CxxStdlib
.
create
(
:libstdcxx
,
:gcc
)
@gcc40
=
CxxStdlib
.
create
(
:libstdcxx
,
:gcc_4_0
)
@gcc42
=
CxxStdlib
.
create
(
:libstdcxx
,
:gcc_4_2
)
@gcc48
=
CxxStdlib
.
create
(
:libstdcxx
,
"gcc-4.8"
)
@gcc49
=
CxxStdlib
.
create
(
:libstdcxx
,
"gcc-4.9"
)
@lcxx
=
CxxStdlib
.
create
(
:libcxx
,
:clang
)
@purec
=
CxxStdlib
.
create
(
nil
,
:clang
)
end
def
test_apple_libstdcxx_intercompatibility
assert
@clang
.
compatible_with?
(
@gcc
)
assert
@clang
.
compatible_with?
(
@gcc42
)
end
def
test_compatibility_same_compilers_and_type
assert
@gcc
.
compatible_with?
(
@gcc
)
assert
@gcc48
.
compatible_with?
(
@gcc48
)
assert
@clang
.
compatible_with?
(
@clang
)
end
def
test_apple_gnu_libstdcxx_incompatibility
assert
!
@clang
.
compatible_with?
(
@gcc48
)
assert
!
@gcc48
.
compatible_with?
(
@clang
)
end
def
test_gnu_cross_version_incompatibility
assert
!
@gcc48
.
compatible_with?
(
@gcc49
)
assert
!
@gcc49
.
compatible_with?
(
@gcc48
)
end
def
test_libstdcxx_libcxx_incompatibility
assert
!
@clang
.
compatible_with?
(
@lcxx
)
assert
!
@lcxx
.
compatible_with?
(
@clang
)
end
def
test_apple_compiler_reporting
assert_predicate
@clang
,
:apple_compiler?
assert_predicate
@gcc
,
:apple_compiler?
assert_predicate
@gcc42
,
:apple_compiler?
refute_predicate
@gcc48
,
:apple_compiler?
end
def
test_type_string_formatting
assert_equal
"libstdc++"
,
@clang
.
type_string
assert_equal
"libc++"
,
@lcxx
.
type_string
end
def
test_compatibility_for_non_cxx_software
assert
@purec
.
compatible_with?
(
@clang
)
assert
@clang
.
compatible_with?
(
@purec
)
assert
@purec
.
compatible_with?
(
@purec
)
assert
@purec
.
compatible_with?
(
@gcc48
)
assert
@gcc48
.
compatible_with?
(
@purec
)
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