mirror of https://github.com/tc39/test262.git
Merge pull request #31 from Constellation/fix-error-code
Propagate error code when test cases are failed
This commit is contained in:
commit
33c8399de8
|
@ -522,6 +522,7 @@ class TestSuite(object):
|
||||||
print
|
print
|
||||||
print "Use --full-summary to see output from failed tests"
|
print "Use --full-summary to see output from failed tests"
|
||||||
print
|
print
|
||||||
|
return progress.failed
|
||||||
|
|
||||||
def WriteLog(self, result):
|
def WriteLog(self, result):
|
||||||
name = result.case.GetName()
|
name = result.case.GetName()
|
||||||
|
@ -549,6 +550,7 @@ class TestSuite(object):
|
||||||
cases[0].Print()
|
cases[0].Print()
|
||||||
|
|
||||||
def Main():
|
def Main():
|
||||||
|
code = 0
|
||||||
parser = BuildOptions()
|
parser = BuildOptions()
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
ValidateOptions(options)
|
ValidateOptions(options)
|
||||||
|
@ -571,16 +573,17 @@ def Main():
|
||||||
if options.cat:
|
if options.cat:
|
||||||
test_suite.Print(args)
|
test_suite.Print(args)
|
||||||
else:
|
else:
|
||||||
test_suite.Run(options.command, args,
|
code = test_suite.Run(options.command, args,
|
||||||
options.summary or options.full_summary,
|
options.summary or options.full_summary,
|
||||||
options.full_summary,
|
options.full_summary,
|
||||||
options.logname,
|
options.logname,
|
||||||
options.junitname)
|
options.junitname)
|
||||||
|
return code
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
Main()
|
code = Main()
|
||||||
sys.exit(0)
|
sys.exit(code)
|
||||||
except Test262Error, e:
|
except Test262Error, e:
|
||||||
print "Error: %s" % e.message
|
print "Error: %s" % e.message
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in New Issue