mailr3177 - /1.3/test_suite/unit_tests/unit_test_runner.py


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

Header


Content

Posted by garyt on March 13, 2007 - 11:57:
Author: varioustoxins
Date: Tue Mar 13 11:56:38 2007
New Revision: 3177

URL: http://svn.gna.org/viewcvs/relax?rev=3177&view=rev
Log:
improved messages for bad input

Modified:
    1.3/test_suite/unit_tests/unit_test_runner.py

Modified: 1.3/test_suite/unit_tests/unit_test_runner.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/unit_test_runner.py?rev=3177&r1=3176&r2=3177&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/unit_test_runner.py (original)
+++ 1.3/test_suite/unit_tests/unit_test_runner.py Tue Mar 13 11:56:38 2007
@@ -551,18 +551,17 @@
                break
            else:
                extended_seg_path =  copy(seg_path)
-               for elem in  seg_target_directory[-1::-1]:
-                   extended_seg_path.append(elem)
-                   if os.path.exists(os.path.join(*extended_seg_path)):
-                       found_seg_path=extended_seg_path
-                       break
+               extended_seg_path.extend(seg_target_directory)
+               if os.path.exists(os.path.join(*extended_seg_path)):
+                   found_seg_path=extended_seg_path
+                   break
 
            #if len(seg_path) != 0:
            seg_path.pop()
 
 
         result = None
-        if len(found_seg_path) != 0:
+        if found_seg_path != None and len(found_seg_path) != 0:
             seg_offset_path = segment_path(offset_path)
             found_seg_path.extend(seg_offset_path)
             #print 'pre join', os.path.join(seg_path),seg_path
@@ -804,13 +803,17 @@
 
 
         # Run the unit tests and catch the TestResult object.
-        if tests != None:
+        if tests != None and tests.countTestCases() != 0:
             results = runner.run(tests)
             result_string = results.wasSuccessful()
+        elif tests == None:
+            results=None
+            result_string = 'Error: no test directories found for input 
module: %s' % self.test_module
+            print result_string
         else:
-            print 'error no test cases found for input!'
-            results=False
-            result_string = 'Error no tests found'
+            results=None
+            result_string = 'note: no tests found for input module: %s' % 
self.test_module
+            print result_string
 
         #Return the result of all the tests.
         return result_string
@@ -892,6 +895,7 @@
     if len(args) < 1:
         args = [None]
 
+    print 'arsg',args
     for arg in args:
         runner = Run_unit_tests(test_module=arg, verbose=options.verbose)
         runner.run()




Related Messages


Powered by MHonArc, Updated Wed Mar 14 04:00:08 2007