1 | """Validate_all.py |
---|
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 | |
---|
10 | """ |
---|
11 | |
---|
12 | import os, time, sys |
---|
13 | |
---|
14 | |
---|
15 | # List any sub directory to exclude from validation. |
---|
16 | # Current working directory ('.') should always be excluded to avoid |
---|
17 | #infinite recursion |
---|
18 | dirs_to_skip = ['.'] # Always skip current dir |
---|
19 | #dirs_to_skip += ['patong_beach_validation'] # This takes about 40h |
---|
20 | |
---|
21 | validation_dirs_and_files = [] |
---|
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: |
---|
29 | #print 'Skipping %s' % dirpath |
---|
30 | continue |
---|
31 | |
---|
32 | #print 'Searching dir', dirpath |
---|
33 | |
---|
34 | |
---|
35 | for filename in filenames: |
---|
36 | if filename.startswith('validate_') and filename.endswith('.py'): |
---|
37 | #print 'Found %s in %s' %(filename, dirpath) |
---|
38 | validation_dirs_and_files.append((dirpath, filename)) |
---|
39 | |
---|
40 | # get repeatable order on different machines |
---|
41 | validation_dirs_and_files.sort() |
---|
42 | |
---|
43 | |
---|
44 | print |
---|
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 '---------------------------------------------------------' |
---|
49 | |
---|
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 | |
---|
56 | t0 = time.time() |
---|
57 | for path, filename in validation_dirs_and_files: |
---|
58 | # print 'filename path', path, filename |
---|
59 | |
---|
60 | os.chdir(path) |
---|
61 | s = 'python %s' % filename |
---|
62 | print s |
---|
63 | os.system(s) |
---|
64 | |
---|
65 | # Back to parent directory |
---|
66 | os.chdir(os.pardir) |
---|
67 | |
---|
68 | # print 'current dir', os.getcwd() |
---|
69 | |
---|
70 | print 'That took %.2f seconds in total' %(time.time()-t0) |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | |
---|
75 | if sys.platform == 'win32': |
---|
76 | raw_input('Press any key') |
---|