diff options
author | Brian White <mscdex@mscdex.net> | 2017-04-17 00:01:00 -0400 |
---|---|---|
committer | Brian White <mscdex@mscdex.net> | 2017-04-30 03:17:25 -0400 |
commit | 7a5bac5d36cabf4061ea6a4de2ee0f779d44f11c (patch) | |
tree | 0fae50c6c4ee89148c133f1cef0a2d4088c29e09 /tools | |
parent | 91ccea65eae4d8676671685821d97dc4cb05fb73 (diff) | |
download | node-new-7a5bac5d36cabf4061ea6a4de2ee0f779d44f11c.tar.gz |
build: add target for checking for perm deopts
PR-URL: https://github.com/nodejs/node/pull/12456
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/test.py | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/tools/test.py b/tools/test.py index 7efc257402..4f341ad421 100755 --- a/tools/test.py +++ b/tools/test.py @@ -341,6 +341,39 @@ class TapProgressIndicator(SimpleProgressIndicator): def Done(self): pass +class DeoptsCheckProgressIndicator(SimpleProgressIndicator): + + def Starting(self): + pass + + def AboutToRun(self, case): + pass + + def HasRun(self, output): + # Print test name as (for example) "parallel/test-assert". Tests that are + # scraped from the addons documentation are all named test.js, making it + # hard to decipher what test is running when only the filename is printed. + prefix = abspath(join(dirname(__file__), '../test')) + os.sep + command = output.command[-1] + if command.endswith('.js'): command = command[:-3] + if command.startswith(prefix): command = command[len(prefix):] + command = command.replace('\\', '/') + + stdout = output.output.stdout.strip() + printed_file = False + for line in stdout.splitlines(): + if (line.startswith("[aborted optimiz") or \ + line.startswith("[disabled optimiz")) and \ + ("because:" in line or "reason:" in line): + if not printed_file: + printed_file = True + print '==== %s ====' % command + self.failed.append(output) + print ' %s' % line + + def Done(self): + pass + class CompactProgressIndicator(ProgressIndicator): @@ -433,7 +466,8 @@ PROGRESS_INDICATORS = { 'dots': DotsProgressIndicator, 'color': ColorProgressIndicator, 'tap': TapProgressIndicator, - 'mono': MonochromeProgressIndicator + 'mono': MonochromeProgressIndicator, + 'deopts': DeoptsCheckProgressIndicator } @@ -1383,6 +1417,8 @@ def BuildOptions(): help="Expect test cases to fail", default=False, action="store_true") result.add_option("--valgrind", help="Run tests through valgrind", default=False, action="store_true") + result.add_option("--check-deopts", help="Check tests for permanent deoptimizations", + default=False, action="store_true") result.add_option("--cat", help="Print the source of the tests", default=False, action="store_true") result.add_option("--flaky-tests", @@ -1586,6 +1622,14 @@ def Main(): run_valgrind = join(workspace, "tools", "run-valgrind.py") options.special_command = "python -u " + run_valgrind + " @" + if options.check_deopts: + options.node_args.append("--trace-opt") + options.node_args.append("--trace-file-names") + # --always-opt is needed because many tests do not run long enough for the + # optimizer to kick in, so this flag will force it to run. + options.node_args.append("--always-opt") + options.progress = "deopts" + shell = abspath(options.shell) buildspace = dirname(shell) |