Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions em++.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# found in the LICENSE file.

import sys

import emcc
from tools import shared

Expand Down
3 changes: 2 additions & 1 deletion em-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
is found, or exits with 1 if the variable does not exist.
"""

import sys
import re
import sys

from tools import config


Expand Down
1 change: 1 addition & 0 deletions emar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import sys

from tools import shared

shared.exec_process([shared.LLVM_AR] + sys.argv[1:])
7 changes: 1 addition & 6 deletions embuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@
import time
from contextlib import contextmanager

from tools import cache
from tools import shared
from tools import system_libs
from tools import ports
from tools import utils
from tools import cache, ports, shared, system_libs, utils
from tools.settings import settings
from tools.system_libs import USE_NINJA


# Minimal subset of targets used by CI systems to build enough to be useful
MINIMAL_TASKS = [
'libcompiler_rt',
Expand Down
34 changes: 21 additions & 13 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,38 @@
slows down compilation).
"""

from tools.toolchain_profiler import ToolchainProfiler

import logging
import os
import shlex
import shutil
import sys
import time
import tarfile
import time
from dataclasses import dataclass
from enum import Enum, auto, unique


from tools import shared, system_libs, utils, cmdline
from tools import diagnostics, building, compile
from tools.shared import exit_with_error, DEBUG
from tools.shared import in_temp
from tools.shared import DYLIB_EXTENSIONS
from tools import (
building,
cache,
cmdline,
compile,
config,
diagnostics,
shared,
system_libs,
utils,
)
from tools.cmdline import CLANG_FLAGS_WITH_ARGS
from tools.response_file import substitute_response_files
from tools import config
from tools import cache
from tools.settings import default_setting, user_settings, settings, COMPILE_TIME_SETTINGS
from tools.utils import read_file, unsuffixed_basename, get_file_suffix
from tools.settings import (
COMPILE_TIME_SETTINGS,
default_setting,
settings,
user_settings,
)
from tools.shared import DEBUG, DYLIB_EXTENSIONS, exit_with_error, in_temp
from tools.toolchain_profiler import ToolchainProfiler
from tools.utils import get_file_suffix, read_file, unsuffixed_basename

logger = logging.getLogger('emcc')

Expand Down
5 changes: 2 additions & 3 deletions emcmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import shlex
import shutil
import sys
from tools import shared
from tools import config
from tools import utils

from tools import config, shared, utils


#
Expand Down
4 changes: 2 additions & 2 deletions emconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import os
import shlex
import sys
from tools import building
from tools import shared

from tools import building, shared


#
Expand Down
5 changes: 2 additions & 3 deletions emmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
import shlex
import shutil
import sys
from tools import building
from tools import shared
from tools import utils

from tools import building, shared, utils


#
Expand Down
1 change: 1 addition & 0 deletions emranlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import sys

from tools import shared

shared.exec_process([shared.LLVM_RANLIB] + sys.argv[1:])
3 changes: 2 additions & 1 deletion emrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
from operator import itemgetter

if sys.version_info.major == 2:
from urllib import unquote

import SocketServer as socketserver
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
from urllib import unquote
from urlparse import urlsplit
else:
import socketserver
Expand Down
2 changes: 1 addition & 1 deletion emscan-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import sys

from tools import shared, cmdline, compile
from tools import cmdline, compile, shared

argv = sys.argv[1:]

Expand Down
1 change: 1 addition & 0 deletions emscons.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import os
import subprocess
import sys

from tools import building, utils

tool_path = utils.path_from_root('tools/scons/site_scons/site_tools/emscripten')
Expand Down
1 change: 1 addition & 0 deletions emstrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import sys

from tools import shared

