source: anuga_validation/automated_validation_tests/validate_all.py @ 7567

Last change on this file since 7567 was 7291, checked in by rwilson, 15 years ago

Sort the scripts to run.

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