mailr10794 - /1.3/relax


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 22, 2010 - 10:13:
Author: bugman
Date: Mon Feb 22 10:13:04 2010
New Revision: 10794

URL: http://svn.gna.org/viewcvs/relax?rev=10794&view=rev
Log:
Args after the flags -x, -u, -s are now considered to be the tests performed 
and not a script.


Modified:
    1.3/relax

Modified: 1.3/relax
URL: 
http://svn.gna.org/viewcvs/relax/1.3/relax?rev=10794&r1=10793&r2=10794&view=diff
==============================================================================
--- 1.3/relax (original)
+++ 1.3/relax Mon Feb 22 10:13:04 2010
@@ -126,7 +126,7 @@
             self.interpreter.on()
 
             # Run the tests.
-            runner = Test_suite_runner()
+            runner = Test_suite_runner(self.tests)
             runner.run_all_tests()
 
         # Execute the relax system tests.
@@ -136,13 +136,13 @@
             self.interpreter.on()
 
             # Run the tests.
-            runner = Test_suite_runner()
+            runner = Test_suite_runner(self.tests)
             runner.run_system_tests()
 
         # Execute the relax unit tests.
         elif mode == 'unit tests':
             # Run the tests.
-            runner = Test_suite_runner()
+            runner = Test_suite_runner(self.tests)
             runner.run_unit_tests()
 
         # Test mode.
@@ -213,18 +213,24 @@
         else:
             tee_file = None
 
-        # Number of positional arguements should only be 0 or 1.  1 should 
be the script file.
-        if len(args) > 1:
-            parser.error("incorrect number of arguments")
-
-        # Script file.
-        self.script_file = None
-        if len(args) == 1:
-            self.script_file = args[0]
-
-            # Test if the script file exists.
-            if not access(self.script_file, F_OK):
-                parser.error("the script file " + repr(self.script_file) + " 
does not exist")
+        # Test suite mode, therefore the args are the tests to run and not a 
script file.
+        if options.test_suite or options.system_tests or options.unit_tests:
+            self.tests = args
+
+        # The argument is a script.
+        else:
+            # Number of positional arguments should only be 0 or 1.  1 
should be the script file.
+            if len(args) > 1:
+                parser.error("incorrect number of arguments")
+
+            # Script file.
+            self.script_file = None
+            if len(args) == 1:
+                self.script_file = args[0]
+
+                # Test if the script file exists.
+                if not access(self.script_file, F_OK):
+                    parser.error("the script file " + repr(self.script_file) 
+ " does not exist")
 
 
         # Determine the relax mode and test for mutually exclusive modes.
@@ -236,10 +242,6 @@
 
         # Run the relax tests.
         elif options.test_suite or options.system_tests or 
options.unit_tests:
-            # Make sure no script is supplied.
-            if self.script_file:
-                parser.error("a script should not be supplied when executing 
the test suite")
-
             # Exclusive modes.
             if options.test:
                 parser.error("executing the relax test suite and running 
relax in test mode are mutually exclusive")
@@ -254,7 +256,6 @@
             elif options.unit_tests:
                 mode = 'unit tests'
 
-
         # Test mode.
         elif options.test:
             # Make sure no script is supplied.




Related Messages


Powered by MHonArc, Updated Mon Feb 22 10:20:05 2010