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