[mapserver-commits] r11287 - trunk/msautotest/pymod

svn at osgeo.org svn at osgeo.org
Sun Mar 20 14:40:16 EDT 2011


Author: warmerdam
Date: 2011-03-20 11:40:16 -0700 (Sun, 20 Mar 2011)
New Revision: 11287

Modified:
   trunk/msautotest/pymod/mstestlib.py
Log:
add support for -v test flag and usage report

Modified: trunk/msautotest/pymod/mstestlib.py
===================================================================
--- trunk/msautotest/pymod/mstestlib.py	2011-03-20 18:38:37 UTC (rev 11286)
+++ trunk/msautotest/pymod/mstestlib.py	2011-03-20 18:40:16 UTC (rev 11287)
@@ -281,6 +281,7 @@
     valgrind = 0 
     shp2img = 'shp2img'
     renderer = None
+    verbose = 0
 
     ###########################################################################
     # Process arguments.
@@ -288,12 +289,22 @@
     for i in range(len(argv)):
         if argv[i] == '-shp2img':
             shp2img = argv[i+1]
-        if argv[i] == '-keep':
+        elif argv[i] == '-keep':
             keep_pass = 1
-        if argv[i] == '-valgrind':
+        elif argv[i] == '-valgrind':
             valgrind = 1
-        if argv[i] == '-renderer':
+        elif argv[i] == '-renderer':
             renderer = argv[i+1]
+        elif argv[i] == '-v':
+            verbose = 1
+        elif argv[i][-4:] == '.map':
+            pass
+        else:
+            print( 'Unrecognised argument: %s' % argv[i] )
+            print( 'Usage: run_test.py [-v] [-keep] [-valgrind]\n' + 
+                   '                   [-shp2img <file>] [-renderer <name>]\n' +
+                   '                   [mapfilename]*' )
+            sys.exit( 1 )
 
     ###########################################################################
     # Create results directory if it does not already exist.
@@ -382,6 +393,11 @@
             if valgrind:
                 command = command.strip()
                 command = 'valgrind --tool=memcheck --leak-check=full %s 2>result/%s.txt'%(command, out_file+".vgrind.txt")
+
+            if verbose:
+                print('')
+                print( command )
+                
             os.system( command )
 
             if demime:



More information about the mapserver-commits mailing list