shared.exec_process([shared.LLVM_STRIP] + sys.argv[1:])
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ lint.select = [
"COM",
"E",
"F",
"I",
"PERF",
"PIE",
"PL",
Expand Down
10 changes: 5 additions & 5 deletions test/benchmark/benchmark_sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import json
import os
import re
import sys
import subprocess
import sys

__scriptdir__ = os.path.dirname(os.path.abspath(__file__))
__testdir__ = os.path.dirname(os.path.dirname(__file__))
Expand All @@ -17,11 +17,11 @@
sys.path.insert(0, __rootpath__)
sys.path.insert(0, __testdir__)

from tools.shared import WINDOWS, CLANG_CXX, EMCC
from tools.shared import run_process
from tools.config import V8_ENGINE
from common import EMRUN, test_file
import clang_native
from common import EMRUN, test_file

from tools.config import V8_ENGINE
from tools.shared import CLANG_CXX, EMCC, WINDOWS, run_process

# System info
system_info = subprocess.check_output([EMRUN, '--system_info'], stderr=subprocess.STDOUT, text=True)
Expand Down
3 changes: 2 additions & 1 deletion test/clang_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import os
import platform
import sys
from tools.shared import PIPE, run_process, CLANG_CC, CLANG_CXX

from tools.shared import CLANG_CC, CLANG_CXX, PIPE, run_process
from tools.utils import MACOS, WINDOWS, path_from_root

logger = logging.getLogger('clang_native')
Expand Down
37 changes: 22 additions & 15 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.

from enum import Enum
from functools import wraps
from pathlib import Path
from subprocess import PIPE, STDOUT
from typing import Dict, Tuple
from urllib.parse import unquote, unquote_plus, urlparse, parse_qs
from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler
from retryable_unittest import RetryableTestCase
import contextlib
import difflib
import hashlib
Expand All @@ -19,7 +11,7 @@
import json
import logging
import os
import psutil
import queue
import re
import shlex
import shutil
Expand All @@ -31,18 +23,33 @@
import textwrap
import threading
import time
import webbrowser
import unittest
import queue
import webbrowser
from enum import Enum
from functools import wraps
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from subprocess import PIPE, STDOUT
from typing import Dict, Tuple
from urllib.parse import parse_qs, unquote, unquote_plus, urlparse

import clang_native
import jsrun
import line_endings
from tools.shared import EMCC, EMXX, DEBUG
from tools.shared import get_canonical_temp_dir, path_from_root
from tools.utils import MACOS, WINDOWS, read_file, read_binary, write_binary, exit_with_error
import psutil
from retryable_unittest import RetryableTestCase

from tools import building, config, feature_matrix, shared, utils
from tools.settings import COMPILE_TIME_SETTINGS
from tools import shared, feature_matrix, building, config, utils
from tools.shared import DEBUG, EMCC, EMXX, get_canonical_temp_dir, path_from_root
from tools.utils import (
MACOS,
WINDOWS,
exit_with_error,
read_binary,
read_file,
write_binary,
)

logger = logging.getLogger('common')

Expand Down
3 changes: 2 additions & 1 deletion test/jsrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.

import common
import logging
import os
import shlex
import subprocess
import sys
from subprocess import PIPE, CalledProcessError

import common

from tools import utils

WORKING_ENGINES = {} # Holds all configured engines and whether they work: maps path -> True/False
Expand Down
6 changes: 2 additions & 4 deletions test/parallel_testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
import tempfile
import time
import unittest
from tools import emprofile
from tools import utils

import common
from common import errlog

from tools.colored_logger import with_color, CYAN, GREEN, RED
from tools import emprofile, utils
from tools.colored_logger import CYAN, GREEN, RED, with_color
from tools.utils import WINDOWS


NUM_CORES = None
seen_class = set()
torn_down = False
Expand Down
3 changes: 2 additions & 1 deletion test/retryable_unittest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import common
import os
import unittest

import common

EMTEST_RETRY_COUNT = int(os.getenv('EMTEST_RETRY_COUNT', '0'))


Expand Down
8 changes: 4 additions & 4 deletions test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
import platform
import random
import sys
import unittest
import time
import unittest
from functools import cmp_to_key

# Setup

__rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, __rootpath__)

import common
import jsrun
import parallel_testsuite
import common
from common import errlog
from tools import shared, config, utils

from tools import config, shared, utils

sys.path.append(utils.path_from_root('third_party/websockify'))

Expand Down Expand Up @@ -421,7 +421,7 @@ def run_tests(options, suites):
os.makedirs('out', exist_ok=True)
# output fd must remain open until after testRunner.run() below
output = open('out/test-results.xml', 'wb')
import xmlrunner # type: ignore
import xmlrunner # type: ignore
testRunner = xmlrunner.XMLTestRunner(output=output, verbosity=2,
failfast=options.failfast)
print('Writing XML test output to ' + os.path.abspath(output.name))
Expand Down
4 changes: 2 additions & 2 deletions test/sockets/socket_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
communication. We need to actually listen on both ports.
"""

import sys
import socket
import time
import sys
import threading
import time
from typing import Optional

ports = [int(sys.argv[1]), int(sys.argv[2])]
Expand Down
Loading