[llvm] r234242 - [lit] Fix running gtest type-parameterized tests on Windows

Evgeniy Stepanov eugeni.stepanov at gmail.com
Tue Apr 7 01:54:30 PDT 2015


This broke the sanitizer bot with

******************** TEST 'ThreadSanitizer-Unit ::
rtl/TsanRtlTest/DISABLED_SLOW_ThreadSanitizer.ThreadALot' FAILED
********************
Unable to find '[  PASSED  ] 1 test.' in gtest output:

Note: Google Test filter = DISABLED_SLOW_ThreadSanitizer.ThreadALot
[==========] Running 0 tests from 0 test cases.
[==========] 0 tests from 0 test cases ran. (0 ms total)
[  PASSED  ] 0 tests.


Unresolved Tests (17):
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.FuncCall
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop1
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop1Read
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop1Write
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop2
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop2Read
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop2Write
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop4
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop4Read
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop4Write
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop8
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop8Read
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.Mop8Write
    ThreadSanitizer-Unit :: rtl/TsanRtlTest/DISABLED_BENCH.MutexLocal
    ThreadSanitizer-Unit ::
rtl/TsanRtlTest/DISABLED_BENCH_ThreadSanitizer.Singleton
    ThreadSanitizer-Unit ::
rtl/TsanRtlTest/DISABLED_BENCH_ThreadSanitizer.StopFlag
    ThreadSanitizer-Unit ::
rtl/TsanRtlTest/DISABLED_SLOW_ThreadSanitizer.ThreadALot


On Tue, Apr 7, 2015 at 12:49 AM, Reid Kleckner <reid at kleckner.net> wrote:
> Author: rnk
> Date: Mon Apr  6 16:49:55 2015
> New Revision: 234242
>
> URL: http://llvm.org/viewvc/llvm-project?rev=234242&view=rev
> Log:
> [lit] Fix running gtest type-parameterized tests on Windows
>
> The '/' character in the test name of a type-parameterized test is not a
> path separator, and should not be '\' on Windows. We were passing a test
> name to --gtest_filter which found no tests, so the exit code was zero,
> indicating a passed test.
>
> This bug has been here since r84387 in 2009, when Jeff Yasskin added the
> original lit support for type-paratermized tests. Somewhere along the
> line some of the ValueMapTests started failing, but we can fix those
> separately.
>
> Modified:
>     llvm/trunk/unittests/IR/ValueMapTest.cpp
>     llvm/trunk/utils/lit/lit/formats/googletest.py
>
> Modified: llvm/trunk/unittests/IR/ValueMapTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/ValueMapTest.cpp?rev=234242&r1=234241&r2=234242&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/ValueMapTest.cpp (original)
> +++ llvm/trunk/unittests/IR/ValueMapTest.cpp Mon Apr  6 16:49:55 2015
> @@ -194,7 +194,8 @@ struct LockMutex : ValueMapConfig<KeyT,
>    }
>    static MutexT *getMutex(const ExtraData &Data) { return Data.M; }
>  };
> -#if LLVM_ENABLE_THREADS
> +// FIXME: These tests started failing on Windows.
> +#if LLVM_ENABLE_THREADS && !defined(LLVM_ON_WIN32)
>  TYPED_TEST(ValueMapTest, LocksMutex) {
>    sys::Mutex M(false);  // Not recursive.
>    bool CalledRAUW = false, CalledDeleted = false;
>
> Modified: llvm/trunk/utils/lit/lit/formats/googletest.py
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/formats/googletest.py?rev=234242&r1=234241&r2=234242&view=diff
> ==============================================================================
> --- llvm/trunk/utils/lit/lit/formats/googletest.py (original)
> +++ llvm/trunk/utils/lit/lit/formats/googletest.py Mon Apr  6 16:49:55 2015
> @@ -95,7 +95,7 @@ class GoogleTest(TestFormat):
>              # Handle GTest parametrized and typed tests, whose name includes
>              # some '/'s.
>              testPath, namePrefix = os.path.split(testPath)
> -            testName = os.path.join(namePrefix, testName)
> +            testName = namePrefix + '/' + testName
>
>          cmd = [testPath, '--gtest_filter=' + testName]
>          if litConfig.useValgrind:
> @@ -107,7 +107,14 @@ class GoogleTest(TestFormat):
>          out, err, exitCode = lit.util.executeCommand(
>              cmd, env=test.config.environment)
>
> -        if not exitCode:
> -            return lit.Test.PASS,''
> +        if exitCode:
> +            return lit.Test.FAIL, out + err
> +
> +        passing_test_line = '[  PASSED  ] 1 test.'
> +        if passing_test_line not in out:
> +            msg = ('Unable to find %r in gtest output:\n\n%s%s' %
> +                   (passing_test_line, out, err))
> +            return lit.Test.UNRESOLVED, msg
> +
> +        return lit.Test.PASS,''
>
> -        return lit.Test.FAIL, out + err
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list