Bug 1063728 - Run SpiderMonkey style checkers as part of the build instead of make check. r=chmanchester
This commit is contained in:
13
config/run_spidermonkey_checks.py
Normal file
13
config/run_spidermonkey_checks.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# 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, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import buildconfig
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def main(output, lib_file, *scripts):
|
||||
for script in scripts:
|
||||
retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
|
||||
if retcode != 0:
|
||||
raise Exception(script + " failed")
|
||||
@@ -49,18 +49,9 @@ JITTEST_SANITIZER_ENV=MSAN_SYMBOLIZER_PATH='$(LLVM_SYMBOLIZER)'
|
||||
endif
|
||||
endif
|
||||
|
||||
check-style::
|
||||
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_spidermonkey_style.py);
|
||||
|
||||
check-masm::
|
||||
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_macroassembler_style.py);
|
||||
|
||||
check-js-msg::
|
||||
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_js_msg_encoding.py);
|
||||
|
||||
check-opcode::
|
||||
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_js_opcode.py);
|
||||
|
||||
check-jit-test::
|
||||
$(JITTEST_SANITIZER_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
|
||||
--no-slow --no-progress --format=automation --jitflags=all \
|
||||
@@ -68,7 +59,7 @@ check-jit-test::
|
||||
$(JITTEST_EXTRA_ARGS) \
|
||||
$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX) $(JITTEST_TEST_ARGS)
|
||||
|
||||
check:: check-style check-masm check-js-msg check-opcode
|
||||
check:: check-js-msg
|
||||
|
||||
check-jstests:
|
||||
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/tests/jstests.py \
|
||||
|
||||
@@ -75,3 +75,15 @@ DIST_INSTALL = True
|
||||
# with those in libxul.
|
||||
if CONFIG['OS_TARGET'] == 'Linux':
|
||||
LDFLAGS += ['-Wl,-version-script,symverscript']
|
||||
|
||||
# Run SpiderMonkey style checker after linking the static library. This avoids
|
||||
# running the script for no-op builds.
|
||||
GENERATED_FILES += ['spidermonkey_checks']
|
||||
run_checks = GENERATED_FILES['spidermonkey_checks']
|
||||
run_checks.script = '/config/run_spidermonkey_checks.py'
|
||||
run_checks.inputs += [
|
||||
'!%sjs_static.%s' % (CONFIG['LIB_PREFIX'], CONFIG['LIB_SUFFIX']),
|
||||
'/config/check_spidermonkey_style.py',
|
||||
'/config/check_macroassembler_style.py',
|
||||
'/config/check_js_opcode.py'
|
||||
]
|
||||
|
||||
@@ -477,11 +477,8 @@ if use_minidump:
|
||||
# first failed status.
|
||||
results = []
|
||||
|
||||
# 'checks' is a superset of 'check-style'.
|
||||
if 'checks' in test_suites:
|
||||
results.append(run_test_command([MAKE, 'check']))
|
||||
elif 'check-style' in test_suites:
|
||||
results.append(run_test_command([MAKE, 'check-style']))
|
||||
|
||||
if 'jittest' in test_suites:
|
||||
results.append(run_test_command([MAKE, 'check-jit-test']))
|
||||
|
||||
@@ -3,8 +3,5 @@
|
||||
"debug": true,
|
||||
"skip-tests": {
|
||||
"all": ["jstests", "jittest", "checks"]
|
||||
},
|
||||
"extra-tests": {
|
||||
"all": ["check-style"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,18 +308,6 @@ class CheckSpiderMonkeyCommand(MachCommandBase):
|
||||
self.bindir, executable_name('jsapi-tests'))]
|
||||
jsapi_tests_result = subprocess.call(jsapi_tests_cmd)
|
||||
|
||||
print('running check-style')
|
||||
check_style_cmd = [python, os.path.join(
|
||||
self.topsrcdir, 'config', 'check_spidermonkey_style.py')]
|
||||
check_style_result = subprocess.call(
|
||||
check_style_cmd, cwd=self.topsrcdir)
|
||||
|
||||
print('running check-masm')
|
||||
check_masm_cmd = [python, os.path.join(
|
||||
self.topsrcdir, 'config', 'check_macroassembler_style.py')]
|
||||
check_masm_result = subprocess.call(
|
||||
check_masm_cmd, cwd=self.topsrcdir)
|
||||
|
||||
print('running check-js-msg-encoding')
|
||||
check_js_msg_cmd = [python, os.path.join(
|
||||
self.topsrcdir, 'config', 'check_js_msg_encoding.py')]
|
||||
@@ -327,7 +315,7 @@ class CheckSpiderMonkeyCommand(MachCommandBase):
|
||||
check_js_msg_cmd, cwd=self.topsrcdir)
|
||||
|
||||
all_passed = jittest_result and jstest_result and jsapi_tests_result and \
|
||||
check_style_result and check_masm_result and check_js_msg_result
|
||||
check_js_msg_result
|
||||
|
||||
return all_passed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user