Permalink
Browse files

Make sure that the test harness returns the right code on failure

  • Loading branch information...
1 parent 5e15d03 commit 0b5c2f72571c42b46f8711b41708261ac5453ee4 @bricef committed Apr 19, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 harness.py
View
@@ -68,6 +68,7 @@ def is_correct(command,input,reference):
)
args = parser.parse_args()
+
failed = 0
if args.script:
@@ -79,10 +80,13 @@ def is_correct(command,input,reference):
if not is_correct(sline[:-2],sline[-2],sline[-1]):
failed += 1
except IOError as err:
+ failed += 1
sys.stderr.write("[ERROR]: %s (in '%s' line %d)\n"%(str(err),fileinput.filename(),fileinput.lineno()) )
if not args.skip:
sys.exit(1)
-
+
+ sys.exit(failed)
+
elif args.program and args.input and args.reference:
try:
if not is_correct(args.program, args.input, args.reference):

0 comments on commit 0b5c2f7

Please sign in to comment.