# HG changeset patch # User Oleg Oshmyan # Date 1276433209 0 # Node ID d4fc9341664eb1d949a2c72f4ac78d72918d613a # Parent a33653cdad573e3002a4b347210494283200e137 Fixed an exception when tests.zip contained test cases in its root diff -r a33653cdad57 -r d4fc9341664e 1.20/test.py --- a/1.20/test.py Mon Jun 07 23:42:16 2010 +0000 +++ b/1.20/test.py Sun Jun 13 12:46:49 2010 +0000 @@ -3,7 +3,7 @@ import os, sys, shutil, time, subprocess, filecmp, optparse, signal, tempfile, tarfile, zipfile -parser = optparse.OptionParser(version='test.py 1.20.1', usage='usage: %prog [options] [problem names] [[path/to/]solution-app] [test case numbers]\n\nTest case numbers can be specified in plain text or as a Python expression\nif there is only one positional argument.\n\nOnly problem names listed in testconf.py are recognized.') +parser = optparse.OptionParser(version='test.py 1.20.2', usage='usage: %prog [options] [problem names] [[path/to/]solution-app] [test case numbers]\n\nTest case numbers can be specified in plain text or as a Python expression\nif there is only one positional argument.\n\nOnly problem names listed in testconf.py are recognized.') parser.add_option('-e', '--exclude', dest='exclude', action='append', help='test case number(s) to exclude, as a Python expression; multiple -e options can be supplied') parser.add_option('-c', '--cleanup', dest='clean', action='store_true', default=False, help='delete the copies of input/output files and exit') parser.add_option('-s', '--save-io', dest='erase', action='store_false', default=True, help='do not delete the copies of input/output files after the last test case; create copies of input files and store output in files even if the solution uses standard I/O; delete the stored input/output files if the solution uses standard I/O and the -c/--cleanup option is specified') @@ -283,8 +283,8 @@ if os.path.isfile('tests.zip'): if not target.startswith('/'): f = zipfile.ZipFile('tests.zip') - m = f.getinfo(name) try: + m = f.getinfo(name) m.filename = target f.extract(m) f.close() @@ -896,4 +896,4 @@ if options.pause: print 'Press any key to exit... ', sys.stdout.flush() - os.system(pause + ' >' + os.devnull) \ No newline at end of file + os.system(pause + ' >' + os.devnull) diff -r a33653cdad57 -r d4fc9341664e test-svn.py --- a/test-svn.py Mon Jun 07 23:42:16 2010 +0000 +++ b/test-svn.py Sun Jun 13 12:46:49 2010 +0000 @@ -342,8 +342,8 @@ if os.path.isfile('tests.zip'): if not os.path.isabs(target): f = zipfile.ZipFile('tests.zip') - m = f.getinfo(name) try: + m = f.getinfo(name) m.filename = target f.extract(m) f.close() @@ -967,4 +967,4 @@ if options.pause: print 'Press any key to exit... ', sys.stdout.flush() - os.system(pause + ' >' + os.devnull) \ No newline at end of file + os.system(pause + ' >' + os.devnull)