Skip to content

Commit 7d37daf

Browse files
authored
Run more posixtest conformance tests. NFC (#19204)
1 parent 2693d36 commit 7d37daf

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

test/test_posixtest.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# University of Illinois/NCSA Open Source License. Both these licenses can be
44
# found in the LICENSE file.
55

6-
"""Runs the pthreads test from the upstream posixtest suite in:
6+
"""Runs conformance test from the upstream posixtest suite in:
77
./test/third_party/posixtestsuite
88
See
99
https://github.com/emscripten-core/posixtestsuite
@@ -28,20 +28,29 @@ class posixtest(RunnerCore):
2828

2929

3030
def filter_tests(all_tests):
31-
pthread_tests = [t for t in all_tests if t.startswith('pthread_')]
32-
return pthread_tests
31+
prefixes = [
32+
'pthread_',
33+
'strftime',
34+
'asctime',
35+
'gmtime'
36+
]
3337

38+
def enable_test(t):
39+
return any(t.startswith(p) for p in prefixes)
3440

35-
def get_pthread_tests():
36-
# For now, we don't require the submodule to exist. In this case we just report
37-
# no tests
38-
pthread_test_root = os.path.join(testsuite_root, 'conformance', 'interfaces')
39-
if not os.path.exists(pthread_test_root):
41+
return [t for t in all_tests if enable_test(t)]
42+
43+
44+
def get_tests():
45+
# For now, we don't require the submodule to exist. In this case we
46+
# just report no tests
47+
test_root = os.path.join(testsuite_root, 'conformance', 'interfaces')
48+
if not os.path.exists(test_root):
4049
print('posixtestsuite not found (run git submodule update --init?)')
4150
return []
42-
pthread_tests = filter_tests(os.listdir(pthread_test_root))
43-
pthread_tests = [os.path.join(pthread_test_root, t) for t in pthread_tests]
44-
return pthread_tests
51+
tests = filter_tests(os.listdir(test_root))
52+
tests = [os.path.join(test_root, t) for t in tests]
53+
return tests
4554

4655

4756
# Mark certain tests as unsupported
@@ -157,6 +166,7 @@ def f(self):
157166
'-Werror',
158167
'-Wno-format-security',
159168
'-Wno-int-conversion',
169+
'-Wno-format',
160170
'-pthread',
161171
'-sEXIT_RUNTIME',
162172
'-sTOTAL_MEMORY=256mb',
@@ -172,7 +182,7 @@ def f(self):
172182
return f
173183

174184

175-
for testdir in get_pthread_tests():
185+
for testdir in get_tests():
176186
basename = os.path.basename(testdir)
177187
for test_file in glob.glob(os.path.join(testdir, '*.c')):
178188
if not os.path.basename(test_file)[0].isdigit():

0 commit comments

Comments
 (0)