Skip to content

Commit becba71

Browse files
committed
enable SwiftifyImports/CxxSpan tests (NFC)
These tests require the 'std_span' feature, but that feature was previously only added in the test/Interop test suite. As a result these tests would never run.
1 parent b1c2bc1 commit becba71

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
if config.target_sdk_libcxx_path != '':
2+
if os.path.exists(os.path.join(config.target_sdk_libcxx_path, "span")):
3+
config.available_features.add('std_span')
4+
elif get_target_os() in ['linux-gnu']:
5+
for p in ['/usr/include/c++/', '/usr/local/include/c++/']:
6+
if not os.path.isdir(p):
7+
continue
8+
for subdir in os.listdir(p):
9+
if not subdir.isdigit():
10+
# skip paths libc++ paths like /usr/include/c++/v1, we want libstdc++ paths only (like /usr/include/c++/13)
11+
continue
12+
if os.path.exists(os.path.join(p, subdir, "span")):
13+
config.available_features.add('std_span')
14+
elif get_target_os() in ['windows-msvc']:
15+
# We don't test on any versions of MSVC without std::span support.
16+
# FIXME: figure out where to do lookup for C++ stdlib headers on Windows - we'll probably need it eventually
17+
config.available_features.add('std_span')
18+

0 commit comments

Comments
 (0)