Skip to content

Commit cda345e

Browse files
cjihrigMyles Borins
authored and
Myles Borins
committed
tools: support testing known issues
This commit adds a known_issues directory to the test directory for scripts that reproduce known bugs. Since these scripts are expected to fail, it also adds a --expect-fail flag to test.py which reports tests as successful when they fail. Refs: nodejs/testing#18 Backport-URL: #5785 PR-URL: #5528 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Wyatt Preul <[email protected]> Reviewed-By: Rich Trott <[email protected]> Conflicts: tools/test.py
1 parent a15c6e1 commit cda345e

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ test-internet: all
168168
test-debugger: all
169169
$(PYTHON) tools/test.py debugger
170170

171+
test-known-issues: all
172+
$(PYTHON) tools/test.py known_issues --expect-fail
173+
171174
test-npm: $(NODE_EXE)
172175
NODE=$(NODE) tools/test-npm.sh
173176

test/known_issues/testcfg.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import sys, os
2+
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
3+
import testpy
4+
5+
def GetConfiguration(context, root):
6+
return testpy.SimpleTestConfiguration(context, root, 'known_issues')

tools/test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def __init__(self, context, path, arch, mode):
430430
self.thread_id = 0
431431

432432
def IsNegative(self):
433-
return False
433+
return self.context.expect_fail
434434

435435
def CompareTime(self, other):
436436
return cmp(other.duration, self.duration)
@@ -774,11 +774,13 @@ def GetTestStatus(self, context, sections, defs):
774774

775775
class Context(object):
776776

777-
def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppress_dialogs, store_unexpected_output):
777+
def __init__(self, workspace, buildspace, verbose, vm, expect_fail,
778+
timeout, processor, suppress_dialogs, store_unexpected_output):
778779
self.workspace = workspace
779780
self.buildspace = buildspace
780781
self.verbose = verbose
781782
self.vm_root = vm
783+
self.expect_fail = expect_fail
782784
self.timeout = timeout
783785
self.processor = processor
784786
self.suppress_dialogs = suppress_dialogs
@@ -1281,6 +1283,8 @@ def BuildOptions():
12811283
result.add_option("--snapshot", help="Run the tests with snapshot turned on",
12821284
default=False, action="store_true")
12831285
result.add_option("--special-command", default=None)
1286+
result.add_option("--expect-fail", dest="expect_fail",
1287+
help="Expect test cases to fail", default=False, action="store_true")
12841288
result.add_option("--valgrind", help="Run tests through valgrind",
12851289
default=False, action="store_true")
12861290
result.add_option("--cat", help="Print the source of the tests",
@@ -1471,6 +1475,7 @@ def Main():
14711475
buildspace,
14721476
VERBOSE,
14731477
shell,
1478+
options.expect_fail,
14741479
options.timeout,
14751480
processor,
14761481
options.suppress_dialogs,

vcbuild.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&got
6161
if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok
6262
if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok
6363
if /i "%1"=="test-all" set test_args=%test_args% sequential parallel message gc internet pummel&set buildnodeweak=1&set jslint=1&goto arg-ok
64+
if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues --expect-fail&goto arg-ok
6465
if /i "%1"=="jslint" set jslint=1&goto arg-ok
6566
if /i "%1"=="msi" set msi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=small-icu&goto arg-ok
6667
if /i "%1"=="build-release" set build_release=1&goto arg-ok

0 commit comments

Comments
 (0)