[clang] [llvm] [Utils] Add new --update-tests flag to llvm-lit (PR #108425)
Nicolai Hähnle via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 14 12:26:51 PDT 2024
================
@@ -2,3 +2,15 @@ config.substitutions = list(config.substitutions)
config.substitutions.insert(
0, (r"%clang\b", """*** Do not use the driver in Sema tests. ***""")
)
+
+if lit_config.update_tests:
+ import sys
+ import os
+
+ curdir = os.path.dirname(os.path.realpath(__file__))
+ testdir = os.path.dirname(curdir)
+ clangdir = os.path.dirname(testdir)
+ utilspath = os.path.join(clangdir, "utils")
----------------
nhaehnle wrote:
I believe this can be simplified to `os.path.join(clangdir, "..", "..", "utils")`?
https://github.com/llvm/llvm-project/pull/108425
More information about the cfe-commits
mailing list