Mercurial > ~astiob > upreckon > hgweb
comparison 2.00/testcases.py @ 27:dc4be35d17e0
Bug fixes
Bug fix: compat.py now works in Python 3 (module __builtin__ was renamed builtins).
Bug fix: random spaces in the indentation of testcases.py have been removed.
Bug fix: false dummy{in,out}name's are now again replaced with the values of testcase{in,out}name.
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Fri, 15 Oct 2010 22:17:31 +0000 |
parents | 5bbb68833868 |
children | 2b459f9743b4 |
comparison
equal
deleted
inserted
replaced
26:5bbb68833868 | 27:dc4be35d17e0 |
---|---|
391 if now >= time_next_check: | 391 if now >= time_next_check: |
392 if canceled(): | 392 if canceled(): |
393 raise CanceledByUser | 393 raise CanceledByUser |
394 else: | 394 else: |
395 time_next_check = now + .15 | 395 time_next_check = now + .15 |
396 time.sleep(0) | 396 time.sleep(0) |
397 else: | 397 else: |
398 time_end = case.time_started + case.maxtime | 398 time_end = case.time_started + case.maxtime |
399 while True: | 399 while True: |
400 exitcode, now = case.process.poll(), clock() | 400 exitcode, now = case.process.poll(), clock() |
401 if exitcode is not None: | 401 if exitcode is not None: |
407 if now >= time_next_check: | 407 if now >= time_next_check: |
408 if canceled(): | 408 if canceled(): |
409 raise CanceledByUser | 409 raise CanceledByUser |
410 else: | 410 else: |
411 time_next_check = now + .15 | 411 time_next_check = now + .15 |
412 time.sleep(0) | 412 time.sleep(0) |
413 if config.globalconf.force_zero_exitcode and case.process.returncode: | 413 if config.globalconf.force_zero_exitcode and case.process.returncode: |
414 raise NonZeroExitCode(case.process.returncode) | 414 raise NonZeroExitCode(case.process.returncode) |
415 callback() | 415 callback() |
416 case.has_called_back = True | 416 case.has_called_back = True |
417 outfile.seek(0) | 417 outfile.seek(0) |
440 if now >= time_next_check: | 440 if now >= time_next_check: |
441 if canceled(): | 441 if canceled(): |
442 raise CanceledByUser | 442 raise CanceledByUser |
443 else: | 443 else: |
444 time_next_check = now + .15 | 444 time_next_check = now + .15 |
445 time.sleep(0) | 445 time.sleep(0) |
446 else: | 446 else: |
447 time_end = case.time_started + case.maxtime | 447 time_end = case.time_started + case.maxtime |
448 while True: | 448 while True: |
449 exitcode, now = case.process.poll(), clock() | 449 exitcode, now = case.process.poll(), clock() |
450 if exitcode is not None: | 450 if exitcode is not None: |
456 if now >= time_next_check: | 456 if now >= time_next_check: |
457 if canceled(): | 457 if canceled(): |
458 raise CanceledByUser | 458 raise CanceledByUser |
459 else: | 459 else: |
460 time_next_check = now + .15 | 460 time_next_check = now + .15 |
461 time.sleep(0) | 461 time.sleep(0) |
462 if config.globalconf.force_zero_exitcode and case.process.returncode: | 462 if config.globalconf.force_zero_exitcode and case.process.returncode: |
463 raise NonZeroExitCode(case.process.returncode) | 463 raise NonZeroExitCode(case.process.returncode) |
464 callback() | 464 callback() |
465 case.has_called_back = True | 465 case.has_called_back = True |
466 with open(case.problem.config.outname, 'rU') as output: | 466 with open(case.problem.config.outname, 'rU') as output: |