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