source: trunk/anuga_core/test_all.py @ 9399

Last change on this file since 9399 was 9301, checked in by steve, 11 years ago

Testing if pypar_available before importing sequenential_distribute code

File size: 2.7 KB
Line 
1from anuga.utilities.data_audit_wrapper import IP_verified
2from tempfile import mktemp
3
4import os
5
6buildroot = os.getcwd()
7
8
9
10os.chdir('source')
11os.chdir('anuga')
12print
13print '======================= anuga tests ================================='   
14print 'Changing to', os.getcwd() # This is now different from buildroot   
15execfile('test_all.py')
16
17
18#os.chdir(buildroot)
19#os.chdir('source')
20#os.chdir('anuga_1d')
21#print
22#print '======================= anuga_1d tests ================================='   
23#print 'Changing to', os.getcwd() # This is now different from buildroot   
24#xecfile('test_all.py')
25
26
27
28# Try to run parallel tests if pypar is installed
29from anuga import pypar_available
30   
31if pypar_available:
32    os.chdir(buildroot)
33    os.chdir('source')
34    os.chdir('anuga_parallel')
35    print
36    print '===================== anuga_parallel tests =========================='
37    print 'Changing to', os.getcwd()
38    execfile('test_all.py')
39else:
40    print 'anuga_parallel tests not run as pypar not installed'
41
42
43
44
45
46# FIXME SR 20130327: Just commenting out this comment to run the validation tests.
47# We are currently undating the automated validation tests, so at present this point to
48# something which most people do get as part of the download. We will update and
49# point them to the new anuga_validation_tests in future.
50"""
51print
52print '************************** NOTE *************************************'
53print 'If all unit tests passed you should run the suite of validation tests'
54print 'Go to the directory anuga_validation/automated_validation_tests'
55print 'and run'
56print '    python validate_all.py'
57print
58print 'These tests will take a few hours and will verify that ANUGA'
59print 'produces the physical results expected.'
60print '*********************************************************************'
61"""
62
63
64# Temporary bail out
65import sys; sys.exit() 
66
67
68#---------------------------
69# IP Data Audit (in source/anuga directory as well)
70#---------------------------
71
72# Create temporary area for svn to export source files
73# FIXME (Ole): It would be good to make sure these files
74# are exactly the same as those walked over by the
75# release script: create_distribution.
76#
77# Come to think of it - this is probably not the best
78# place for this check. It may have to move up one level.
79# What do you all think?
80
81
82
83temp_dir = mktemp()
84
85print 'Temp dir', temp_dir
86os.mkdir(temp_dir)
87
88# Get the ANUGA core source files
89s = 'svn export . %s%sanuga' %(temp_dir, os.sep) 
90print s
91os.system(s)
92
93print 'Verifying data IP'
94if not IP_verified(temp_dir):
95    msg = 'Files have not been verified for IP.\n'
96    msg += 'Each data file must have a license file with it.'
97    raise Exception, msg
98
99
100
101
102
103   
Note: See TracBrowser for help on using the repository browser.