Skip to content

Commit 3b69b07

Browse files
[WASM] Exclude test cases which use -enable-objc-interop
1 parent 41011bf commit 3b69b07

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/lit.cfg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,26 @@ elif run_os == 'wasi':
12301230
config.target_sdk_name = "wasi"
12311231
config.target_runtime = "native"
12321232

1233+
# Exclude test cases that use objc-interop because clang doesn't support it
1234+
# with WebAssembly binary file yet.
1235+
testfiles = glob.glob(os.path.join(config.test_source_root, "**", "*.swift"))
1236+
1237+
def use_objc_interop(path):
1238+
with open(path) as f:
1239+
return '-enable-objc-interop' in f.read()
1240+
1241+
import fnmatch
1242+
def objc_interop_enabled_filenames(path, filename_pat):
1243+
matches = []
1244+
for root, dirnames, filenames in os.walk(path):
1245+
for filename in fnmatch.filter(filenames, filename_pat):
1246+
filepath = os.path.join(root, filename)
1247+
if not use_objc_interop(filepath): continue
1248+
matches.append(filename)
1249+
return matches
1250+
1251+
config.excludes += objc_interop_enabled_filenames(config.test_source_root, "*.swift")
1252+
12331253
config.target_swift_autolink_extract = inferSwiftBinary("swift-autolink-extract")
12341254

12351255
config.target_build_swift = ' '.join([

0 commit comments

Comments
 (0)