[llvm] r182715 - Fixed bug when tests in executable partially used absolute paths.

Galina Kistanova gkistanova at gmail.com
Wed May 29 15:05:44 PDT 2013


I have got it reproduced. Thanks, Alexey!


On Wed, May 29, 2013 at 1:23 AM, Alexey Samsonov <samsonov at google.com>wrote:

> Hi Galina,
>
> I use cmake for an out-of-tree build (cmake -DCMAKE_BUILD_TYPE=Release ...
> /path/to/llvm). I think you may try to reproduce the problem by configuring
> cmake build tree,
> applying the change (breaking the unit test):
>
> $ svn diff unittests/ADT/APFloatTest.cpp
> Index: unittests/ADT/APFloatTest.cpp
> ===================================================================
> --- unittests/ADT/APFloatTest.cpp (revision 182753)
> +++ unittests/ADT/APFloatTest.cpp (working copy)
> @@ -52,7 +52,7 @@
>      f2.divide(Val2, rdmd);
>      APFloat f3(12.0f);
>      f1.fusedMultiplyAdd(f2, f3, APFloat::rmNearestTiesToEven);
> -    EXPECT_EQ(12.0f, f1.convertToFloat());
> +    EXPECT_EQ(13.0f, f1.convertToFloat());
>    }
>  }
>
> then in the build tree:
> $ make check-llvm -j12
> Testing Time: 28.15s
>   Expected Passes    : 8091
>   Expected Failures  : 50
>   Unsupported Tests  : 18
>
> OTOH:
> $ unittests/ADT/ADTTests --gtest_filter=APFloatTest.FMA
> Note: Google Test filter = APFloatTest.FMA
> [==========] Running 1 test from 1 test case.
> [----------] Global test environment set-up.
> [----------] 1 test from APFloatTest
> [ RUN      ] APFloatTest.FMA
> /usr/local/google/llvm/unittests/ADT/APFloatTest.cpp:55: Failure
> Value of: f1.convertToFloat()
>   Actual: 12
> Expected: 13.0f
> Which is: 13
> [  FAILED  ] APFloatTest.FMA (1 ms)
> [----------] 1 test from APFloatTest (1 ms total)
>
> [----------] Global test environment tear-down
> [==========] 1 test from 1 test case ran. (1 ms total)
> [  PASSED  ] 0 tests.
> [  FAILED  ] 1 test, listed below:
> [  FAILED  ] APFloatTest.FMA
>
>  1 FAILED TEST
>
>
>
> On Tue, May 28, 2013 at 11:48 PM, Galina Kistanova <gkistanova at gmail.com>wrote:
>
>> Hi Alexey,
>>
>> Can you provide more details please? Do you build in tree or out of tree?
>>
>> Thanks
>>
>> Galina
>>
>>
>>
>> On Tue, May 28, 2013 at 3:09 AM, Alexey Samsonov <samsonov at google.com>wrote:
>>
>>> Hm the buildbots are going red :(
>>> Reverting this change with my fix altogether.
>>>
>>>
>>> On Tue, May 28, 2013 at 1:44 PM, Alexey Samsonov <samsonov at google.com>wrote:
>>>
>>>> Hi Galina!
>>>>
>>>> On Sun, May 26, 2013 at 7:58 AM, Galina Kistanova <gkistanova at gmail.com
>>>> > wrote:
>>>>
>>>>> Author: gkistanova
>>>>> Date: Sat May 25 22:58:41 2013
>>>>> New Revision: 182715
>>>>>
>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=182715&view=rev
>>>>> Log:
>>>>> Fixed bug when tests in executable partially used absolute paths.
>>>>>
>>>>> Modified:
>>>>>     llvm/trunk/utils/lit/lit/TestFormats.py
>>>>>
>>>>> Modified: llvm/trunk/utils/lit/lit/TestFormats.py
>>>>> URL:
>>>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestFormats.py?rev=182715&r1=182714&r2=182715&view=diff
>>>>>
>>>>> ==============================================================================
>>>>> --- llvm/trunk/utils/lit/lit/TestFormats.py (original)
>>>>> +++ llvm/trunk/utils/lit/lit/TestFormats.py Sat May 25 22:58:41 2013
>>>>> @@ -61,9 +61,9 @@ class GoogleTest(object):
>>>>>          (dirname, basename) = os.path.split(execpath)
>>>>>          # Discover the tests in this executable.
>>>>>          for testname in self.getGTestTests(execpath, litConfig,
>>>>> localConfig):
>>>>> -            testPath = path_in_suite + (dirname, basename, testname)
>>>>> -            yield Test.Test(testSuite, testPath, localConfig)
>>>>> -
>>>>> +            testPath_in_suite = path_in_suite + (basename, testname)
>>>>> +            yield Test.Test(testSuite, testPath_in_suite, localConfig)
>>>>>
>>>>
>>>> I think this is wrong. When I run unittests locally, file
>>>> /some/gtest/executable is called as:
>>>> /some/gtest/executable --gtest_filter="executable/test.case"
>>>> instead of:
>>>> /some/gtest/executable --gtest_filter="test.case"
>>>>
>>>> As a result, *all the unit tests silently pass*.
>>>> I think r182758 deals with it, but double-checking would be nice.
>>>>
>>>>
>>>>
>>>>> +
>>>>>      def getTestsInDirectory(self, testSuite, path_in_suite,
>>>>>                              litConfig, localConfig):
>>>>>          source_path = testSuite.getSourcePath(path_in_suite)
>>>>> @@ -73,15 +73,17 @@ class GoogleTest(object):
>>>>>                  # Iterate over executables in a directory.
>>>>>                  if not os.path.normcase(filename) in
>>>>> self.test_sub_dir:
>>>>>                      continue
>>>>> +                filepath_in_suite = path_in_suite + (filename, )
>>>>>                  for subfilename in os.listdir(filepath):
>>>>>                      execpath = os.path.join(filepath, subfilename)
>>>>>                      for test in self.getTestsInExecutable(
>>>>> -                            testSuite, path_in_suite, execpath,
>>>>> +                            testSuite, filepath_in_suite, execpath,
>>>>>                              litConfig, localConfig):
>>>>>                        yield test
>>>>>              elif ('.' in self.test_sub_dir):
>>>>> +                filepath_in_suite = path_in_suite + (filename, )
>>>>>                  for test in self.getTestsInExecutable(
>>>>> -                        testSuite, path_in_suite, filepath,
>>>>> +                        testSuite, filepath_in_suite, filepath,
>>>>>                          litConfig, localConfig):
>>>>>                      yield test
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> llvm-commits mailing list
>>>>> llvm-commits at cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Alexey Samsonov, MSK
>>>>
>>>
>>>
>>>
>>> --
>>> Alexey Samsonov, MSK
>>>
>>
>>
>
>
> --
> Alexey Samsonov, MSK
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130529/82a3aee3/attachment.html>


More information about the llvm-commits mailing list