Mercurial > ~astiob > upreckon > hgweb
comparison test.py @ 9:ed90b375d197
Award maxexitcode points by default
The default number of points allocated per test case is now maxexitcode if it is set and is an integer (so that all given points are integers as well).
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Sun, 14 Feb 2010 00:51:27 +0000 |
parents | b0034b18f942 |
children | c87ec78f1fae |
comparison
equal
deleted
inserted
replaced
8:ddc9aa02007b | 9:ed90b375d197 |
---|---|
616 except TypeError: | 616 except TypeError: |
617 newpointmap[i] = pointmap[i] | 617 newpointmap[i] = pointmap[i] |
618 | 618 |
619 pointmap = newpointmap | 619 pointmap = newpointmap |
620 | 620 |
621 if not tester: | |
622 maxexitcode = 0 | |
623 | |
621 if maxtime > 0: | 624 if maxtime > 0: |
622 strmaxtime = '/%.3f' % maxtime | 625 strmaxtime = '/%.3f' % maxtime |
623 else: | 626 else: |
624 strmaxtime = '' | 627 strmaxtime = '' |
625 | 628 |
699 npoints = 0 | 702 npoints = 0 |
700 if len(s) < paddummieswithzeroestolength: | 703 if len(s) < paddummieswithzeroestolength: |
701 s = s.zfill(paddummieswithzeroestolength) | 704 s = s.zfill(paddummieswithzeroestolength) |
702 spref = 'sample ' | 705 spref = 'sample ' |
703 else: | 706 else: |
704 npoints = pointmap.get(None, 1) | 707 npoints = pointmap.get(None, maxexitcode if maxexitcode and isinstance(maxexitcode, int) else 1) |
705 npoints = pointmap.get(i, npoints) | 708 npoints = pointmap.get(i, npoints) |
706 maxpointsgrp += npoints | 709 maxpointsgrp += npoints |
707 if npoints: | 710 if npoints: |
708 nvalued += 1 | 711 nvalued += 1 |
709 if len(s) < padwithzeroestolength: | 712 if len(s) < padwithzeroestolength: |