changeset 200:fa81289ee407

force_zero_exitcode is now a problem-specific configuration variable
author Oleg Oshmyan <chortos@inbox.lv>
date Wed, 17 Aug 2011 00:32:01 +0300
parents 1de2ea435d93
children 32650f4a2177
files upreckon/config.py upreckon/testcases.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/upreckon/config.py	Tue Aug 16 23:05:03 2011 +0300
+++ b/upreckon/config.py	Wed Aug 17 00:32:01 2011 +0300
@@ -38,9 +38,9 @@
                     'tester': None,
                     'maxexitcode': 0,
                     'inname': '',
-                    'ansname': ''}
-defaults_global = {'problems': None,
-                   'force_zero_exitcode': True}
+                    'ansname': '',
+                    'force_zero_exitcode': True}
+defaults_global = {'problems': None}
 defaults_noerase = {'inname': '%.in',
                     'outname': '%.out',
                     'ansname': '%.ans'}
--- a/upreckon/testcases.py	Tue Aug 16 23:05:03 2011 +0300
+++ b/upreckon/testcases.py	Wed Aug 17 00:32:01 2011 +0300
@@ -268,7 +268,7 @@
 				with tempfile.TemporaryFile('w+b') if options.erase and (not case.validator or callable(case.validator)) else open(case.problem.config.outname, 'w+b') as outfile:
 					with open(inputdatafname) as infile:
 						call(case.problem.config.path, case=case, stdin=infile, stdout=outfile, stderr=devnull)
-					if config.globalconf.force_zero_exitcode and case.process.returncode or case.process.returncode < 0:
+					if case.problem.config.force_zero_exitcode and case.process.returncode or case.process.returncode < 0:
 						raise NonZeroExitCode(case.process.returncode)
 					case.has_called_back = True
 					callback()
@@ -277,7 +277,7 @@
 		else:
 			case.infile.copy(case.problem.config.inname)
 			call(case.problem.config.path, case=case, stdin=devnull, stdout=devnull, stderr=devnull)
-			if config.globalconf.force_zero_exitcode and case.process.returncode or case.process.returncode < 0:
+			if case.problem.config.force_zero_exitcode and case.process.returncode or case.process.returncode < 0:
 				raise NonZeroExitCode(case.process.returncode)
 			case.has_called_back = True
 			callback()