-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[windows] Fix ParseableInterface tests. #25546
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
[windows] Fix ParseableInterface tests. #25546
Conversation
@swift-ci please smoke test |
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.
*sigh* Thanks, @drodriguez. Didn't mean to generate so much cleanup work. Would really like a Windows PR smoke test bot at some point!
utils/PathSanitizingFileCheck
Outdated
# (?:[-a-zA-Z0-9_.]+)?\b -> Matches the last path component, which do | ||
# not has a trailing slash, but it is | ||
# optional. | ||
stdin = re.sub(r'\b[a-zA-Z]:(?:\\\\|\\|\/)(?:[-a-zA-Z0-9_.]+(?:\\\\|\\|\/))*(?:[-a-zA-Z0-9_.]+)?\b', replace_slashes, stdin) |
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.
Yikes. @compnerd?
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.
Yikes indeed.
Saleem has already changed a lot of tests with those {{\\\\|/}}
, but it makes reading the test files very complicated (IMO). This hopefully will avoid having to add any more of those, and people that work on Unixes will not have to care about Windows. I hope Saleem sees the benefits, but rest assure that I flagged myself after writing this.
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, I .... words... I. If it works? 🤷♂
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.
sigh Thanks, @drodriguez. Didn't mean to generate so much cleanup work. Would really like a Windows PR smoke test bot at some point!
I'm working towards it, but things get in the way, and changes are slower than I hoped.
utils/PathSanitizingFileCheck
Outdated
# (?:[-a-zA-Z0-9_.]+)?\b -> Matches the last path component, which do | ||
# not has a trailing slash, but it is | ||
# optional. | ||
stdin = re.sub(r'\b[a-zA-Z]:(?:\\\\|\\|\/)(?:[-a-zA-Z0-9_.]+(?:\\\\|\\|\/))*(?:[-a-zA-Z0-9_.]+)?\b', replace_slashes, stdin) |
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.
Yikes indeed.
Saleem has already changed a lot of tests with those {{\\\\|/}}
, but it makes reading the test files very complicated (IMO). This hopefully will avoid having to add any more of those, and people that work on Unixes will not have to care about Windows. I hope Saleem sees the benefits, but rest assure that I flagged myself after writing this.
Going to wait until @jrose-apple's comments are addressed before giving this another look. |
There were several Unix specific things in the ParseableInterface tests: the Bash subcommand was used, a Python tool was invoked without an explicit interpreter, and Unix path separators are used in CHECK lines. The Bash subcommand is replaced by a Lit substitution. Both swiftmodule and swiftdoc had substitutions, so swiftinterface gets one which should about the subcommand. The Python tool is invoked with an explicit interpreter. The Unix paths, instead of adding the ugly {{\\|/}} pattern everywhere are fixed in the PathSanitizing tool instead, that gets a new capability in Windows compatibility mode where all the Windows path found in the input are transformed into Windows path with only forward slashes (Unix slashes) in the output, which can be checked textually against the CHECK lines.
e3a94aa
to
80cd48d
Compare
@swift-ci please smoke test |
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.
Ugh, I really don't like the regex subsitutions, but, I suppose it will help with the tests.
There were several Unix specific things in the ParseableInterface tests:
the Bash subcommand was used, a Python tool was invoked without an
explicit interpreter, and Unix path separators are used in CHECK lines.
The Bash subcommand is replaced by a Lit substitution. Both swiftmodule
and swiftdoc had substitutions, however swiftinterface uses the target CPU
instead.
The Python tool is invoked with an explicit interpreter.
The Unix paths, instead of adding the ugly {{\|/}} pattern everywhere
are fixed in the PathSanitizing tool instead, that gets a new capability
in Windows compatibility mode where all the Windows path found in the
input are transformed into Windows path with only forward slashes (Unix
slashes) in the output, which can be checked textually against the CHECK
lines.