Skip to content

[swift-3.0-branch] Tests: make FileCheck a substitution that sanitizes the input #4228

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

Merged
merged 5 commits into from
Aug 12, 2016

Conversation

gribozavr
Copy link
Contributor

@gribozavr gribozavr commented Aug 11, 2016

This is a cherry-pick of #4187.

Normally I would not propose such a massive change for the branch, but I think that not including this particular change in the branch will make cherry-picking fixes harder. If we don't cherry-pick this change, the master branch prohibits using FileCheck in RUN lines, while swift-3.0-branch does not allow using %FileCheck. I don't think that would be a very good state to be in.


Original description

In the Swift testsuite, FileCheck is used to check for (or for absence of) fixed strings in the input. It is not an issue when the string is long and complex (e.g., a full SIL instruction). But sometimes the string is a common word (e.g., 'sdk' or 'branch'). Tests that use such patterns are known break when the path to the build directory contains these words.

This change makes %FileCheck a lit substitution that replaces paths to source and build directories with fixed strings.

'%FileCheck' removes absolute paths of the source and build directory
from the input.  Overwhelming majority of tests don't intend to match
these paths.

Also add a substitution '%raw-FileCheck' that does not sanitize the
input.
This reverts commit 02039a1.

With the new `%FileCheck` substitution that removess full paths to the
build directory from FileCheck inputs, this workaround is no longer
needed.
@gribozavr
Copy link
Contributor Author

Tests pass locally on macOS. Trying CI.

@gribozavr
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@gribozavr
Copy link
Contributor Author

@swift-ci Please test

@gribozavr
Copy link
Contributor Author

Linux tests failed because of unrelated reasons, macOS tests passed.

@gribozavr gribozavr added this to the Swift 3.0 milestone Aug 12, 2016
@tkremenek tkremenek merged commit ff1875f into swift-3.0-branch Aug 12, 2016
@gribozavr gribozavr deleted the swift3-FileCheck-substitution branch August 12, 2016 16:09
kateinoigakukun pushed a commit that referenced this pull request Aug 31, 2022
[pull] swiftwasm from main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants