[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 | |
---|
[9241] | 8 | |
---|
| 9 | |
---|
[8129] | 10 | os.chdir('source') |
---|
| 11 | os.chdir('anuga') |
---|
| 12 | print |
---|
| 13 | print '======================= anuga tests =================================' |
---|
| 14 | print 'Changing to', os.getcwd() # This is now different from buildroot |
---|
| 15 | execfile('test_all.py') |
---|
| 16 | |
---|
| 17 | |
---|
[9301] | 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') |
---|
[8949] | 25 | |
---|
[9085] | 26 | |
---|
| 27 | |
---|
[8779] | 28 | # Try to run parallel tests if pypar is installed |
---|
[9301] | 29 | from anuga import pypar_available |
---|
| 30 | |
---|
| 31 | if pypar_available: |
---|
[8761] | 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') |
---|
[9301] | 39 | else: |
---|
| 40 | print 'anuga_parallel tests not run as pypar not installed' |
---|
[8129] | 41 | |
---|
[8761] | 42 | |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | |
---|
[8779] | 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 | """ |
---|
[8129] | 51 | print |
---|
| 52 | print '************************** NOTE *************************************' |
---|
| 53 | print 'If all unit tests passed you should run the suite of validation tests' |
---|
| 54 | print 'Go to the directory anuga_validation/automated_validation_tests' |
---|
| 55 | print 'and run' |
---|
| 56 | print ' python validate_all.py' |
---|
| 57 | print |
---|
| 58 | print 'These tests will take a few hours and will verify that ANUGA' |
---|
| 59 | print 'produces the physical results expected.' |
---|
| 60 | print '*********************************************************************' |
---|
[8779] | 61 | """ |
---|
[8129] | 62 | |
---|
| 63 | |
---|
| 64 | # Temporary bail out |
---|
| 65 | import 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 | |
---|
| 83 | temp_dir = mktemp() |
---|
| 84 | |
---|
| 85 | print 'Temp dir', temp_dir |
---|
| 86 | os.mkdir(temp_dir) |
---|
| 87 | |
---|
| 88 | # Get the ANUGA core source files |
---|
| 89 | s = 'svn export . %s%sanuga' %(temp_dir, os.sep) |
---|
| 90 | print s |
---|
| 91 | os.system(s) |
---|
| 92 | |
---|
| 93 | print 'Verifying data IP' |
---|
| 94 | if 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 | |
---|