| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6e1b23d commit ae91a6c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,6 +35,7 @@ | |||
| 35 | 35 | FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)") | |
| 36 | 36 | LS_RE = re.compile(r'^test-.*\.m?js$') | |
| 37 | 37 | ENV_PATTERN = re.compile(r"//\s+Env:(.*)") | |
| 38 | + NODE_TEST_PATTERN = re.compile(r"('|`|\")node:test\1") | ||
| 38 | 39 | ||
| 39 | 40 | class SimpleTestCase(test.TestCase): | |
| 40 | 41 | ||
@@ -98,6 +99,10 @@ def GetRunConfiguration(self): | |||
| 98 | 99 | else: | |
| 99 | 100 | result += flags | |
| 100 | 101 | ||
| 102 | + if self.context.use_error_reporter and NODE_TEST_PATTERN.search(source): | ||
| 103 | + result += ['--test-reporter=./test/common/test-error-reporter.js', | ||
| 104 | + '--test-reporter-destination=stdout'] | ||
| 105 | + | ||
| 101 | 106 | if self.additional_flags: | |
| 102 | 107 | result += self.additional_flags | |
| 103 | 108 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -969,6 +969,7 @@ def __init__(self, workspace, verbose, vm, args, expect_fail, | |||
| 969 | 969 | self.abort_on_timeout = abort_on_timeout | |
| 970 | 970 | self.v8_enable_inspector = True | |
| 971 | 971 | self.node_has_crypto = True | |
| 972 | + self.use_error_reporter = False | ||
| 972 | 973 | ||
| 973 | 974 | def GetVm(self, arch, mode): | |
| 974 | 975 | if self.vm is not None: | |
@@ -1461,7 +1462,7 @@ def BuildOptions(): | |||
| 1461 | 1462 | help="Type of build (simple, fips, coverage)", | |
| 1462 | 1463 | default=None) | |
| 1463 | 1464 | result.add_argument("--error-reporter", | |
| 1464 | - help="use error reporter", | ||
| 1465 | + help="use error reporter if the test uses node:test", | ||
| 1465 | 1466 | default=True, action="store_true") | |
| 1466 | 1467 | return result | |
| 1467 | 1468 | ||
@@ -1679,10 +1680,6 @@ def Main(): | |||
| 1679 | 1680 | options.node_args.append("--trace-file-names") | |
| 1680 | 1681 | options.progress = "deopts" | |
| 1681 | 1682 | ||
| 1682 | - if options.error_reporter: | ||
| 1683 | - options.node_args.append('--test-reporter=./test/common/test-error-reporter.js') | ||
| 1684 | - options.node_args.append('--test-reporter-destination=stdout') | ||
| 1685 | - | ||
| 1686 | 1683 | if options.worker: | |
| 1687 | 1684 | run_worker = join(workspace, "tools", "run-worker.js") | |
| 1688 | 1685 | options.node_args.append(run_worker) | |
@@ -1701,6 +1698,9 @@ def Main(): | |||
| 1701 | 1698 | options.repeat, | |
| 1702 | 1699 | options.abort_on_timeout) | |
| 1703 | 1700 | ||
| 1701 | + if options.error_reporter: | ||
| 1702 | + context.use_error_reporter = True | ||
| 1703 | + | ||
| 1704 | 1704 | # Get status for tests | |
| 1705 | 1705 | sections = [ ] | |
| 1706 | 1706 | defs = { } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments