source: anuga_validation/automated_validation_tests/validate_all.py @ 7652

Last change on this file since 7652 was 7652, checked in by ole, 13 years ago

Rolled Patong Validation into validate_all.py

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