[3706] | 1 | """Validate_all.py |
---|
[7670] | 2 | |
---|
| 3 | This takes about 41 hours in total on an Intel I7 2.5GHz Linux server. |
---|
| 4 | 40 hours is spent in the Patong validation. |
---|
| 5 | |
---|
| 6 | If you wish to skip Patong, add 'patong_beach_validation' to the |
---|
| 7 | list dirs_to_skip by uncommenting the appropriate line. |
---|
| 8 | |
---|
| 9 | |
---|
[3706] | 10 | """ |
---|
| 11 | |
---|
[6417] | 12 | import os, time, sys |
---|
[3929] | 13 | |
---|
| 14 | |
---|
[7669] | 15 | # List any sub directory to exclude from validation. |
---|
| 16 | # Current working directory ('.') should always be excluded to avoid |
---|
| 17 | #infinite recursion |
---|
[7670] | 18 | dirs_to_skip = ['.'] # Always skip current dir |
---|
| 19 | #dirs_to_skip += ['patong_beach_validation'] # This takes about 40h |
---|
[3929] | 20 | |
---|
[7669] | 21 | validation_dirs_and_files = [] |
---|
[3929] | 22 | for dirpath, dirnames, filenames in os.walk('.'): |
---|
| 23 | |
---|
| 24 | if '.svn' in dirnames: |
---|
| 25 | dirnames.remove('.svn') # don't visit SVN directories |
---|
| 26 | |
---|
| 27 | dir = os.path.split(dirpath)[-1] |
---|
| 28 | if dir in dirs_to_skip: |
---|
[7652] | 29 | #print 'Skipping %s' % dirpath |
---|
[3929] | 30 | continue |
---|
| 31 | |
---|
[7652] | 32 | #print 'Searching dir', dirpath |
---|
[3929] | 33 | |
---|
| 34 | |
---|
| 35 | for filename in filenames: |
---|
[8067] | 36 | if filename.startswith('validate_') and filename.endswith('.py'): |
---|
[7652] | 37 | #print 'Found %s in %s' %(filename, dirpath) |
---|
[3929] | 38 | validation_dirs_and_files.append((dirpath, filename)) |
---|
| 39 | |
---|
[7291] | 40 | # get repeatable order on different machines |
---|
| 41 | validation_dirs_and_files.sort() |
---|
[3929] | 42 | |
---|
[7291] | 43 | |
---|
[5290] | 44 | print |
---|
[7652] | 45 | print '---------------------------------------------------------' |
---|
| 46 | print 'Running all validation tests - some may take several days' |
---|
| 47 | print 'and some may require memory in the order of 8-16GB ' |
---|
| 48 | print '---------------------------------------------------------' |
---|
[3929] | 49 | |
---|
[7652] | 50 | print 'Validation test suites:' |
---|
| 51 | for path, filename in validation_dirs_and_files: |
---|
| 52 | print ' ', os.path.join(path, filename) |
---|
| 53 | print |
---|
| 54 | print |
---|
| 55 | |
---|
[5291] | 56 | t0 = time.time() |
---|
[3929] | 57 | for path, filename in validation_dirs_and_files: |
---|
[4842] | 58 | # print 'filename path', path, filename |
---|
[4409] | 59 | |
---|
[4183] | 60 | os.chdir(path) |
---|
[7652] | 61 | s = 'python %s' % filename |
---|
[5290] | 62 | print s |
---|
[3929] | 63 | os.system(s) |
---|
[4403] | 64 | |
---|
[4810] | 65 | # Back to parent directory |
---|
[4409] | 66 | os.chdir(os.pardir) |
---|
| 67 | |
---|
[4842] | 68 | # print 'current dir', os.getcwd() |
---|
[4403] | 69 | |
---|
[5291] | 70 | print 'That took %.2f seconds in total' %(time.time()-t0) |
---|
[4409] | 71 | |
---|
[4403] | 72 | |
---|
[3929] | 73 | |
---|
[6417] | 74 | |
---|
| 75 | if sys.platform == 'win32': |
---|
| 76 | raw_input('Press any key') |
---|