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
b05ed6a0
Commit
b05ed6a0
authored
8 years ago
by
Ximin Luo
Browse files
Options
Downloads
Patches
Plain Diff
Disable the llvm-dis test if the version is lower than 3.8
parent
cc3a2ba7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
diffoscope/__init__.py
+4
-0
4 additions, 0 deletions
diffoscope/__init__.py
tests/comparators/conftest.py
+9
-1
9 additions, 1 deletion
tests/comparators/conftest.py
tests/comparators/test_rlib.py
+2
-1
2 additions, 1 deletion
tests/comparators/test_rlib.py
with
15 additions
and
2 deletions
diffoscope/__init__.py
+
4
−
0
View file @
b05ed6a0
...
...
@@ -113,6 +113,10 @@ class RequiredToolNotFound(Exception):
'
debian
'
:
'
llvm
'
,
'
arch
'
:
'
llvm
'
,
},
'
llvm-config
'
:
{
'
debian
'
:
'
llvm
'
,
'
arch
'
:
'
llvm
'
,
},
'
llvm-dis
'
:
{
'
debian
'
:
'
llvm
'
,
'
arch
'
:
'
llvm
'
,
...
...
This diff is collapsed.
Click to expand it.
tests/comparators/conftest.py
+
9
−
1
View file @
b05ed6a0
...
...
@@ -18,18 +18,26 @@
# along with diffoscope. If not, see <http://www.gnu.org/licenses/>.
from
distutils.spawn
import
find_executable
from
distutils.version
import
StrictVersion
import
diffoscope
import
pytest
import
subprocess
@pytest.fixture
(
autouse
=
True
)
def
set_locale
():
diffoscope
.
set_locale
()
diffoscope
.
set_locale
()
def
tool_missing
(
cmd
):
return
find_executable
(
cmd
)
is
None
def
tool_older_than
(
cmdline
,
min_ver
,
vcls
=
StrictVersion
):
actual_ver
=
subprocess
.
check_output
([
"
llvm-config
"
,
"
--version
"
]).
decode
(
"
utf-8
"
).
strip
()
print
(
actual_ver
,
min_ver
,
vcls
)
return
vcls
(
actual_ver
)
<
vcls
(
min_ver
)
# from Jerry Kindall at http://stackoverflow.com/a/7088133
def
try_except
(
success
,
failure
,
*
exceptions
):
try
:
...
...
This diff is collapsed.
Click to expand it.
tests/comparators/test_rlib.py
+
2
−
1
View file @
b05ed6a0
...
...
@@ -28,7 +28,7 @@ from diffoscope.comparators.llvm import LlvmBitCodeFile
from
diffoscope.comparators.rust
import
RustObjectFile
from
diffoscope.comparators.utils
import
diff_ignore_line_numbers
from
diffoscope.config
import
Config
from
conftest
import
tool_missing
from
conftest
import
tool_missing
,
tool_older_than
TEST_FILE1_PATH
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
../data/test1.rlib
'
)
TEST_FILE2_PATH
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
../data/test2.rlib
'
)
...
...
@@ -72,6 +72,7 @@ def test_item2_rust_metadata_bin(differences):
assert
differences
[
2
].
source2
==
'
rust.metadata.bin
'
@pytest.mark.skipif
(
tool_missing
(
'
llvm-dis
'
),
reason
=
'
missing llvm-dis
'
)
@pytest.mark.skipif
(
tool_older_than
([
'
llvm-config
'
,
'
--version
'
],
'
3.8
'
),
reason
=
'
llvm version too low
'
)
def
test_item3_deflate_llvm_bitcode
(
differences
):
assert
differences
[
3
].
source1
==
'
alloc_system-d16b8f0e.0.bytecode.deflate
'
assert
differences
[
3
].
source2
==
'
alloc_system-d16b8f0e.0.bytecode.deflate
'
...
...
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