-
Notifications
You must be signed in to change notification settings - Fork 345
Implement more precise path matching in some CAS tests #11262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test llvm |
@swift-ci please test llvm |
bfb2ee3
to
da88ded
Compare
@swift-ci please test llvm |
Unrelated test failures
|
This uses a path sanitizer inspired by https://github.com/swiftlang/swift/blob/main/utils/PathSanitizingFileCheck |
clang/test/lit.cfg.py
Outdated
@@ -250,6 +250,17 @@ def have_host_clang_repl_cuda(): | |||
) | |||
) | |||
|
|||
config.substitutions.append( | |||
( | |||
"%path-sanitizer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the same approach as swift with %PathSanitizingFilecheck
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean overriding FileCheck as in https://github.com/swiftlang/swift/blob/5eb727b6684d54767813045a2821a10ba4958d22/test/lit.cfg#L3110 ? I don't think that would work here because the sanitize arguments differ per test, as opposed to fixed to BUILD_DIR/SOURCE_DIR and I don't want to affect other tests
If you mean using the same script file, it should work.
clang/utils/path-sanitizer.py
Outdated
@@ -0,0 +1,55 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we share this with swift by any chance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean using the same script file (having a single copy in clang and share it with swift)? If so, it may work. But I'm not clear on how files in the llvm-project repo is referred to from swift. Any example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh except, it might be ugly/verbose to have extra args like --dry-run
(to not run filecheck) if the identical script file is to be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but having two different ways to do this seems unfortunate as well. I can see the argument for keeping it separate though - this is something that we will likely want to move into LLVM. However, if we can get PathSanitizingFileCheck
to the point where it is usable, we could eventually just move that into LLVM and use that from there in Swift as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will see if I can use PathSanitizingFileCheck
unmodified here in this PR though it might be verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, updated to copy and use unmodified PathSanitizingFileCheck
invoking FileCheck
through it. I think it looks okay in the tests.
'"%s" %s %s' | ||
% ( | ||
config.python_executable, | ||
os.path.join(config.clang_src_dir, "utils", "PathSanitizingFileCheck"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to reference this from the swift repo if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can transition to having one copy in llvm
@swift-ci please test llvm |
Unrelated test failures
|
No description provided.