<div dir="ltr"><div style>Hi Galina!</div><br><div class="gmail_extra"><div class="gmail_quote">On Sun, May 26, 2013 at 7:58 AM, Galina Kistanova <span dir="ltr"><<a href="mailto:gkistanova@gmail.com" target="_blank">gkistanova@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: gkistanova<br>
Date: Sat May 25 22:58:41 2013<br>
New Revision: 182715<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=182715&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=182715&view=rev</a><br>
Log:<br>
Fixed bug when tests in executable partially used absolute paths.<br>
<br>
Modified:<br>
    llvm/trunk/utils/lit/lit/TestFormats.py<br>
<br>
Modified: llvm/trunk/utils/lit/lit/TestFormats.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestFormats.py?rev=182715&r1=182714&r2=182715&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestFormats.py?rev=182715&r1=182714&r2=182715&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/utils/lit/lit/TestFormats.py (original)<br>
+++ llvm/trunk/utils/lit/lit/TestFormats.py Sat May 25 22:58:41 2013<br>
@@ -61,9 +61,9 @@ class GoogleTest(object):<br>
         (dirname, basename) = os.path.split(execpath)<br>
         # Discover the tests in this executable.<br>
         for testname in self.getGTestTests(execpath, litConfig, localConfig):<br>
-            testPath = path_in_suite + (dirname, basename, testname)<br>
-            yield Test.Test(testSuite, testPath, localConfig)<br>
-<br>
+            testPath_in_suite = path_in_suite + (basename, testname)<br>
+            yield Test.Test(testSuite, testPath_in_suite, localConfig)<br></blockquote><div><br></div><div style>I think this is wrong. When I run unittests locally, file /some/gtest/executable is called as:</div><div style>
/some/gtest/executable --gtest_filter="executable/test.case"</div><div style>instead of:</div><div style>/some/gtest/executable --gtest_filter="test.case"</div><div style><br></div><div style>As a result, *all the unit tests silently pass*.</div>
<div style>I think r182758 deals with it, but double-checking would be nice.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

+<br>
     def getTestsInDirectory(self, testSuite, path_in_suite,<br>
                             litConfig, localConfig):<br>
         source_path = testSuite.getSourcePath(path_in_suite)<br>
@@ -73,15 +73,17 @@ class GoogleTest(object):<br>
                 # Iterate over executables in a directory.<br>
                 if not os.path.normcase(filename) in self.test_sub_dir:<br>
                     continue<br>
+                filepath_in_suite = path_in_suite + (filename, )<br>
                 for subfilename in os.listdir(filepath):<br>
                     execpath = os.path.join(filepath, subfilename)<br>
                     for test in self.getTestsInExecutable(<br>
-                            testSuite, path_in_suite, execpath,<br>
+                            testSuite, filepath_in_suite, execpath,<br>
                             litConfig, localConfig):<br>
                       yield test<br>
             elif ('.' in self.test_sub_dir):<br>
+                filepath_in_suite = path_in_suite + (filename, )<br>
                 for test in self.getTestsInExecutable(<br>
-                        testSuite, path_in_suite, filepath,<br>
+                        testSuite, filepath_in_suite, filepath,<br>
                         litConfig, localConfig):<br>
                     yield test<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>