source: anuga_validation/automated_validation_tests/validate_all.py @ 7669

Last change on this file since 7669 was 7669, checked in by ole, 14 years ago

Verified that Patong completes succesfully as part of validate_all.py - Yahoo!

File size: 1.7 KB
Line 
1"""Validate_all.py
2"""
3
4import os, time, sys
5
6
7# List any sub directory to exclude from validation.
8# Current working directory ('.') should always be excluded to avoid
9#infinite recursion
10dirs_to_skip = ['.']
11
12
13validation_dirs_and_files = []
14for dirpath, dirnames, filenames in os.walk('.'):
15
16    if '.svn' in dirnames:
17        dirnames.remove('.svn')  # don't visit SVN directories
18
19    dir = os.path.split(dirpath)[-1]
20    if dir in dirs_to_skip:
21        #print 'Skipping %s' % dirpath
22        continue
23   
24    #print 'Searching dir', dirpath
25   
26
27    for filename in filenames:
28        if filename.startswith('validate') and filename.endswith('.py'):
29            #print 'Found %s in %s' %(filename, dirpath)
30            validation_dirs_and_files.append((dirpath, filename))           
31
32    # get repeatable order on different machines
33    validation_dirs_and_files.sort()
34
35
36print 
37print '---------------------------------------------------------'
38print 'Running all validation tests - some may take several days'
39print 'and some may require memory in the order of 8-16GB       '
40print '---------------------------------------------------------'
41
42print 'Validation test suites:'
43for path, filename in validation_dirs_and_files:
44     print '    ', os.path.join(path, filename)
45print
46print
47
48t0 = time.time()
49for path, filename in validation_dirs_and_files:
50    # print 'filename path', path, filename
51
52    os.chdir(path)
53    s = 'python %s' % filename
54    print s
55    os.system(s)
56   
57    # Back to parent directory
58    os.chdir(os.pardir)
59
60    # print 'current dir', os.getcwd()
61   
62print 'That took %.2f seconds in total' %(time.time()-t0)
63   
64
65           
66
67if sys.platform == 'win32':
68    raw_input('Press any key')
Note: See TracBrowser for help on using the repository browser.