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
b887c6bd
Verified
Commit
b887c6bd
authored
8 years ago
by
Mattia Rizzolo
Browse files
Options
Downloads
Patches
Plain Diff
tests/ppu: skip some PPU tests if ppudump is < 3.0.0
parent
5e1d4315
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_ppu.py
+10
-3
10 additions, 3 deletions
tests/comparators/test_ppu.py
with
10 additions
and
3 deletions
tests/comparators/test_ppu.py
+
10
−
3
View file @
b887c6bd
...
...
@@ -19,11 +19,12 @@
# along with diffoscope. If not, see <http://www.gnu.org/licenses/>.
import
pytest
import
subprocess
from
diffoscope.comparators.ppu
import
PpuFile
from
utils
import
skip_unless_tools_exist
,
data
,
load_fixture
,
\
assert_non_existing
assert_non_existing
,
skip_unless_tool_is_older_than
# These test files were taken from two different builds of the Debian package
# fp-units-castle-game-engine (version 5.1.1-2 on amd64) on the Debian
...
...
@@ -34,6 +35,12 @@ from utils import skip_unless_tools_exist, data, load_fixture, \
file1
=
load_fixture
(
data
(
'
test1.ppu
'
))
file2
=
load_fixture
(
data
(
'
test2.ppu
'
))
def
ppudump_version
():
# first line of `PPU-Analyser Version 3.0.0` looks like:
# PPU-Analyser Version 3.0.0
out
=
subprocess
.
check_output
([
'
ppudump
'
,
'
-h
'
])
return
out
.
decode
(
'
utf-8
'
).
splitlines
()[
0
].
split
()[
2
].
strip
()
@skip_unless_tools_exist
(
'
ppudump
'
)
def
test_identification
(
file1
):
assert
isinstance
(
file1
,
PpuFile
)
...
...
@@ -46,12 +53,12 @@ def test_no_differences(file1):
def
differences
(
file1
,
file2
):
return
file1
.
compare
(
file2
).
details
@skip_unless_tool
s_exist
(
'
ppudump
'
)
@skip_unless_tool
_is_older_than
(
'
ppudump
'
,
ppudump_version
,
'
3.0.0
'
)
def
test_diff
(
differences
):
print
(
differences
[
0
].
unified_diff
)
expected_diff
=
open
(
data
(
'
ppu_expected_diff
'
)).
read
()
assert
differences
[
0
].
unified_diff
==
expected_diff
@skip_unless_tool
s_exist
(
'
ppudump
'
)
@skip_unless_tool
_is_older_than
(
'
ppudump
'
,
ppudump_version
,
'
3.0.0
'
)
def
test_compare_non_existing
(
monkeypatch
,
file1
):
assert_non_existing
(
monkeypatch
,
file1
,
has_null_source
=
False
)
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