Backed out changeset 6c32452df00e (bug 1238305) for cpp test failures a=backout

This commit is contained in:
Wes Kocher 2016-11-02 12:18:58 -07:00
Родитель 7bcb4fd669
Коммит 41d2aeeed2
5 изменённых файлов: 5 добавлений и 28 удалений

Просмотреть файл

@ -376,18 +376,14 @@ class MachCommands(MachCommandBase):
else: else:
manifest_path = None manifest_path = None
utility_path = self.bindir
if conditions.is_android(self): if conditions.is_android(self):
from mozrunner.devices.android_device import verify_android_device from mozrunner.devices.android_device import verify_android_device
verify_android_device(self, install=False) verify_android_device(self, install=False)
return self.run_android_test(tests, symbols_path, manifest_path, log) return self.run_android_test(tests, symbols_path, manifest_path, log)
return self.run_desktop_test(tests, symbols_path, manifest_path, return self.run_desktop_test(tests, symbols_path, manifest_path, log)
utility_path, log)
def run_desktop_test(self, tests, symbols_path, manifest_path, utility_path, def run_desktop_test(self, tests, symbols_path, manifest_path, log):
log):
import runcppunittests as cppunittests import runcppunittests as cppunittests
from mozlog import commandline from mozlog import commandline
@ -397,7 +393,6 @@ class MachCommands(MachCommandBase):
options.symbols_path = symbols_path options.symbols_path = symbols_path
options.manifest_path = manifest_path options.manifest_path = manifest_path
options.utility_path = utility_path
options.xre_path = self.bindir options.xre_path = self.bindir
try: try:

Просмотреть файл

@ -80,7 +80,6 @@ config = {
"cppunittest": { "cppunittest": {
"options": [ "options": [
"--symbols-path=%(symbols_path)s", "--symbols-path=%(symbols_path)s",
"--utility-path=tests/bin",
"--xre-path=%(abs_app_dir)s" "--xre-path=%(abs_app_dir)s"
], ],
"run_filename": "runcppunittests.py", "run_filename": "runcppunittests.py",

Просмотреть файл

@ -57,7 +57,6 @@ config = {
"cppunittest": { "cppunittest": {
"options": [ "options": [
"--symbols-path=%(symbols_path)s", "--symbols-path=%(symbols_path)s",
"--utility-path=tests/bin",
"--xre-path=%(abs_res_dir)s" "--xre-path=%(abs_res_dir)s"
], ],
"run_filename": "runcppunittests.py", "run_filename": "runcppunittests.py",

Просмотреть файл

@ -68,7 +68,6 @@ config = {
"cppunittest": { "cppunittest": {
"options": [ "options": [
"--symbols-path=%(symbols_path)s", "--symbols-path=%(symbols_path)s",
"--utility-path=tests/bin",
"--xre-path=%(abs_app_dir)s" "--xre-path=%(abs_app_dir)s"
], ],
"run_filename": "runcppunittests.py", "run_filename": "runcppunittests.py",

Просмотреть файл

@ -14,7 +14,6 @@ import mozcrash
import mozfile import mozfile
import mozlog import mozlog
from contextlib import contextmanager from contextlib import contextmanager
from mozrunner.utils import get_stack_fixer_function
from subprocess import PIPE from subprocess import PIPE
SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__))) SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
@ -61,11 +60,7 @@ class CPPUnitTests(object):
outputTimeout=CPPUnitTests.TEST_PROC_NO_OUTPUT_TIMEOUT) outputTimeout=CPPUnitTests.TEST_PROC_NO_OUTPUT_TIMEOUT)
proc.wait() proc.wait()
if proc.output: if proc.output:
if self.fix_stack: output = "\n%s" % "\n".join(proc.output)
procOutput = [self.fix_stack(l) for l in proc.output]
else:
procOutput = proc.output
output = "\n%s" % "\n".join(procOutput)
self.log.process_output(proc.pid, output, command=[prog]) self.log.process_output(proc.pid, output, command=[prog])
if proc.timedOut: if proc.timedOut:
message = "timed out after %d seconds" % CPPUnitTests.TEST_PROC_TIMEOUT message = "timed out after %d seconds" % CPPUnitTests.TEST_PROC_TIMEOUT
@ -142,7 +137,7 @@ class CPPUnitTests(object):
return env return env
def run_tests(self, programs, xre_path, symbols_path=None, utility_path=None, interactive=False): def run_tests(self, programs, xre_path, symbols_path=None, interactive=False):
""" """
Run a set of C++ unit test programs. Run a set of C++ unit test programs.
@ -151,16 +146,12 @@ class CPPUnitTests(object):
* xre_path: A path to a directory containing a XUL Runtime Environment. * xre_path: A path to a directory containing a XUL Runtime Environment.
* symbols_path: A path to a directory containing Breakpad-formatted * symbols_path: A path to a directory containing Breakpad-formatted
symbol files for producing stack traces on crash. symbol files for producing stack traces on crash.
* utility_path: A path to a directory containing utility programs
(xpcshell et al)
Returns True if all test programs exited with a zero status, False Returns True if all test programs exited with a zero status, False
otherwise. otherwise.
""" """
self.xre_path = xre_path self.xre_path = xre_path
self.log = mozlog.get_default_logger() self.log = mozlog.get_default_logger()
if utility_path:
self.fix_stack = get_stack_fixer_function(utility_path, symbols_path)
self.log.suite_start(programs) self.log.suite_start(programs)
env = self.build_environment() env = self.build_environment()
pass_count = 0 pass_count = 0
@ -197,10 +188,6 @@ class CPPUnittestOptions(OptionParser):
action = "store", type = "string", dest = "manifest_path", action = "store", type = "string", dest = "manifest_path",
default = None, default = None,
help = "path to test manifest, if different from the path to test binaries") help = "path to test manifest, if different from the path to test binaries")
self.add_option("--utility-path",
action = "store", type = "string", dest = "utility_path",
default = None,
help = "path to directory containing utility programs")
def extract_unittests_from_args(args, environ, manifest_path): def extract_unittests_from_args(args, environ, manifest_path):
"""Extract unittests from args, expanding directories as needed""" """Extract unittests from args, expanding directories as needed"""
@ -252,10 +239,8 @@ def run_test_harness(options, args):
update_mozinfo() update_mozinfo()
progs = extract_unittests_from_args(args, mozinfo.info, options.manifest_path) progs = extract_unittests_from_args(args, mozinfo.info, options.manifest_path)
options.xre_path = os.path.abspath(options.xre_path) options.xre_path = os.path.abspath(options.xre_path)
options.utility_path = os.path.abspath(options.utility_path)
tester = CPPUnitTests() tester = CPPUnitTests()
result = tester.run_tests(progs, options.xre_path, options.symbols_path, result = tester.run_tests(progs, options.xre_path, options.symbols_path)
options.utility_path)
return result return result