Bug 1790816 - Reformat js/ with isort. r=linter-reviewers,ahal DONTBUILD
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D162664
This commit is contained in:
@@ -39,11 +39,11 @@
|
|||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
import buildconfig
|
import buildconfig
|
||||||
import mozpack.path as mozpath
|
import mozpack.path as mozpath
|
||||||
|
|||||||
@@ -42,33 +42,36 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import tempfile
|
import tempfile
|
||||||
import yaml
|
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
from functools import partial, total_ordering
|
from functools import partial, total_ordering
|
||||||
from itertools import chain, groupby, tee
|
from itertools import chain, groupby, tee
|
||||||
from operator import attrgetter, itemgetter
|
from operator import attrgetter, itemgetter
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
if sys.version_info.major == 2:
|
if sys.version_info.major == 2:
|
||||||
from itertools import (
|
from itertools import ifilter as filter
|
||||||
ifilter as filter,
|
from itertools import ifilterfalse as filterfalse
|
||||||
ifilterfalse as filterfalse,
|
from itertools import imap as map
|
||||||
imap as map,
|
from itertools import izip_longest as zip_longest
|
||||||
izip_longest as zip_longest,
|
|
||||||
)
|
from urllib2 import Request as UrlRequest
|
||||||
from urllib2 import urlopen, Request as UrlRequest
|
from urllib2 import urlopen
|
||||||
from urlparse import urlsplit
|
from urlparse import urlsplit
|
||||||
else:
|
else:
|
||||||
from itertools import filterfalse, zip_longest
|
from itertools import filterfalse, zip_longest
|
||||||
from urllib.request import urlopen, Request as UrlRequest
|
|
||||||
from urllib.parse import urlsplit
|
from urllib.parse import urlsplit
|
||||||
|
from urllib.request import Request as UrlRequest
|
||||||
|
from urllib.request import urlopen
|
||||||
|
|
||||||
|
|
||||||
# From https://docs.python.org/3/library/itertools.html
|
# From https://docs.python.org/3/library/itertools.html
|
||||||
|
|||||||
@@ -8,15 +8,14 @@ import argparse
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import re
|
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import posixpath
|
import posixpath
|
||||||
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from collections import Counter, namedtuple
|
from collections import Counter, namedtuple
|
||||||
from logging import info
|
from logging import info
|
||||||
from os import environ as env
|
from os import environ as env
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
# Works with python2.6
|
# Works with python2.6
|
||||||
|
|
||||||
|
import json
|
||||||
|
import math
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import math
|
|
||||||
import json
|
|
||||||
from subprocess import Popen, PIPE
|
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
from subprocess import PIPE, Popen
|
||||||
|
|
||||||
|
|
||||||
class Test:
|
class Test:
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
Runs the static rooting analysis
|
Runs the static rooting analysis
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from subprocess import Popen
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from subprocess import Popen
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from shlex import quote
|
from shlex import quote
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Process some integers.")
|
parser = argparse.ArgumentParser(description="Process some integers.")
|
||||||
|
|||||||
@@ -13,21 +13,15 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from mach.base import FailedCommandError, MachError
|
|
||||||
from mach.decorators import (
|
|
||||||
CommandArgument,
|
|
||||||
Command,
|
|
||||||
SubCommand,
|
|
||||||
)
|
|
||||||
from mach.registrar import Registrar
|
|
||||||
|
|
||||||
from mozbuild.mozconfig import MozconfigLoader
|
|
||||||
|
|
||||||
# Command files like this are listed in build/mach_initialize.py in alphabetical
|
# Command files like this are listed in build/mach_initialize.py in alphabetical
|
||||||
# order, but we need to access commands earlier in the sorted order to grab
|
# order, but we need to access commands earlier in the sorted order to grab
|
||||||
# their arguments. Force them to load now.
|
# their arguments. Force them to load now.
|
||||||
import mozbuild.artifact_commands # NOQA: F401
|
import mozbuild.artifact_commands # NOQA: F401
|
||||||
import mozbuild.build_commands # NOQA: F401
|
import mozbuild.build_commands # NOQA: F401
|
||||||
|
from mach.base import FailedCommandError, MachError
|
||||||
|
from mach.decorators import Command, CommandArgument, SubCommand
|
||||||
|
from mach.registrar import Registrar
|
||||||
|
from mozbuild.mozconfig import MozconfigLoader
|
||||||
|
|
||||||
|
|
||||||
# Use a decorator to copy command arguments off of the named command. Instead
|
# Use a decorator to copy command arguments off of the named command. Instead
|
||||||
|
|||||||
@@ -5,11 +5,10 @@
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import argparse
|
||||||
import os
|
import os
|
||||||
import site
|
import site
|
||||||
import subprocess
|
import subprocess
|
||||||
import argparse
|
|
||||||
|
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
scriptdir = os.path.abspath(os.path.dirname(__file__))
|
scriptdir = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import os
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from collections import defaultdict, namedtuple
|
||||||
|
|
||||||
from sixgill import Body
|
from sixgill import Body
|
||||||
from collections import defaultdict, namedtuple
|
|
||||||
|
|
||||||
scriptdir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
scriptdir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@@ -54,8 +54,8 @@
|
|||||||
# NOTE: If you add new phases here the current next phase kind number can be
|
# NOTE: If you add new phases here the current next phase kind number can be
|
||||||
# found at the end of js/src/gc/StatsPhasesGenerated.inc
|
# found at the end of js/src/gc/StatsPhasesGenerated.inc
|
||||||
|
|
||||||
import re
|
|
||||||
import collections
|
import collections
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class PhaseKind:
|
class PhaseKind:
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
|
|
||||||
# flake8: noqa: F821
|
# flake8: noqa: F821
|
||||||
|
|
||||||
import gdb
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
import gdb
|
||||||
|
|
||||||
# testlibdir is set on the GDB command line, via --eval-command python testlibdir=...
|
# testlibdir is set on the GDB command line, via --eval-command python testlibdir=...
|
||||||
sys.path[0:0] = [testlibdir]
|
sys.path[0:0] = [testlibdir]
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
import mozilla.prettyprinters
|
import mozilla.prettyprinters
|
||||||
|
|
||||||
from mozilla.prettyprinters import pretty_printer
|
from mozilla.prettyprinters import pretty_printer
|
||||||
|
|
||||||
# Forget any printers from previous loads of this module.
|
# Forget any printers from previous loads of this module.
|
||||||
|
|||||||
@@ -11,11 +11,12 @@ This python script should be sourced within GDB after loading the python scripts
|
|||||||
provided with SpiderMonkey.
|
provided with SpiderMonkey.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import gdb
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
import gdb
|
||||||
import mozilla.prettyprinters
|
import mozilla.prettyprinters
|
||||||
from mozilla.prettyprinters import pretty_printer
|
from mozilla.prettyprinters import pretty_printer
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,12 @@
|
|||||||
# Pretty-printers for SpiderMonkey JSObjects.
|
# Pretty-printers for SpiderMonkey JSObjects.
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
import mozilla.prettyprinters as prettyprinters
|
import mozilla.prettyprinters as prettyprinters
|
||||||
|
from mozilla.CellHeader import get_header_ptr
|
||||||
from mozilla.jsval import JSValue
|
from mozilla.jsval import JSValue
|
||||||
from mozilla.prettyprinters import ptr_pretty_printer, ref_pretty_printer
|
from mozilla.prettyprinters import ptr_pretty_printer, ref_pretty_printer
|
||||||
from mozilla.CellHeader import get_header_ptr
|
|
||||||
|
|
||||||
prettyprinters.clear_module_printers(__name__)
|
prettyprinters.clear_module_printers(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
import mozilla.prettyprinters
|
import mozilla.prettyprinters
|
||||||
from mozilla.prettyprinters import ptr_pretty_printer
|
|
||||||
from mozilla.CellHeader import get_header_length_and_flags
|
from mozilla.CellHeader import get_header_length_and_flags
|
||||||
|
from mozilla.prettyprinters import ptr_pretty_printer
|
||||||
|
|
||||||
try:
|
try:
|
||||||
chr(10000) # UPPER RIGHT PENCIL
|
chr(10000) # UPPER RIGHT PENCIL
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
# Pretty-printer for SpiderMonkey symbols.
|
# Pretty-printer for SpiderMonkey symbols.
|
||||||
|
|
||||||
import mozilla.prettyprinters
|
import mozilla.prettyprinters
|
||||||
from mozilla.prettyprinters import ptr_pretty_printer
|
|
||||||
from mozilla.CellHeader import get_header_ptr
|
from mozilla.CellHeader import get_header_ptr
|
||||||
|
from mozilla.prettyprinters import ptr_pretty_printer
|
||||||
|
|
||||||
# Forget any printers from previous loads of this module.
|
# Forget any printers from previous loads of this module.
|
||||||
mozilla.prettyprinters.clear_module_printers(__name__)
|
mozilla.prettyprinters.clear_module_printers(__name__)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
import mozilla.prettyprinters
|
import mozilla.prettyprinters
|
||||||
import mozilla.Root
|
import mozilla.Root
|
||||||
|
|
||||||
from mozilla.prettyprinters import pretty_printer
|
from mozilla.prettyprinters import pretty_printer
|
||||||
|
|
||||||
# Forget any printers from previous loads of this module.
|
# Forget any printers from previous loads of this module.
|
||||||
|
|||||||
@@ -8,21 +8,21 @@ print("Loading JavaScript value pretty-printers; see js/src/gdb/README.")
|
|||||||
print("If they cause trouble, type: disable pretty-printer .* SpiderMonkey")
|
print("If they cause trouble, type: disable pretty-printer .* SpiderMonkey")
|
||||||
|
|
||||||
import gdb.printing
|
import gdb.printing
|
||||||
import mozilla.prettyprinters
|
import mozilla.ExecutableAllocator
|
||||||
|
|
||||||
# Import the pretty-printer modules. As a side effect, loading these
|
# Import the pretty-printer modules. As a side effect, loading these
|
||||||
# modules registers their printers with mozilla.prettyprinters.
|
# modules registers their printers with mozilla.prettyprinters.
|
||||||
import mozilla.GCCellPtr
|
import mozilla.GCCellPtr
|
||||||
import mozilla.ExecutableAllocator
|
|
||||||
import mozilla.Interpreter
|
import mozilla.Interpreter
|
||||||
import mozilla.IonGraph
|
import mozilla.IonGraph
|
||||||
import mozilla.JSObject
|
import mozilla.JSObject
|
||||||
|
import mozilla.jsop
|
||||||
import mozilla.JSString
|
import mozilla.JSString
|
||||||
import mozilla.JSSymbol
|
import mozilla.JSSymbol
|
||||||
import mozilla.Root
|
|
||||||
import mozilla.PropertyKey
|
|
||||||
import mozilla.jsop
|
|
||||||
import mozilla.jsval
|
import mozilla.jsval
|
||||||
|
import mozilla.prettyprinters
|
||||||
|
import mozilla.PropertyKey
|
||||||
|
import mozilla.Root
|
||||||
import mozilla.unwind
|
import mozilla.unwind
|
||||||
|
|
||||||
# The user may have personal pretty-printers. Get those, too, if they exist.
|
# The user may have personal pretty-printers. Get those, too, if they exist.
|
||||||
|
|||||||
@@ -10,9 +10,10 @@
|
|||||||
# => 0x240e954ac13a: pushq (%rbx)
|
# => 0x240e954ac13a: pushq (%rbx)
|
||||||
# (rr) jitsrc 0x240e954ac13a
|
# (rr) jitsrc 0x240e954ac13a
|
||||||
|
|
||||||
import gdb
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
import gdb
|
||||||
|
|
||||||
# (base_name, hops, func_name, source_var, dest_var) tuples, such that :
|
# (base_name, hops, func_name, source_var, dest_var) tuples, such that :
|
||||||
# - `base_name`: a regex matching the name of the function that implements
|
# - `base_name`: a regex matching the name of the function that implements
|
||||||
# the actual write
|
# the actual write
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
|
|
||||||
# Pretty-printers for SpiderMonkey's JS::Value.
|
# Pretty-printers for SpiderMonkey's JS::Value.
|
||||||
|
|
||||||
|
import struct
|
||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
import gdb.types
|
import gdb.types
|
||||||
import struct
|
|
||||||
import mozilla.prettyprinters
|
import mozilla.prettyprinters
|
||||||
from mozilla.prettyprinters import pretty_printer
|
from mozilla.prettyprinters import pretty_printer
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
|
|
||||||
# mozilla/prettyprinters.py --- infrastructure for SpiderMonkey's auto-loaded pretty-printers.
|
# mozilla/prettyprinters.py --- infrastructure for SpiderMonkey's auto-loaded pretty-printers.
|
||||||
|
|
||||||
import gdb
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
import gdb
|
||||||
|
|
||||||
# Decorators for declaring pretty-printers.
|
# Decorators for declaring pretty-printers.
|
||||||
#
|
#
|
||||||
# In each case, the decoratee should be a SpiderMonkey-style pretty-printer
|
# In each case, the decoratee should be a SpiderMonkey-style pretty-printer
|
||||||
|
|||||||
@@ -4,12 +4,13 @@
|
|||||||
|
|
||||||
# mozilla/unwind.py --- unwinder and frame filter for SpiderMonkey
|
# mozilla/unwind.py --- unwinder and frame filter for SpiderMonkey
|
||||||
|
|
||||||
|
import platform
|
||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
import gdb.types
|
import gdb.types
|
||||||
from gdb.FrameDecorator import FrameDecorator
|
from gdb.FrameDecorator import FrameDecorator
|
||||||
from mozilla.JSObject import get_function_name, get_function_script
|
from mozilla.JSObject import get_function_name, get_function_script
|
||||||
from mozilla.prettyprinters import TypeCache
|
from mozilla.prettyprinters import TypeCache
|
||||||
import platform
|
|
||||||
|
|
||||||
# For ease of use in Python 2, we use "long" instead of "int"
|
# For ease of use in Python 2, we use "long" instead of "int"
|
||||||
# everywhere.
|
# everywhere.
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
# Text progress bar library, like curl or scp.
|
# Text progress bar library, like curl or scp.
|
||||||
|
|
||||||
import sys
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import fcntl
|
|||||||
import os
|
import os
|
||||||
import select
|
import select
|
||||||
import time
|
import time
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import PIPE, Popen
|
||||||
|
|
||||||
|
|
||||||
class TaskPool(object):
|
class TaskPool(object):
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
read_input = input
|
read_input = input
|
||||||
if sys.version_info.major == 2:
|
if sys.version_info.major == 2:
|
||||||
read_input = raw_input
|
read_input = raw_input
|
||||||
@@ -31,14 +30,14 @@ def add_tests_dir_to_path():
|
|||||||
add_tests_dir_to_path()
|
add_tests_dir_to_path()
|
||||||
|
|
||||||
from lib import jittests
|
from lib import jittests
|
||||||
|
from lib.tempfile import TemporaryDirectory
|
||||||
from lib.tests import (
|
from lib.tests import (
|
||||||
get_jitflags,
|
change_env,
|
||||||
valid_jitflags,
|
|
||||||
get_cpu_count,
|
get_cpu_count,
|
||||||
get_environment_overlay,
|
get_environment_overlay,
|
||||||
change_env,
|
get_jitflags,
|
||||||
|
valid_jitflags,
|
||||||
)
|
)
|
||||||
from lib.tempfile import TemporaryDirectory
|
|
||||||
|
|
||||||
|
|
||||||
def which(name):
|
def which(name):
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
# This script generates jit/CacheIROpsGenerated.h from CacheIROps.yaml
|
# This script generates jit/CacheIROpsGenerated.h from CacheIROps.yaml
|
||||||
|
|
||||||
import buildconfig
|
|
||||||
import yaml
|
|
||||||
import six
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
import buildconfig
|
||||||
|
import six
|
||||||
|
import yaml
|
||||||
from mozbuild.preprocessor import Preprocessor
|
from mozbuild.preprocessor import Preprocessor
|
||||||
|
|
||||||
HEADER_TEMPLATE = """\
|
HEADER_TEMPLATE = """\
|
||||||
|
|||||||
@@ -5,10 +5,11 @@
|
|||||||
# This script generates jit/LIROpsGenerated.h (list of LIR instructions)
|
# This script generates jit/LIROpsGenerated.h (list of LIR instructions)
|
||||||
# from LIROps.yaml.
|
# from LIROps.yaml.
|
||||||
|
|
||||||
import buildconfig
|
|
||||||
import yaml
|
|
||||||
import six
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
import buildconfig
|
||||||
|
import six
|
||||||
|
import yaml
|
||||||
from mozbuild.preprocessor import Preprocessor
|
from mozbuild.preprocessor import Preprocessor
|
||||||
|
|
||||||
HEADER_TEMPLATE = """\
|
HEADER_TEMPLATE = """\
|
||||||
|
|||||||
@@ -5,10 +5,11 @@
|
|||||||
# This script generates jit/MIROpsGenerated.h (list of MIR instructions)
|
# This script generates jit/MIROpsGenerated.h (list of MIR instructions)
|
||||||
# from MIROps.yaml, as well as MIR op definitions.
|
# from MIROps.yaml, as well as MIR op definitions.
|
||||||
|
|
||||||
import buildconfig
|
|
||||||
import yaml
|
|
||||||
import six
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
import buildconfig
|
||||||
|
import six
|
||||||
|
import yaml
|
||||||
from mozbuild.preprocessor import Preprocessor
|
from mozbuild.preprocessor import Preprocessor
|
||||||
|
|
||||||
HEADER_TEMPLATE = """\
|
HEADER_TEMPLATE = """\
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
# This script will be installed into $objdir/dist/bin. Add $objdir to gdb's
|
# This script will be installed into $objdir/dist/bin. Add $objdir to gdb's
|
||||||
# source search path and load in the Gecko+JS init file.
|
# source search path and load in the Gecko+JS init file.
|
||||||
|
|
||||||
import gdb
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from os.path import abspath, dirname
|
from os.path import abspath, dirname
|
||||||
|
|
||||||
|
import gdb
|
||||||
|
|
||||||
devel_objdir = abspath(os.path.join(dirname(__file__), "..", ".."))
|
devel_objdir = abspath(os.path.join(dirname(__file__), "..", ".."))
|
||||||
m = re.search(r"[\w ]+: (.*)", gdb.execute("show dir", False, True))
|
m = re.search(r"[\w ]+: (.*)", gdb.execute("show dir", False, True))
|
||||||
if m and devel_objdir not in m.group(1).split(":"):
|
if m and devel_objdir not in m.group(1).split(":"):
|
||||||
|
|||||||
@@ -13,31 +13,30 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import posixpath
|
import posixpath
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import platform
|
|
||||||
|
|
||||||
from os.path import abspath, dirname, isfile, realpath
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from subprocess import list2cmdline, call
|
from os.path import abspath, dirname, isfile, realpath
|
||||||
|
from subprocess import call, list2cmdline
|
||||||
|
|
||||||
|
from lib.adaptor import xdr_annotate
|
||||||
|
from lib.progressbar import ProgressBar
|
||||||
|
from lib.results import ResultsSink, TestOutput
|
||||||
|
from lib.tempfile import TemporaryDirectory
|
||||||
from lib.tests import (
|
from lib.tests import (
|
||||||
RefTestCase,
|
RefTestCase,
|
||||||
get_jitflags,
|
change_env,
|
||||||
get_cpu_count,
|
get_cpu_count,
|
||||||
get_environment_overlay,
|
get_environment_overlay,
|
||||||
change_env,
|
get_jitflags,
|
||||||
)
|
)
|
||||||
from lib.results import ResultsSink, TestOutput
|
|
||||||
from lib.progressbar import ProgressBar
|
|
||||||
from lib.adaptor import xdr_annotate
|
|
||||||
from lib.tempfile import TemporaryDirectory
|
|
||||||
|
|
||||||
if sys.platform.startswith("linux") or sys.platform.startswith("darwin"):
|
if sys.platform.startswith("linux") or sys.platform.startswith("darwin"):
|
||||||
from lib.tasks_unix import run_all_tests
|
from lib.tasks_unix import run_all_tests
|
||||||
@@ -539,7 +538,7 @@ def load_wpt_tests(xul_tester, requested_paths, excluded_paths, update_manifest=
|
|||||||
sys.path[0:0] = abs_sys_paths
|
sys.path[0:0] = abs_sys_paths
|
||||||
|
|
||||||
import manifestupdate
|
import manifestupdate
|
||||||
from wptrunner import products, testloader, wptcommandline, wpttest, wptlogging
|
from wptrunner import products, testloader, wptcommandline, wptlogging, wpttest
|
||||||
|
|
||||||
manifest_root = tempfile.gettempdir()
|
manifest_root = tempfile.gettempdir()
|
||||||
(maybe_dist, maybe_bin) = os.path.split(os.path.dirname(xul_tester.js_bin))
|
(maybe_dist, maybe_bin) = os.path.split(os.path.dirname(xul_tester.js_bin))
|
||||||
@@ -799,7 +798,7 @@ def main():
|
|||||||
if options.remote:
|
if options.remote:
|
||||||
results = ResultsSink("jstests", options, test_count)
|
results = ResultsSink("jstests", options, test_count)
|
||||||
try:
|
try:
|
||||||
from lib.remote import init_remote_dir, init_device
|
from lib.remote import init_device, init_remote_dir
|
||||||
|
|
||||||
device = init_device(options)
|
device = init_device(options)
|
||||||
tempdir = posixpath.join(options.remote_test_root, "tmp")
|
tempdir = posixpath.join(options.remote_test_root, "tmp")
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
# jit_test.py -- Python harness for JavaScript trace tests.
|
# jit_test.py -- Python harness for JavaScript trace tests.
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@@ -18,7 +19,7 @@ if sys.platform.startswith("linux") or sys.platform.startswith("darwin"):
|
|||||||
else:
|
else:
|
||||||
from .tasks_win import run_all_tests
|
from .tasks_win import run_all_tests
|
||||||
|
|
||||||
from .progressbar import ProgressBar, NullProgressBar
|
from .progressbar import NullProgressBar, ProgressBar
|
||||||
from .results import escape_cmdline
|
from .results import escape_cmdline
|
||||||
from .structuredlog import TestLogger
|
from .structuredlog import TestLogger
|
||||||
from .tempfile import TemporaryDirectory
|
from .tempfile import TemporaryDirectory
|
||||||
@@ -799,9 +800,10 @@ def run_tests_local(tests, num_tests, prefix, options, slog):
|
|||||||
|
|
||||||
def run_tests_remote(tests, num_tests, prefix, options, slog):
|
def run_tests_remote(tests, num_tests, prefix, options, slog):
|
||||||
# Setup device with everything needed to run our tests.
|
# Setup device with everything needed to run our tests.
|
||||||
from .tasks_adb_remote import get_remote_results
|
|
||||||
from mozdevice import ADBError, ADBTimeoutError
|
from mozdevice import ADBError, ADBTimeoutError
|
||||||
|
|
||||||
|
from .tasks_adb_remote import get_remote_results
|
||||||
|
|
||||||
# Run all tests.
|
# Run all tests.
|
||||||
pb = create_progressbar(num_tests, options)
|
pb = create_progressbar(num_tests, options)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import io
|
|||||||
import os
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
import re
|
import re
|
||||||
import six
|
|
||||||
import sys
|
import sys
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import PIPE, Popen
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
from .remote import init_device
|
from .remote import init_device
|
||||||
from .tests import RefTestCase
|
from .tests import RefTestCase
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
from __future__ import print_function, unicode_literals, division
|
from __future__ import division, print_function, unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from mozdevice import ADBDevice, ADBError, ADBTimeoutError, ADBProcessError
|
|
||||||
|
|
||||||
from .results import TestOutput, escape_cmdline
|
from mozdevice import ADBDevice, ADBError, ADBProcessError, ADBTimeoutError
|
||||||
|
|
||||||
from .adaptor import xdr_annotate
|
from .adaptor import xdr_annotate
|
||||||
from .remote import init_device
|
from .remote import init_device
|
||||||
|
from .results import TestOutput, escape_cmdline
|
||||||
|
|
||||||
TESTS_LIB_DIR = os.path.dirname(os.path.abspath(__file__))
|
TESTS_LIB_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
JS_DIR = os.path.dirname(os.path.dirname(TESTS_LIB_DIR))
|
JS_DIR = os.path.dirname(os.path.dirname(TESTS_LIB_DIR))
|
||||||
|
|||||||
@@ -7,16 +7,11 @@ import os
|
|||||||
import select
|
import select
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from .progressbar import ProgressBar
|
|
||||||
from .results import (
|
|
||||||
NullTestOutput,
|
|
||||||
TestOutput,
|
|
||||||
escape_cmdline,
|
|
||||||
)
|
|
||||||
from .adaptor import xdr_annotate
|
from .adaptor import xdr_annotate
|
||||||
|
from .progressbar import ProgressBar
|
||||||
|
from .results import NullTestOutput, TestOutput, escape_cmdline
|
||||||
|
|
||||||
|
|
||||||
class Task(object):
|
class Task(object):
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
from __future__ import print_function, unicode_literals, division
|
from __future__ import division, print_function, unicode_literals
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from six.moves.queue import Queue, Empty
|
|
||||||
|
|
||||||
|
from six.moves.queue import Empty, Queue
|
||||||
|
|
||||||
|
from .adaptor import xdr_annotate
|
||||||
from .progressbar import ProgressBar
|
from .progressbar import ProgressBar
|
||||||
from .results import NullTestOutput, TestOutput, escape_cmdline
|
from .results import NullTestOutput, TestOutput, escape_cmdline
|
||||||
from .adaptor import xdr_annotate
|
|
||||||
|
|
||||||
|
|
||||||
class EndMarker:
|
class EndMarker:
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ try:
|
|||||||
# Python 3.2
|
# Python 3.2
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import tempfile
|
|
||||||
import shutil
|
import shutil
|
||||||
|
import tempfile
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ GetConsoleScreenBufferInfo.
|
|||||||
$Id: color_console.py 534 2009-05-10 04:00:59Z andre $
|
$Id: color_console.py 534 2009-05-10 04:00:59Z andre $
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ctypes import windll, Structure, c_short, c_ushort, byref
|
from ctypes import Structure, byref, c_short, c_ushort, windll
|
||||||
|
|
||||||
SHORT = c_short
|
SHORT = c_short
|
||||||
WORD = c_ushort
|
WORD = c_ushort
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ Arguments:
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import json
|
||||||
import math
|
import math
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import subprocess as subp
|
import subprocess as subp
|
||||||
import sys
|
import sys
|
||||||
import json
|
|
||||||
from string import Template
|
from string import Template
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# Adapted from https://github.com/tc39/test262/blob/main/tools/generation/test/run.py
|
# Adapted from https://github.com/tc39/test262/blob/main/tools/generation/test/run.py
|
||||||
|
|
||||||
|
import contextlib
|
||||||
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import contextlib
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
testDir = os.path.dirname(os.path.relpath(__file__))
|
testDir = os.path.dirname(os.path.relpath(__file__))
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
# Skip all common files used to support tests for jstests
|
# Skip all common files used to support tests for jstests
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ from __future__ import print_function
|
|||||||
import contextlib
|
import contextlib
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import tempfile
|
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
@@ -565,7 +564,6 @@ def fetch_local_changes(inDir, outDir, srcDir, strictTests):
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
# TODO: fail if it's in the default branch? or require a branch name?
|
# TODO: fail if it's in the default branch? or require a branch name?
|
||||||
|
|
||||||
# Checks for unstaged or non committed files. A clean branch provides a clean status.
|
# Checks for unstaged or non committed files. A clean branch provides a clean status.
|
||||||
status = subprocess.check_output(
|
status = subprocess.check_output(
|
||||||
("git -C %s status --porcelain" % srcDir).split(" ")
|
("git -C %s status --porcelain" % srcDir).split(" ")
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ from __future__ import print_function, unicode_literals
|
|||||||
|
|
||||||
import csv
|
import csv
|
||||||
import io
|
import io
|
||||||
import re
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@@ -33,7 +33,10 @@ from operator import is_not, itemgetter
|
|||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
if sys.version_info.major == 2:
|
if sys.version_info.major == 2:
|
||||||
from itertools import ifilter as filter, imap as map, izip_longest as zip_longest
|
from itertools import ifilter as filter
|
||||||
|
from itertools import imap as map
|
||||||
|
from itertools import izip_longest as zip_longest
|
||||||
|
|
||||||
from urllib2 import urlopen
|
from urllib2 import urlopen
|
||||||
|
|
||||||
range = xrange
|
range = xrange
|
||||||
|
|||||||
@@ -14,18 +14,17 @@
|
|||||||
https://developer.mozilla.org/en-US/docs/SpiderMonkey/Internals/Bytecode
|
https://developer.mozilla.org/en-US/docs/SpiderMonkey/Internals/Bytecode
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
# Allow this script to be run from anywhere.
|
# Allow this script to be run from anywhere.
|
||||||
this_dir = os.path.dirname(os.path.realpath(__file__))
|
this_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
sys.path.insert(0, this_dir)
|
sys.path.insert(0, this_dir)
|
||||||
|
|
||||||
|
|
||||||
import jsopcode
|
|
||||||
from xml.sax.saxutils import escape
|
from xml.sax.saxutils import escape
|
||||||
|
|
||||||
|
import jsopcode
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import markdown
|
import markdown
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import buildconfig
|
|
||||||
import yaml
|
|
||||||
import six
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
import buildconfig
|
||||||
|
import six
|
||||||
|
import yaml
|
||||||
from mozbuild.preprocessor import Preprocessor
|
from mozbuild.preprocessor import Preprocessor
|
||||||
|
|
||||||
HEADER_TEMPLATE = """\
|
HEADER_TEMPLATE = """\
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from __future__ import absolute_import, print_function
|
|
||||||
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
from __future__ import absolute_import, print_function
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import struct
|
import struct
|
||||||
|
|||||||
@@ -6,10 +6,7 @@ import argparse
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from mach.decorators import (
|
from mach.decorators import Command, CommandArgument
|
||||||
Command,
|
|
||||||
CommandArgument,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@Command("xpcshell", category="misc", description="Run the xpcshell binary")
|
@Command("xpcshell", category="misc", description="Run the xpcshell binary")
|
||||||
|
|||||||
Reference in New Issue
Block a user