[Avida-SVN] r1825 - trunk/tests/_testrunner

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Thu Jul 19 07:32:37 PDT 2007


Author: brysonda
Date: 2007-07-19 10:32:37 -0400 (Thu, 19 Jul 2007)
New Revision: 1825

Modified:
   trunk/tests/_testrunner/testrunner.py
Log:
Update trunk to TestRunner 1.4c

Modified: trunk/tests/_testrunner/testrunner.py
===================================================================
--- trunk/tests/_testrunner/testrunner.py	2007-07-19 14:28:47 UTC (rev 1824)
+++ trunk/tests/_testrunner/testrunner.py	2007-07-19 14:32:37 UTC (rev 1825)
@@ -52,7 +52,7 @@
 
 # Global Constants
 # ---------------------------------------------------------------------------------------------------------------------------
-TESTRUNNER_VERSION = "1.4"
+TESTRUNNER_VERSION = "1.4c"
 TESTRUNNER_COPYRIGHT = "2007"
 
 TRUE_STRINGS = ("y","Y","yes","Yes","true","True","1")
@@ -172,8 +172,10 @@
   test_list = ";--- Begin Test Configuration File (%s) ---" % TEST_LIST
   test_list += """
 [main]
-args =                   ; Command line arguments to pass to the application
-app = %(app)s            ; Application path to test
+; Command line arguments to pass to the application
+args =                   
+
+app = %(default_app)s            ; Application path to test
 nonzeroexit = disallow   ; Exit code handling (disallow, allow, or require)
                          ;  disallow - treat non-zero exit codes as failures
                          ;  allow - all exit codes are acceptable
@@ -283,7 +285,10 @@
 
     
     # Load the App for the test and check that it exists
-    self.app = self.getSetting("main", "app")
+    try:
+      self.app = self.cfg.get('main', 'app', False, settings)
+    except:
+      self.app = settings['default_app']
     self.app = os.path.abspath(self.app)
     if not os.path.exists(self.app):
       print "Error: Application (%s) not found" % self.app
@@ -321,17 +326,6 @@
   
 
 
-  # string cTest::getSetting(string sect, string opt) {
-  def getSetting(self, sect, opt):
-    global settings
-    try:
-      return self.cfg.get(sect, opt, False, settings)
-    except:
-      return settings[opt]
-  # } // End of cTest::getSetting()
-  
-  
-  
   # bool cTest::isConsistencyTest() {
   def isConsistencyTest(self): return self.consistency_enabled
   # } // End of isConsistencyTest()
@@ -794,7 +788,7 @@
 
     sem.acquire()
     ti += 1
-    sys.stdout.write("\rPerforming Test:  % 4d of %d" % (ti, len(tests)))
+    sys.stdout.write("\rPerforming Test:  %4d of %d -- %-45s " % (ti, len(tests), test.name[:45]))
     sys.stdout.flush()
     tthread = threading.Thread(target=runTestWrapper, args=(test, sem))
     tthread.start()
@@ -896,7 +890,7 @@
   # Setup Global Settings
   #  - settings that begin with an underscore (i.e. _testrunner_name) are for internal use and are not intended for
   #    use as variables in test_list configuration files
-  settings["app"] = "" # App is defined later, since values like builddir can be modified by cmdline settings
+  settings["default_app"] = "" # App is defined later, since values like builddir can be modified by cmdline settings
   settings["builddir"] = getConfig("testrunner", "builddir", "build")
   settings["mode"] = getConfig("testrunner", "mode", "local")
   settings["svn"] = getConfig("testrunner", "svn", "svn")
@@ -996,7 +990,7 @@
 
   # Load the default app to test
   try:
-    settings["app"] = cfg.get("main", "app")
+    settings["default_app"] = cfg.get("main", "app")
   except:
     print "Warning: No default app configured"
   




More information about the Avida-cvs mailing list