source: anuga_validation/automated_validation_tests/validate_all.py @ 7670

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

Verified again that all tests run (41 hours on I7 cluster) and added option to excluded Patong.

File size: 2.0 KB
Line 
1"""Validate_all.py
2
3This takes about 41 hours in total on an Intel I7 2.5GHz Linux server.
440 hours is spent in the Patong validation.
5
6If you wish to skip Patong, add 'patong_beach_validation' to the
7list dirs_to_skip by uncommenting the appropriate line.
8
9
10"""
11
12import 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
18dirs_to_skip = ['.'] # Always skip current dir
19#dirs_to_skip += ['patong_beach_validation'] # This takes about 40h
20
21validation_dirs_and_files = []
22for 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
44print 
45print '---------------------------------------------------------'
46print 'Running all validation tests - some may take several days'
47print 'and some may require memory in the order of 8-16GB       '
48print '---------------------------------------------------------'
49
50print 'Validation test suites:'
51for path, filename in validation_dirs_and_files:
52     print '    ', os.path.join(path, filename)
53print
54print
55
56t0 = time.time()
57for 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   
70print 'That took %.2f seconds in total' %(time.time()-t0)
71   
72
73           
74
75if sys.platform == 'win32':
76    raw_input('Press any key')
Note: See TracBrowser for help on using the repository browser.