Skip to content

Commit d047348

Browse files
committed
Bug 1063728 - Run SpiderMonkey style checkers as part of the build instead of make check. r=chmanchester
1 parent d2f2ab6 commit d047348

File tree

6 files changed

+27
-29
lines changed

6 files changed

+27
-29
lines changed

config/run_spidermonkey_checks.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
import buildconfig
6+
import subprocess
7+
import sys
8+
9+
def main(output, lib_file, *scripts):
10+
for script in scripts:
11+
retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir)
12+
if retcode != 0:
13+
raise Exception(script + " failed")

js/src/Makefile.in

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,17 @@ JITTEST_SANITIZER_ENV=MSAN_SYMBOLIZER_PATH='$(LLVM_SYMBOLIZER)'
4949
endif
5050
endif
5151

52-
check-style::
53-
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_spidermonkey_style.py);
54-
55-
check-masm::
56-
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_macroassembler_style.py);
57-
5852
check-js-msg::
5953
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_js_msg_encoding.py);
6054

61-
check-opcode::
62-
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_js_opcode.py);
63-
6455
check-jit-test::
6556
$(JITTEST_SANITIZER_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
6657
--no-slow --no-progress --format=automation --jitflags=all \
6758
$(JITTEST_VALGRIND_FLAG) \
6859
$(JITTEST_EXTRA_ARGS) \
6960
$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX) $(JITTEST_TEST_ARGS)
7061

71-
check:: check-style check-masm check-js-msg check-opcode
62+
check:: check-js-msg
7263

7364
check-jstests:
7465
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/tests/jstests.py \

js/src/build/moz.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,15 @@ DIST_INSTALL = True
7575
# with those in libxul.
7676
if CONFIG['OS_TARGET'] == 'Linux':
7777
LDFLAGS += ['-Wl,-version-script,symverscript']
78+
79+
# Run SpiderMonkey style checker after linking the static library. This avoids
80+
# running the script for no-op builds.
81+
GENERATED_FILES += ['spidermonkey_checks']
82+
run_checks = GENERATED_FILES['spidermonkey_checks']
83+
run_checks.script = '/config/run_spidermonkey_checks.py'
84+
run_checks.inputs += [
85+
'!%sjs_static.%s' % (CONFIG['LIB_PREFIX'], CONFIG['LIB_SUFFIX']),
86+
'/config/check_spidermonkey_style.py',
87+
'/config/check_macroassembler_style.py',
88+
'/config/check_js_opcode.py'
89+
]

js/src/devtools/automation/autospider.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,8 @@ def normalize_tests(tests):
477477
# first failed status.
478478
results = []
479479

480-
# 'checks' is a superset of 'check-style'.
481480
if 'checks' in test_suites:
482481
results.append(run_test_command([MAKE, 'check']))
483-
elif 'check-style' in test_suites:
484-
results.append(run_test_command([MAKE, 'check-style']))
485482

486483
if 'jittest' in test_suites:
487484
results.append(run_test_command([MAKE, 'check-jit-test']))

js/src/devtools/automation/variants/nonunified

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@
33
"debug": true,
44
"skip-tests": {
55
"all": ["jstests", "jittest", "checks"]
6-
},
7-
"extra-tests": {
8-
"all": ["check-style"]
96
}
107
}

testing/mach_commands.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,26 +308,14 @@ def run_checkspidermonkey(self, **params):
308308
self.bindir, executable_name('jsapi-tests'))]
309309
jsapi_tests_result = subprocess.call(jsapi_tests_cmd)
310310

311-
print('running check-style')
312-
check_style_cmd = [python, os.path.join(
313-
self.topsrcdir, 'config', 'check_spidermonkey_style.py')]
314-
check_style_result = subprocess.call(
315-
check_style_cmd, cwd=self.topsrcdir)
316-
317-
print('running check-masm')
318-
check_masm_cmd = [python, os.path.join(
319-
self.topsrcdir, 'config', 'check_macroassembler_style.py')]
320-
check_masm_result = subprocess.call(
321-
check_masm_cmd, cwd=self.topsrcdir)
322-
323311
print('running check-js-msg-encoding')
324312
check_js_msg_cmd = [python, os.path.join(
325313
self.topsrcdir, 'config', 'check_js_msg_encoding.py')]
326314
check_js_msg_result = subprocess.call(
327315
check_js_msg_cmd, cwd=self.topsrcdir)
328316

329317
all_passed = jittest_result and jstest_result and jsapi_tests_result and \
330-
check_style_result and check_masm_result and check_js_msg_result
318+
check_js_msg_result
331319

332320
return all_passed
333321

0 commit comments

Comments
 (0)