source: trunk/anuga_validation/automated_validation_tests/validate_all.py @ 9737

Last change on this file since 9737 was 8067, checked in by steve, 14 years ago

Pulling together basic validate tests for anuga

File size: 2.0 KB
RevLine 
[3706]1"""Validate_all.py
[7670]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
[3706]10"""
11
[6417]12import os, time, sys
[3929]13
14
[7669]15# List any sub directory to exclude from validation.
16# Current working directory ('.') should always be excluded to avoid
17#infinite recursion
[7670]18dirs_to_skip = ['.'] # Always skip current dir
19#dirs_to_skip += ['patong_beach_validation'] # This takes about 40h
[3929]20
[7669]21validation_dirs_and_files = []
[3929]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:
[7652]29        #print 'Skipping %s' % dirpath
[3929]30        continue
31   
[7652]32    #print 'Searching dir', dirpath
[3929]33   
34
35    for filename in filenames:
[8067]36        if filename.startswith('validate_') and filename.endswith('.py'):
[7652]37            #print 'Found %s in %s' %(filename, dirpath)
[3929]38            validation_dirs_and_files.append((dirpath, filename))           
39
[7291]40    # get repeatable order on different machines
41    validation_dirs_and_files.sort()
[3929]42
[7291]43
[5290]44print 
[7652]45print '---------------------------------------------------------'
46print 'Running all validation tests - some may take several days'
47print 'and some may require memory in the order of 8-16GB       '
48print '---------------------------------------------------------'
[3929]49
[7652]50print 'Validation test suites:'
51for path, filename in validation_dirs_and_files:
52     print '    ', os.path.join(path, filename)
53print
54print
55
[5291]56t0 = time.time()
[3929]57for path, filename in validation_dirs_and_files:
[4842]58    # print 'filename path', path, filename
[4409]59
[4183]60    os.chdir(path)
[7652]61    s = 'python %s' % filename
[5290]62    print s
[3929]63    os.system(s)
[4403]64   
[4810]65    # Back to parent directory
[4409]66    os.chdir(os.pardir)
67
[4842]68    # print 'current dir', os.getcwd()
[4403]69   
[5291]70print 'That took %.2f seconds in total' %(time.time()-t0)
[4409]71   
[4403]72
[3929]73           
[6417]74
75if sys.platform == 'win32':
76    raw_input('Press any key')
Note: See TracBrowser for help on using the repository browser.