comparison problem.py @ 82:06356af50bf9

Finished testcases reorganization and CPU time limit implementation We now have: * Win32-specific code in the win32 module (including bug fixes), * UNIX-specific and generic code in the unix module, * a much cleaner testcases module, * wait4-based resource limits working on Python 3 (this is a bug fix), * no warning/error reported on non-Win32 when -x is not passed but standard input does not come from a terminal, * the maxtime configuration variable replaced with two new variables named maxcputime and maxwalltime, * CPU time reported if it can be determined unless an error occurs sooner than it is determined (e. g. if the wall-clock time limit is exceeded), * memory limits enforced even if Upreckon's forking already breaks them, * CPU time limits and private virtual memory limits honoured on Win32, * CPU time limits honoured on UNIX(-like) platforms supporting wait4 or getrusage, * address space limits honoured on UNIX(-like) platforms supporting setrlimit with RLIMIT_AS/RLIMIT_VMEM, * resident set size limits honoured on UNIX(-like) platforms supporting wait4.
author Oleg Oshmyan <chortos@inbox.lv>
date Wed, 23 Feb 2011 23:35:27 +0000
parents 69eadc60f4e2
children 37c4ad87583c
comparison
equal deleted inserted replaced
81:24752db487c5 82:06356af50bf9
139 sys.stdout.flush() 139 sys.stdout.flush()
140 try: 140 try:
141 granted = case(lambda: (say('%7.3f%s s, ' % (case.time_stopped - case.time_started, case.time_limit_string), end=''), sys.stdout.flush())) 141 granted = case(lambda: (say('%7.3f%s s, ' % (case.time_stopped - case.time_started, case.time_limit_string), end=''), sys.stdout.flush()))
142 except testcases.CanceledByUser: 142 except testcases.CanceledByUser:
143 verdict = 'canceled by the user' 143 verdict = 'canceled by the user'
144 except testcases.TimeLimitExceeded: 144 except testcases.WallTimeLimitExceeded:
145 verdict = 'time limit exceeded' 145 verdict = 'wall-clock time limit exceeded'
146 except testcases.CPUTimeLimitExceeded:
147 verdict = 'CPU time limit exceeded'
146 except testcases.MemoryLimitExceeded: 148 except testcases.MemoryLimitExceeded:
147 verdict = 'memory limit exceeded' 149 verdict = 'memory limit exceeded'
148 except testcases.WrongAnswer: 150 except testcases.WrongAnswer:
149 e = sys.exc_info()[1] 151 e = sys.exc_info()[1]
150 if e.comment: 152 if e.comment: