[PATCH] D102899: [lit] Print full googletest commad line
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 20 23:55:58 PDT 2021
vitalybuka updated this revision to Diff 346935.
vitalybuka added a comment.
upgrade formating
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102899/new/
https://reviews.llvm.org/D102899
Files:
llvm/utils/lit/lit/formats/googletest.py
llvm/utils/lit/tests/googletest-format.py
llvm/utils/lit/tests/googletest-timeout.py
llvm/utils/lit/tests/googletest-upstream-format.py
Index: llvm/utils/lit/tests/googletest-upstream-format.py
===================================================================
--- llvm/utils/lit/tests/googletest-upstream-format.py
+++ llvm/utils/lit/tests/googletest-upstream-format.py
@@ -10,8 +10,12 @@
# CHECK: -- Testing:
# CHECK: PASS: googletest-upstream-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestA
-# CHECK: FAIL: googletest-upstream-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestB
-# CHECK-NEXT: *** TEST 'googletest-upstream-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestB' FAILED ***
+# CHECK: FAIL: googletest-upstream-format :: [[TEST:[Dd]ummy[Ss]ub[Dd]ir/OneTest.py]]/[[FILTER:FirstTest.subTestB]]
+# CHECK-NEXT: *** TEST 'googletest-upstream-format :: [[TEST]]/[[FILTER]]' FAILED ***
+# CHECK-NEXT: Script:
+# CHECK-NEXT: --
+# CHECK-NEXT: [[TEST]] --gtest_filter=[[FILTER]]
+# CHECK-NEXT: --
# CHECK-NEXT: Running main() from gtest_main.cc
# CHECK-NEXT: I am subTest B, I FAIL
# CHECK-NEXT: And I have two lines of output
Index: llvm/utils/lit/tests/googletest-timeout.py
===================================================================
--- llvm/utils/lit/tests/googletest-timeout.py
+++ llvm/utils/lit/tests/googletest-timeout.py
@@ -19,7 +19,12 @@
# RUN: FileCheck --check-prefix=CHECK-INF < %t.cfgset.out %s
# CHECK-INF: -- Testing:
-# CHECK-INF: TIMEOUT: googletest-timeout :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/T.InfiniteLoopSubTest
+# CHECK-INF: TIMEOUT: googletest-timeout :: [[TEST:[Dd]ummy[Ss]ub[Dd]ir/OneTest\.py]]/[[FILTER:T\.InfiniteLoopSubTest]]
+# CHECK-INF-NEXT: ******************** TEST 'googletest-timeout :: [[TEST]]/[[FILTER]]' FAILED ********************
+# CHECK-INF-NEXT: Script:
+# CHECK-INF-NEXT: --
+# CHECK-INF-NEXT: [[TEST]] --gtest_filter=[[FILTER]]
+# CHECK-INF-NEXT: --
# CHECK-INF: Timed Out: 1
###############################################################################
Index: llvm/utils/lit/tests/googletest-format.py
===================================================================
--- llvm/utils/lit/tests/googletest-format.py
+++ llvm/utils/lit/tests/googletest-format.py
@@ -13,8 +13,12 @@
# CHECK: -- Testing:
# CHECK: PASS: googletest-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestA
-# CHECK: FAIL: googletest-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestB
-# CHECK-NEXT: *** TEST 'googletest-format :: {{[Dd]ummy[Ss]ub[Dd]ir}}/OneTest.py/FirstTest.subTestB' FAILED ***
+# CHECK: FAIL: googletest-format :: [[TEST:[Dd]ummy[Ss]ub[Dd]ir/OneTest.py]]/[[FILTER:FirstTest.subTestB]]
+# CHECK-NEXT: *** TEST 'googletest-format :: [[TEST]]/[[FILTER]]' FAILED ***
+# CHECK-NEXT: Script:
+# CHECK-NEXT: --
+# CHECK-NEXT: [[TEST]] --gtest_filter=[[FILTER]]
+# CHECK-NEXT: --
# CHECK-NEXT: I am subTest B, I FAIL
# CHECK-NEXT: And I have two lines of output
# CHECK: ***
Index: llvm/utils/lit/lit/formats/googletest.py
===================================================================
--- llvm/utils/lit/lit/formats/googletest.py
+++ llvm/utils/lit/lit/formats/googletest.py
@@ -122,24 +122,25 @@
if litConfig.noExecute:
return lit.Test.PASS, ''
+ header = f"Script:\n--\n{' '.join(cmd)}\n--\n"
+
try:
out, err, exitCode = lit.util.executeCommand(
cmd, env=test.config.environment,
timeout=litConfig.maxIndividualTestTime)
except lit.util.ExecuteCommandTimeoutException:
return (lit.Test.TIMEOUT,
- 'Reached timeout of {} seconds'.format(
- litConfig.maxIndividualTestTime)
- )
+ f'{header}Reached timeout of '
+ '{litConfig.maxIndividualTestTime} seconds')
if exitCode:
- return lit.Test.FAIL, out + err
+ return lit.Test.FAIL, header + 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.UNRESOLVED,
+ f'{header}Unable to find {passing_test_line}'
+ ' in gtest output:\n\n{out}{err}')
return lit.Test.PASS,''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102899.346935.patch
Type: text/x-patch
Size: 4368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210521/dd3ee9e5/attachment.bin>
More information about the llvm-commits
mailing list