Skip to content

Commit 5d35089

Browse files
committed
Revert unintented changes
1 parent e8c8a86 commit 5d35089

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

tests/lit/lit/formats/Cpp2RustTest.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
import lit.Test
55
import lit.util
66
from .base import TestFormat
7-
import difflib, os, re, shutil, random, sys
7+
import difflib, os, re, shutil, random
88
import tomli
99

10-
CURRENT_OS = 'macos' if sys.platform == 'darwin' else 'linux'
11-
ENTRY_RE = re.compile(r'(\w+)(?:\s*\(([^)]*)\))?')
12-
1310
def read_rust_version():
1411
toolchain_path = os.path.join(os.path.dirname(__file__),
1512
'../../../../libcc2rs/rust-toolchain.toml')
@@ -72,24 +69,17 @@ def execute(self, test, litConfig):
7269
def matches_model(match, model):
7370
if match is None:
7471
return False
75-
spec = match.group(1)
76-
if spec is None or spec.strip() == '':
72+
models = match.group(1)
73+
if models is None or models.strip() == '':
7774
return True
78-
for entry in ENTRY_RE.finditer(spec):
79-
if entry.group(1) != model:
80-
continue
81-
os_list = entry.group(2)
82-
if os_list is None:
83-
return True
84-
if CURRENT_OS in [o.strip() for o in os_list.split(',')]:
85-
return True
86-
return False
75+
return model in re.split(r'\s*,\s*', models.strip())
8776

8877
should_fail = False
8978
fail_code = lit.Test.FAIL
9079
xfail = self.regex_xfail.search(text)
9180
if xfail:
92-
should_fail = matches_model(xfail, model)
81+
xfail = re.split(r'\s*,\s*', xfail.group(1))
82+
should_fail = model in xfail
9383
fail_code = lit.Test.XFAIL
9484

9585
should_panic = matches_model(self.regex_panic.search(text), model)

0 commit comments

Comments
 (0)