-
Notifications
You must be signed in to change notification settings - Fork 314
Add infrastructure to define indexed single-file workspaces inside the tests #914
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
Add infrastructure to define indexed single-file workspaces inside the tests #914
Conversation
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 prefer source next to the test, so in general I'm in favor of this. I'd be interested in seeing a multi-file test or one that has additional args though.
0018e14
to
0f29a1d
Compare
I migrated a bunch more tests from the TIBS-based test inputs to define the test inputs inline. I haven’t really needed to make any adjustments to the test workspaces for the last few migrations, so I think the design is more or less complete and it’s now just a matter of converting the remaining test cases to the new infrastructure. |
0f29a1d
to
734e4e1
Compare
And today I learned about |
@swift-ci Please test |
…e tests The new approach has a few advantages over the olde TIBS-based approach: 1. The source file being tested is defined within the test case itself and not in a separate file, which makes it easier to understand the test case since the auxiliaury file doesn’t need to be opened. Finding it inside `Sources/SKTestSupport/INPUTS` is already hard for people that are not familiar with the codebase. 2. The build setup is significantly simpler since it doesn’t rely on `ninja`. It is thus easier to understand what is run during the test. 3. We can use the emoji location markers to refer to test locations, like we do for files that are opened using `TestSourceKitLSPClient.openDocument`. This commit only migrates call hierarchy testing to the new design. If we like it, I’ll migrate the other test workspaces as well.
…orkspace that can be opened in SourceKitLSP
We don’t actually need on-disk files here and can just open them in memory.
We can just open the file in-memory instead
The tests never performed any cross-file testing so we can just import them as standalone files in-memory.
… arbitrary languages This allows us to remove the `BasicCXX` test directory.
734e4e1
to
48b617c
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
The new approach has a few advantages over the olde TIBS-based approach:
Sources/SKTestSupport/INPUTS
is already hard for people that are not familiar with the codebase.ninja
. It is thus easier to understand what is run during the test.TestSourceKitLSPClient.openDocument
.This commit only migrates call hierarchy testing to the new design. If we like it, I’ll migrate the other test workspaces as well.