[PATCH] D102899: [lit] Print full googletest commad line
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 20 21:53:00 PDT 2021
vitalybuka created this revision.
vitalybuka added reviewers: rnk, dlj, ddunbar.
Herald added a subscriber: delcypher.
vitalybuka requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Similar to regular output of LIT tests:
https://github.com/llvm/llvm-project/blob/c162f086ba632ffaedfe92d63bf21571bc8ae4da/llvm/utils/lit/lit/TestRunner.py#L1569
Repository:
rG LLVM Github Monorepo
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,26 @@
if litConfig.noExecute:
return lit.Test.PASS, ''
+ header = "Script:\n--\n%s\n--\n" % ' '.join(cmd)
+
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)
+ '{}Reached timeout of {} seconds'.format(
+ header, litConfig.maxIndividualTestTime)
)
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, header + msg
return lit.Test.PASS,''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102899.346925.patch
Type: text/x-patch
Size: 4270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210521/5d653a24/attachment.bin>
More information about the llvm-commits
mailing list