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