Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
1d7bea16
Verified
Commit
1d7bea16
authored
8 years ago
by
Mattia Rizzolo
Browse files
Options
Downloads
Patches
Plain Diff
tests: skip rlib tests if the "nm" tool is missing
Closes: #837742
parent
07b75284
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/comparators/test_rlib.py
+6
-1
6 additions, 1 deletion
tests/comparators/test_rlib.py
with
6 additions
and
1 deletion
tests/comparators/test_rlib.py
+
6
−
1
View file @
1d7bea16
...
...
@@ -25,7 +25,7 @@ from diffoscope.comparators.ar import ArFile
from
diffoscope.comparators.utils
import
diff_ignore_line_numbers
from
utils
import
skip_unless_tools_exist
,
skip_unless_tool_is_older_than
,
\
data
,
load_fixture
,
assert_non_existing
skip_unless_tools_exist
,
data
,
load_fixture
,
assert_non_existing
rlib1
=
load_fixture
(
data
(
'
test1.rlib
'
))
rlib2
=
load_fixture
(
data
(
'
test2.rlib
'
))
...
...
@@ -44,21 +44,25 @@ def test_no_differences(rlib1):
def
differences
(
rlib1
,
rlib2
):
return
rlib1
.
compare
(
rlib2
).
details
@skip_unless_tools_exist
(
'
nm
'
)
def
test_num_items
(
differences
):
assert
len
(
differences
)
==
4
@skip_unless_tools_exist
(
'
nm
'
)
def
test_item0_armap
(
differences
):
assert
differences
[
0
].
source1
==
'
nm -s {}
'
assert
differences
[
0
].
source2
==
'
nm -s {}
'
expected_diff
=
open
(
data
(
'
rlib_armap_expected_diff
'
)).
read
()
assert
differences
[
0
].
unified_diff
==
expected_diff
@skip_unless_tools_exist
(
'
nm
'
)
def
test_item1_elf
(
differences
):
assert
differences
[
1
].
source1
==
'
alloc_system-d16b8f0e.0.o
'
assert
differences
[
1
].
source2
==
'
alloc_system-d16b8f0e.0.o
'
expected_diff
=
open
(
data
(
'
rlib_elf_expected_diff
'
)).
read
()
assert
differences
[
1
].
details
[
0
].
unified_diff
==
expected_diff
@skip_unless_tools_exist
(
'
nm
'
)
def
test_item2_rust_metadata_bin
(
differences
):
assert
differences
[
2
].
source1
==
'
rust.metadata.bin
'
assert
differences
[
2
].
source2
==
'
rust.metadata.bin
'
...
...
@@ -72,5 +76,6 @@ def test_item3_deflate_llvm_bitcode(differences):
actual_diff
=
differences
[
3
].
details
[
0
].
details
[
1
].
unified_diff
assert
diff_ignore_line_numbers
(
actual_diff
)
==
diff_ignore_line_numbers
(
expected_diff
)
@skip_unless_tools_exist
(
'
nm
'
)
def
test_compare_non_existing
(
monkeypatch
,
rlib1
):
assert_non_existing
(
monkeypatch
,
rlib1
)
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