|
1 | 1 | import py, os, sys |
| 2 | +import cppyy |
2 | 3 | from pytest import mark, raises |
3 | | -from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86 |
| 4 | +from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM |
4 | 5 |
|
5 | 6 | inc_paths = [os.path.join(os.path.sep, 'usr', 'include'), |
6 | 7 | os.path.join(os.path.sep, 'usr', 'local', 'include')] |
7 | 8 |
|
8 | | -eigen_path = None |
9 | | -for p in inc_paths: |
10 | | - p = os.path.join(p, 'eigen3') |
11 | | - if os.path.exists(p): |
12 | | - eigen_path = p |
| 9 | +noeigen = not cppyy.gbl.Cpp.Evaluate(""" |
| 10 | + #if __has_include("eigen3/Eigen/Dense") |
| 11 | + true |
| 12 | + #else |
| 13 | + false |
| 14 | + #endif |
| 15 | +""") |
13 | 16 |
|
14 | | - |
15 | | -@mark.skipif(eigen_path is None, reason="Eigen not found") |
| 17 | +@mark.skipif(noeigen == True, reason="Eigen not found") |
16 | 18 | class TestEIGEN: |
17 | 19 | def setup_class(cls): |
18 | 20 | import cppyy, warnings |
19 | 21 |
|
20 | | - cppyy.add_include_path(eigen_path) |
21 | 22 | with warnings.catch_warnings(): |
22 | | - warnings.simplefilter('ignore') |
23 | | - cppyy.include('Eigen/Dense') |
| 23 | + cppyy.include('eigen3/Eigen/Dense') |
24 | 24 |
|
25 | 25 | @mark.xfail |
26 | 26 | def test01_simple_matrix_and_vector(self): |
@@ -148,17 +148,16 @@ def test04_resizing_through_assignment(self): |
148 | 148 | assert a.size() == 9 |
149 | 149 |
|
150 | 150 |
|
151 | | -@mark.skipif(eigen_path is None, reason="Eigen not found") |
152 | | -class TestEIGEN_REGRESSIOn: |
| 151 | +@mark.skipif(noeigen == True, reason="Eigen not found") |
| 152 | +class TestEIGEN_REGRESSION: |
153 | 153 | def setup_class(cls): |
154 | 154 | import cppyy, warnings |
155 | 155 |
|
156 | | - cppyy.add_include_path(eigen_path) |
157 | 156 | with warnings.catch_warnings(): |
158 | 157 | warnings.simplefilter('ignore') |
159 | | - cppyy.include('Eigen/Dense') |
| 158 | + cppyy.include('eigen3/Eigen/Dense') |
160 | 159 |
|
161 | | - @mark.xfail(condition=IS_MAC_X86 and (not IS_CLANG_REPL), reason="Errors out on OS X Cling") |
| 160 | + @mark.xfail(condition=((IS_MAC_ARM) or (IS_MAC_X86 and not IS_CLANG_REPL)), reason="Fails on OS X arm and osx 86 for cling") |
162 | 161 | def test01_use_of_Map(self): |
163 | 162 | """Use of Map (used to crash)""" |
164 | 163 |
|
|
0 commit comments