[PATCH] D122251: [lit] Use sharding for GoogleTest format

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 20:53:56 PDT 2022


ychen added inline comments.


================
Comment at: llvm/utils/lit/lit/formats/googletest.py:131
+            shard_envs = '\n'.join([k + '=' + v for k, v in shard_env.items()])
+            return f"Script(shard):\n--\n%s\n%s\n--\n" % (shard_envs, ' '.join(cmd))
+
----------------
vitalybuka wrote:
> 'Script' used to be convenient oneliner which can be copy/pasted into shell for debugging, now it's not.
> also GTEST_OUTPUT and GTEST_COLOR are not needed for that purpose.
`GTEST_SHARD_INDEX`/`GTEST_TOTAL_SHARDS` only have env var version. To be consistent, I made them all env vars. This script is for the failing shard (there is another one for the individual tests down below). If an error could only be reproduced this way, there are some hidden dependencies among tests that are not expected. In practice, I think this script is less used than the one below.

One option is to output them in one line. At least this is user-friendly on Linux. Does that sound good to you?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122251/new/

https://reviews.llvm.org/D122251



More information about the llvm-commits mailing list