Skip to content

Commit b5bf368

Browse files
authored
Split test decorators into their own file. NFC (emscripten-core#25608)
1 parent 9110edd commit b5bf368

13 files changed

+655
-650
lines changed

test/common.py

Lines changed: 1 addition & 593 deletions
Large diffs are not rendered by default.

test/decorators.py

Lines changed: 611 additions & 0 deletions
Large diffs are not rendered by default.

test/test_benchmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
import clang_native
2222
import common
2323
import jsrun
24-
from common import needs_make, read_binary, read_file, test_file
24+
from common import read_binary, read_file, test_file
25+
from decorators import needs_make
2526

2627
from tools import building, utils
2728
from tools.shared import CLANG_CC, CLANG_CXX, EMCC, PIPE, config, run_process

test/test_browser.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,34 @@
3333
HttpServerThread,
3434
Reporting,
3535
RunnerCore,
36-
also_with_asan,
37-
also_with_minimal_runtime,
38-
also_with_wasm2js,
39-
also_with_wasmfs,
4036
copytree,
4137
create_file,
42-
disabled,
4338
ensure_dir,
4439
find_browser_test_file,
45-
flaky,
4640
has_browser,
4741
is_chrome,
4842
is_firefox,
4943
is_safari,
44+
path_from_root,
45+
read_file,
46+
test_file,
47+
)
48+
from decorators import (
49+
also_with_asan,
50+
also_with_minimal_runtime,
51+
also_with_wasm2js,
52+
also_with_wasmfs,
53+
disabled,
54+
flaky,
5055
no_2gb,
5156
no_4gb,
5257
no_wasm64,
5358
parameterize,
5459
parameterized,
55-
path_from_root,
56-
read_file,
5760
requires_dev_dependency,
5861
requires_wasm2js,
5962
skip_if,
6063
skip_if_simple,
61-
test_file,
6264
with_all_sjlj,
6365
)
6466

test/test_codesize.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
RunnerCore,
1515
compiler_for,
1616
create_file,
17-
node_pthreads,
18-
parameterized,
1917
read_binary,
2018
read_file,
2119
test_file,
2220
)
21+
from decorators import node_pthreads, parameterized
2322

2423
from tools import building, shared
2524

test/test_core.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
PYTHON,
2727
WEBIDL_BINDER,
2828
RunnerCore,
29+
compiler_for,
30+
create_file,
31+
env_modify,
32+
path_from_root,
33+
read_binary,
34+
read_file,
35+
test_file,
36+
)
37+
from decorators import (
2938
all_engines,
3039
also_with_minimal_runtime,
3140
also_with_modularize,
@@ -36,11 +45,8 @@
3645
also_with_wasmfs,
3746
also_without_bigint,
3847
can_do_standalone,
39-
compiler_for,
40-
create_file,
4148
crossplatform,
4249
disabled,
43-
env_modify,
4450
flaky,
4551
is_slow_test,
4652
needs_make,
@@ -51,9 +57,6 @@
5157
node_pthreads,
5258
parameterize,
5359
parameterized,
54-
path_from_root,
55-
read_binary,
56-
read_file,
5760
requires_dev_dependency,
5861
requires_jspi,
5962
requires_native_clang,
@@ -63,7 +66,6 @@
6366
requires_wasm2js,
6467
requires_wasm_eh,
6568
skip_if,
66-
test_file,
6769
with_all_eh_sjlj,
6870
with_all_fs,
6971
with_all_sjlj,

test/test_interactive.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@
1010
if __name__ == '__main__':
1111
raise Exception('do not run this file directly; do something like: test/runner.py interactive')
1212

13-
from common import (
14-
BrowserCore,
15-
also_with_minimal_runtime,
16-
create_file,
17-
parameterized,
18-
test_file,
19-
)
13+
from common import BrowserCore, create_file, test_file
14+
from decorators import also_with_minimal_runtime, parameterized
2015

2116
from tools.shared import WINDOWS
2217

test/test_jslib.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66
import shutil
77
from subprocess import PIPE
88

9-
from common import (
10-
RunnerCore,
11-
create_file,
12-
parameterized,
13-
read_file,
14-
test_file,
15-
)
9+
from common import RunnerCore, create_file, read_file, test_file
10+
from decorators import parameterized
1611

1712
from tools.shared import EMCC
1813
from tools.utils import delete_file

test/test_other.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
TEST_ROOT,
4343
WEBIDL_BINDER,
4444
RunnerCore,
45+
copytree,
46+
create_file,
47+
ensure_dir,
48+
env_modify,
49+
make_executable,
50+
path_from_root,
51+
test_file,
52+
)
53+
from decorators import (
4554
all_engines,
4655
also_with_asan,
4756
also_with_minimal_runtime,
@@ -52,22 +61,16 @@
5261
also_with_wasm64,
5362
also_with_wasmfs,
5463
also_without_bigint,
55-
copytree,
56-
create_file,
5764
crossplatform,
5865
disabled,
59-
ensure_dir,
60-
env_modify,
6166
flaky,
6267
is_slow_test,
63-
make_executable,
6468
no_mac,
6569
no_windows,
6670
node_pthreads,
6771
only_windows,
6872
parameterize,
6973
parameterized,
70-
path_from_root,
7174
requires_dev_dependency,
7275
requires_jspi,
7376
requires_native_clang,
@@ -77,7 +80,6 @@
7780
requires_v8,
7881
requires_wasm64,
7982
requires_wasm_eh,
80-
test_file,
8183
with_all_eh_sjlj,
8284
with_all_fs,
8385
with_all_sjlj,

test/test_posixtest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import unittest
1515

1616
import test_posixtest_browser
17-
from common import RunnerCore, node_pthreads, path_from_root
17+
from common import RunnerCore, path_from_root
18+
from decorators import node_pthreads
1819

1920
testsuite_root = path_from_root('test/third_party/posixtestsuite')
2021

0 commit comments

Comments
 (0)