From 10b0108bdd195b1a10986b2334ed9b51d163978b Mon Sep 17 00:00:00 2001 From: Janik Zikovsky <zikovskyjl@ornl.gov> Date: Thu, 13 Jan 2011 19:19:05 +0000 Subject: [PATCH] Refs #2190: Should fix finding source files. --- Code/Tools/TestViewer/.pydevproject | 2 +- Code/Tools/TestViewer/test_info.py | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Code/Tools/TestViewer/.pydevproject b/Code/Tools/TestViewer/.pydevproject index 27936290b43..8dd56925a2b 100644 --- a/Code/Tools/TestViewer/.pydevproject +++ b/Code/Tools/TestViewer/.pydevproject @@ -5,6 +5,6 @@ <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property> <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> -<path>/TestViewer/src</path> +<path>/TestViewer</path> </pydev_pathproperty> </pydev_project> diff --git a/Code/Tools/TestViewer/test_info.py b/Code/Tools/TestViewer/test_info.py index 27313a23b7a..499c1b85b01 100644 --- a/Code/Tools/TestViewer/test_info.py +++ b/Code/Tools/TestViewer/test_info.py @@ -670,10 +670,7 @@ class TestProject(object): """ Find the source file corresponding to the given suite in this project Returns: the full path to the test file. """ - source_base_dir = "/home/8oz/Code/Mantid/Code/Mantid/Framework/" - project_name = self.name.replace("Test", "") - source_dir = os.path.join(source_base_dir, project_name) - return os.path.join( source_dir, "test/" + suite_name + ".h") + return os.path.join( self.source_path, "test/" + suite_name + ".h") #---------------------------------------------------------------------------------- @@ -716,9 +713,12 @@ class TestProject(object): return self.state.get_string() + " (%d)" % (self.num_run) #, self.num_run) #---------------------------------------------------------------------------------- - def populate(self): - """ Discover the suites and single tests in this test project. """ + def populate(self, project_source_path): + """ Discover the suites and single tests in this test project. + @param project_source_path :: root path to the project. e.g. Framework/Kernel + """ self.suites = [] + self.source_path = project_source_path # CXX test simply lists "TestSuite testName" last_suite_name = "" @@ -932,7 +932,11 @@ class MultipleProjects(object): make_command = "cd %s ; make %s -j%d " % (os.path.join(path, ".."), fname, num_threads) pj = TestProject(fname, os.path.join(path, fname), make_command) print "... Populating project %s ..." % fname - pj.populate() + + project_name = fname.replace("Test", "") + project_source_path = os.path.join(source_path, project_name) + + pj.populate(project_source_path) self.projects.append(pj) #-------------------------------------------------------------------------- -- GitLab