mailr6573 - in /1.3/test_suite: test_suite_runner.py 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 edward on June 29, 2008 - 12:27:
Author: bugman
Date: Sun Jun 29 12:06:51 2008
New Revision: 6573

URL: http://svn.gna.org/viewcvs/relax?rev=6573&view=rev
Log:
Sent the absolute relax path into the Unit_test_runner.


Modified:
    1.3/test_suite/test_suite_runner.py
    1.3/test_suite/unit_tests/unit_test_runner.py

Modified: 1.3/test_suite/test_suite_runner.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/test_suite_runner.py?rev=6573&r1=6572&r2=6573&view=diff
==============================================================================
--- 1.3/test_suite/test_suite_runner.py (original)
+++ 1.3/test_suite/test_suite_runner.py Sun Jun 29 12:06:51 2008
@@ -19,6 +19,10 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
 #                                                                            
 #
 
###############################################################################
+
+# Python module imports.
+import os
+import sys
 
 # Formatting.
 from formatting import heading, summary_line
@@ -80,7 +84,7 @@
         heading('Unit tests')
 
         # Run the tests.
-        unit_runner = Unit_test_runner(root_path='test_suite/unit_tests')
+        unit_runner = Unit_test_runner(root_path=sys.path[-1] + os.sep + 
'test_suite/unit_tests')
         self.unit_result = unit_runner.run(runner=RelaxTestRunner())
 
 

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=6573&r1=6572&r2=6573&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/unit_test_runner.py (original)
+++ 1.3/test_suite/unit_tests/unit_test_runner.py Sun Jun 29 12:06:51 2008
@@ -287,6 +287,7 @@
     @return:
     '''
 
+    print "Hello1: " + `package_path`
     result = None
     packages = None
     package_path=get_module_relative_path(package_path, module_name)
@@ -305,11 +306,16 @@
         result.addTest(bad_syntax)
 
 
+    print "Hello2: " + `package_path`
+    print "Hello3: " + `packages`
+    import sys
+    print "sys.path: " + `sys.path`
     if packages != None:
         # some input packages may not contain the required class
         if hasattr(packages[-1], class_name):
             clazz =  getattr(packages[-1], class_name)
             result = unittest.TestLoader().loadTestsFromTestCase(clazz)
+
     return result
 
 
@@ -370,6 +376,7 @@
                                    a file as one containing a unit test 
TestCase
         '''
 
+        print "root_path: " + `root_path`
         self.root_path = root_path
         if self.root_path == None:
             self.root_path = get_startup_path()
@@ -378,6 +385,7 @@
             self.patterns.append(re.compile(pattern))
         self.paths_scanned = False
 
+        print "root_path: " + `self.root_path`
 
     def scan_paths(self):
         '''Scan directories and paths for unit test classes and load them 
into TestSuites
@@ -393,6 +401,9 @@
             if __debug__:
                 dir_names=dir_names
 
+            print "Walk, dir_path: " + `dir_path`
+            print "Walk, dir_names: " + `dir_names`
+            print "Walk, file_names: " + `file_names`
             for file_name in file_names:
                 module_found = None
                 for pattern in self.patterns:
@@ -406,7 +417,9 @@
                     class_name = string.upper(module_found[0]) + 
module_found[1:]
 
 
+                    print "dir_path: " + `dir_path`
                     module_path = get_module_relative_path(dir_path, 
module_found)
+                    print "Module_path: " + `module_path`
                     #FIXME add verbose search option
                     #if self.verbose:
                     #    print 'loading module: ' + module_path
@@ -707,6 +720,7 @@
                 result.add(tuple(mpath))
 
 
+        print "XXX: " + `result`
         return result
 
 
@@ -742,7 +756,9 @@
 
 
         module_paths = self.paths_from_test_module(self.test_module)
-        if self.verbose:
+        print "Hello: " + `self.test_module`
+        print "Hello: " + `module_paths`
+        if 1:
             print 'root path:          ', self.root_path
             print 'system directory:   ', self.system_directory
             print 'unit test directory:', self.unit_test_directory
@@ -753,8 +769,8 @@
 
 
         # add SystemDirectory to python path
-        sys.path.pop(0)
-        sys.path.insert(0,self.system_directory)
+        #sys.path.pop(0)
+        #sys.path.insert(0,self.system_directory)
 
 
 
@@ -764,6 +780,10 @@
         for module_path in module_paths:
             module_string = os.path.join(*module_path)
 
+            # Convert to an absolute path.
+            #module_string = sys.path[-1] + os.sep + module_string
+
+            print "module_string: " + `module_string`
             if os.path.isdir(module_string):
                 #iterate and load unit tests from module path
                 finder = Test_finder(module_string, self.test_case_patterns)
@@ -772,9 +792,10 @@
                 break
 
 
+        print "Module paths: " +`module_paths`
         if tests == None:
             for module_path in module_paths:
-                print module_path
+                print "Module path: " +`module_path`
                 path_len = len(module_path)
                 if path_len <= 1:
                     continue




Related Messages


Powered by MHonArc, Updated Sun Jun 29 14:00:28 2008