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