source: branches/numpy_anuga_validation/automated_validation_tests/validate_all.py @ 6483

Last change on this file since 6483 was 6417, checked in by ole, 15 years ago

Added raw_input to pause after compile_all, test_all and validate_all on Windows

File size: 1.3 KB
Line 
1"""Validate_all.py
2"""
3
4import os, time, sys
5
6
7dirs_to_skip = ['.', 'okushiri_tank_validation_ver1']
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
30print 
31print '----------------------------------------------------------'
32print 'Running all validation tests - this may take several hours'
33print '----------------------------------------------------------'
34
35t0 = time.time()
36for path, filename in validation_dirs_and_files:
37    # print 'filename path', path, filename
38
39    os.chdir(path)
40    s = 'python %s' %(filename)
41    print
42    print s
43    os.system(s)
44   
45    # Back to parent directory
46    os.chdir(os.pardir)
47
48    # print 'current dir', os.getcwd()
49   
50print 'That took %.2f seconds in total' %(time.time()-t0)
51   
52
53           
54
55if sys.platform == 'win32':
56    raw_input('Press any key')
Note: See TracBrowser for help on using the repository browser.