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
0f580953
Commit
0f580953
authored
11 years ago
by
Misty De Meo
Browse files
Options
Downloads
Patches
Plain Diff
Mach: improve tests
parent
b0d45b29
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/test/test_mach.rb
+40
-11
40 additions, 11 deletions
Library/Homebrew/test/test_mach.rb
with
40 additions
and
11 deletions
Library/Homebrew/test/test_mach.rb
+
40
−
11
View file @
0f580953
...
...
@@ -9,6 +9,10 @@ end
class
MachOPathnameTests
<
Test
::
Unit
::
TestCase
include
FileHelper
def
setup
@archs
=
[
:i386
,
:x86_64
,
:ppc7400
,
:ppc64
].
extend
(
ArchitectureListExtension
)
end
def
test_fat_dylib
pn
=
Pathname
.
new
(
"
#{
TEST_FOLDER
}
/mach/fat.dylib"
)
assert
pn
.
universal?
...
...
@@ -123,19 +127,44 @@ class MachOPathnameTests < Test::Unit::TestCase
assert_no_match
(
/Mach-O [^ ]* ?executable/
,
file
(
pn
))
end
def
test_architecture_list_extension
archs
=
[
:i386
,
:x86_64
,
:ppc7400
,
:ppc64
]
archs
.
extend
(
ArchitectureListExtension
)
assert
archs
.
universal?
archs
.
remove_ppc!
assert_equal
2
,
archs
.
length
assert_match
(
/-arch i386/
,
archs
.
as_arch_flags
)
assert_match
(
/-arch x86_64/
,
archs
.
as_arch_flags
)
def
test_architecture_list_extension_universal_checks
assert
@archs
.
universal?
assert
@archs
.
intel_universal?
assert
@archs
.
ppc_universal?
assert
@archs
.
cross_universal?
assert
@archs
.
fat?
non_universal
=
[
:i386
].
extend
ArchitectureListExtension
assert
!
non_universal
.
universal?
intel_only
=
[
:i386
,
:x86_64
].
extend
ArchitectureListExtension
assert
intel_only
.
universal?
assert
!
intel_only
.
ppc_universal?
assert
!
intel_only
.
cross_universal?
ppc_only
=
[
:ppc970
,
:ppc64
].
extend
ArchitectureListExtension
assert
ppc_only
.
universal?
assert
!
ppc_only
.
intel_universal?
assert
!
ppc_only
.
cross_universal?
cross
=
[
:ppc7400
,
:i386
].
extend
ArchitectureListExtension
assert
cross
.
universal?
assert
!
cross
.
intel_universal?
assert
!
cross
.
ppc_universal?
end
def
test_architecture_list_extension_massaging_flags
@archs
.
remove_ppc!
assert_equal
2
,
@archs
.
length
assert_match
(
/-arch i386/
,
@archs
.
as_arch_flags
)
assert_match
(
/-arch x86_64/
,
@archs
.
as_arch_flags
)
end
def
test_architecture_list_arch_flags_methods
pn
=
Pathname
.
new
(
"
#{
TEST_FOLDER
}
/mach/fat.dylib"
)
assert
pn
.
archs
.
universal?
assert_
match
(
/
-arch i386
/
,
pn
.
archs
.
as_arch_flags
)
assert_
match
(
/-arch x86_64/
,
pn
.
archs
.
as_arch_flags
)
assert
pn
.
archs
.
intel_
universal?
assert_
equal
"-arch x86_64
-arch i386
"
,
pn
.
archs
.
as_arch_flags
assert_
equal
"x86_64;i386"
,
pn
.
archs
.
as_
cmake_
arch_flags
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