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