Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
52269e91
Commit
52269e91
authored
Jul 09, 2016
by
Wenzel Jakob
Committed by
GitHub
Jul 09, 2016
Browse files
Merge pull request #274 from jagerman/report-skipped-tests
Skip eigen test when eigen header available but NumPy not
parents
5ba89c34
7de9f6c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
11 deletions
+19
-11
example/eigen.py
example/eigen.py
+5
-1
example/example10.py
example/example10.py
+2
-2
example/example7.py
example/example7.py
+2
-2
example/run_test.py
example/run_test.py
+10
-6
No files found.
example/eigen.py
View file @
52269e91
...
@@ -11,7 +11,11 @@ from example import sparse_r, sparse_c
...
@@ -11,7 +11,11 @@ from example import sparse_r, sparse_c
from
example
import
sparse_passthrough_r
,
sparse_passthrough_c
from
example
import
sparse_passthrough_r
,
sparse_passthrough_c
from
example
import
double_row
,
double_col
from
example
import
double_row
,
double_col
from
example
import
double_mat_cm
,
double_mat_rm
from
example
import
double_mat_cm
,
double_mat_rm
import
numpy
as
np
try
:
import
numpy
as
np
except
ImportError
:
# NumPy missing: skip test
exit
(
99
)
ref
=
np
.
array
(
ref
=
np
.
array
(
[[
0
,
3
,
0
,
0
,
0
,
11
],
[[
0
,
3
,
0
,
0
,
0
,
11
],
...
...
example/example10.py
View file @
52269e91
...
@@ -7,8 +7,8 @@ import example
...
@@ -7,8 +7,8 @@ import example
try
:
try
:
import
numpy
as
np
import
numpy
as
np
except
ImportError
:
except
ImportError
:
print
(
'
NumPy missing
'
)
#
NumPy missing
: skip test
exit
(
0
)
exit
(
99
)
from
example
import
vectorized_func
from
example
import
vectorized_func
from
example
import
vectorized_func2
from
example
import
vectorized_func2
...
...
example/example7.py
View file @
52269e91
...
@@ -8,8 +8,8 @@ from example import Matrix
...
@@ -8,8 +8,8 @@ from example import Matrix
try
:
try
:
import
numpy
as
np
import
numpy
as
np
except
ImportError
:
except
ImportError
:
print
(
'
NumPy missing
'
)
#
NumPy missing
: skip test
exit
(
0
)
exit
(
99
)
m
=
Matrix
(
5
,
5
)
m
=
Matrix
(
5
,
5
)
...
...
example/run_test.py
View file @
52269e91
...
@@ -52,16 +52,20 @@ if len(sys.argv) == 3 and sys.argv[1] == '--relaxed':
...
@@ -52,16 +52,20 @@ if len(sys.argv) == 3 and sys.argv[1] == '--relaxed':
relaxed
=
True
relaxed
=
True
name
=
sys
.
argv
[
1
]
name
=
sys
.
argv
[
1
]
output_bytes
=
subprocess
.
check_output
([
sys
.
executable
,
name
+
".py"
],
try
:
stderr
=
subprocess
.
STDOUT
)
output_bytes
=
subprocess
.
check_output
([
sys
.
executable
,
name
+
".py"
],
stderr
=
subprocess
.
STDOUT
)
except
subprocess
.
CalledProcessError
as
e
:
if
e
.
returncode
==
99
:
print
(
'Test "%s" could not be run.'
%
name
)
exit
(
0
)
else
:
raise
output
=
sanitize
(
output_bytes
.
decode
(
'utf-8'
))
output
=
sanitize
(
output_bytes
.
decode
(
'utf-8'
))
reference
=
sanitize
(
open
(
name
+
'.ref'
,
'r'
).
read
())
reference
=
sanitize
(
open
(
name
+
'.ref'
,
'r'
).
read
())
if
'NumPy missing'
in
output
:
if
output
==
reference
:
print
(
'Test "%s" could not be run.'
%
name
)
exit
(
0
)
elif
output
==
reference
:
print
(
'Test "%s" succeeded.'
%
name
)
print
(
'Test "%s" succeeded.'
%
name
)
exit
(
0
)
exit
(
0
)
else
:
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment