1 | from anuga.utilities.data_audit_wrapper import IP_verified |
---|
2 | from tempfile import mktemp |
---|
3 | |
---|
4 | import os |
---|
5 | |
---|
6 | buildroot = os.getcwd() |
---|
7 | |
---|
8 | os.chdir('source') |
---|
9 | os.chdir('anuga') |
---|
10 | print |
---|
11 | print '======================= anuga tests =================================' |
---|
12 | print 'Changing to', os.getcwd() # This is now different from buildroot |
---|
13 | execfile('test_all.py') |
---|
14 | |
---|
15 | |
---|
16 | os.chdir('..') |
---|
17 | os.chdir('pymetis') |
---|
18 | print |
---|
19 | print '===================== pymetis tests =================================' |
---|
20 | print 'Changing to', os.getcwd() |
---|
21 | execfile('test_all.py') |
---|
22 | |
---|
23 | os.chdir('..') |
---|
24 | os.chdir('anuga_parallel') |
---|
25 | print |
---|
26 | print '===================== anuga_parallel tests ==========================' |
---|
27 | print 'Changing to', os.getcwd() |
---|
28 | execfile('test_all.py') |
---|
29 | |
---|
30 | print |
---|
31 | print '************************** NOTE *************************************' |
---|
32 | print 'If all unit tests passed you should run the suite of validation tests' |
---|
33 | print 'Go to the directory anuga_validation/automated_validation_tests' |
---|
34 | print 'and run' |
---|
35 | print ' python validate_all.py' |
---|
36 | print |
---|
37 | print 'These tests will take a few hours and will verify that ANUGA' |
---|
38 | print 'produces the physical results expected.' |
---|
39 | print '*********************************************************************' |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | # Temporary bail out |
---|
44 | import sys; sys.exit() |
---|
45 | |
---|
46 | |
---|
47 | #--------------------------- |
---|
48 | # IP Data Audit (in source/anuga directory as well) |
---|
49 | #--------------------------- |
---|
50 | |
---|
51 | # Create temporary area for svn to export source files |
---|
52 | # FIXME (Ole): It would be good to make sure these files |
---|
53 | # are exactly the same as those walked over by the |
---|
54 | # release script: create_distribution. |
---|
55 | # |
---|
56 | # Come to think of it - this is probably not the best |
---|
57 | # place for this check. It may have to move up one level. |
---|
58 | # What do you all think? |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | temp_dir = mktemp() |
---|
63 | |
---|
64 | print 'Temp dir', temp_dir |
---|
65 | os.mkdir(temp_dir) |
---|
66 | |
---|
67 | # Get the ANUGA core source files |
---|
68 | s = 'svn export . %s%sanuga' %(temp_dir, os.sep) |
---|
69 | print s |
---|
70 | os.system(s) |
---|
71 | |
---|
72 | print 'Verifying data IP' |
---|
73 | if not IP_verified(temp_dir): |
---|
74 | msg = 'Files have not been verified for IP.\n' |
---|
75 | msg += 'Each data file must have a license file with it.' |
---|
76 | raise Exception, msg |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | |
---|
82 | |
---|