|
7 | 7 | from functools import wraps |
8 | 8 | from pathlib import Path |
9 | 9 | from subprocess import PIPE, STDOUT |
| 10 | +from typing import Dict, Tuple |
10 | 11 | from urllib.parse import unquote, unquote_plus |
11 | 12 | from http.server import HTTPServer, SimpleHTTPRequestHandler |
12 | 13 | import contextlib |
|
29 | 30 |
|
30 | 31 | import clang_native |
31 | 32 | import jsrun |
32 | | -from tools.shared import TEMP_DIR, EMCC, EMXX, DEBUG, EMCONFIGURE, EMCMAKE |
33 | | -from tools.shared import EMSCRIPTEN_TEMP_DIR |
| 33 | +from tools.shared import EMCC, EMXX, DEBUG, EMCONFIGURE, EMCMAKE |
34 | 34 | from tools.shared import get_canonical_temp_dir, path_from_root |
35 | 35 | from tools.utils import MACOS, WINDOWS, read_file, read_binary, write_file, write_binary, exit_with_error |
36 | 36 | from tools import shared, line_endings, building, config, utils |
@@ -411,8 +411,8 @@ def __new__(mcs, name, bases, attrs): |
411 | 411 | class RunnerCore(unittest.TestCase, metaclass=RunnerMeta): |
412 | 412 | # default temporary directory settings. set_temp_dir may be called later to |
413 | 413 | # override these |
414 | | - temp_dir = TEMP_DIR |
415 | | - canonical_temp_dir = get_canonical_temp_dir(TEMP_DIR) |
| 414 | + temp_dir = shared.TEMP_DIR |
| 415 | + canonical_temp_dir = get_canonical_temp_dir(shared.TEMP_DIR) |
416 | 416 |
|
417 | 417 | # This avoids cluttering the test runner output, which is stderr too, with compiler warnings etc. |
418 | 418 | # Change this to None to get stderr reporting, for debugging purposes |
@@ -532,7 +532,7 @@ def setUp(self): |
532 | 532 |
|
533 | 533 | if not EMTEST_SAVE_DIR: |
534 | 534 | self.has_prev_ll = False |
535 | | - for temp_file in os.listdir(TEMP_DIR): |
| 535 | + for temp_file in os.listdir(shared.TEMP_DIR): |
536 | 536 | if temp_file.endswith('.ll'): |
537 | 537 | self.has_prev_ll = True |
538 | 538 |
|
@@ -947,7 +947,7 @@ def assertBinaryEqual(self, file1, file2): |
947 | 947 | self.assertEqual(read_binary(file1), |
948 | 948 | read_binary(file2)) |
949 | 949 |
|
950 | | - library_cache = {} |
| 950 | + library_cache: Dict[str, Tuple[str, object]] = {} |
951 | 951 |
|
952 | 952 | def get_build_dir(self): |
953 | 953 | ret = self.in_dir('building') |
@@ -1005,8 +1005,8 @@ def get_library(self, name, generated_libs, configure=['sh', './configure'], # |
1005 | 1005 |
|
1006 | 1006 | def clear(self): |
1007 | 1007 | utils.delete_contents(self.get_dir()) |
1008 | | - if EMSCRIPTEN_TEMP_DIR: |
1009 | | - utils.delete_contents(EMSCRIPTEN_TEMP_DIR) |
| 1008 | + if shared.EMSCRIPTEN_TEMP_DIR: |
| 1009 | + utils.delete_contents(shared.EMSCRIPTEN_TEMP_DIR) |
1010 | 1010 |
|
1011 | 1011 | def run_process(self, cmd, check=True, **args): |
1012 | 1012 | # Wrapper around shared.run_process. This is desirable so that the tests |
|
0 commit comments