Skip to content

Commit 27e988b

Browse files
committed
Remove tibs workspaces
1 parent f068ed1 commit 27e988b

File tree

6 files changed

+31
-597
lines changed

6 files changed

+31
-597
lines changed

Documentation/Development.md

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $ swift build
4040

4141
Install the following dependencies of SourceKit-LSP:
4242

43-
* libsqlite3-dev libncurses5-dev python3 ninja-build
43+
* libsqlite3-dev libncurses5-dev python3
4444

4545
```sh
4646
$ export PATH="<path_to_swift_toolchain>/usr/bin:${PATH}"
@@ -134,81 +134,6 @@ Where "N" configures the log verbosity and is one of the following numbers: 0 (e
134134

135135
As much as is practical, all code should be covered by tests. New tests can be added under the `Tests` directory and should use `XCTest`. The rest of this section will describe the additional tools available in the `SKTestSupport` module to make it easier to write good and efficient tests.
136136

137-
### Test Projects (Fixtures)
138-
139-
SourceKit test projects should be put in the `SKTestSupport/INPUTS` directory. Generally, they should use the [Tibs](#tibs) build system to define their sources and targets. An exception is for tests that need to specifically test the interaction with the Swift Package Manager. An example Tibs test project might look like:
140-
141-
```
142-
SKTestSupport/
143-
INPUTS/
144-
MyTestProj/
145-
a.swift
146-
b.swift
147-
c.cpp
148-
```
149-
150-
Where `project.json` describes the project's targets, for example
151-
152-
```
153-
{ "sources": ["a.swift", "b.swift", "c.cpp"] }
154-
```
155-
156-
Tibs supports more advanced project configurations, such as multiple swift modules with dependencies, etc. For much more information about Tibs, including what features it supports and how it works, see [Tibs](#tibs).
157-
158-
### SKTibsTestWorkspace
159-
160-
The `SKTibsTestWorkspace` pulls together the various pieces needed for working with tests, including opening a connection to the language server, building the project to produce index data, loading source code into open documents, etc.
161-
162-
To create a `SKTibsTestWorkspace`, use the `staticSourceKitTibsWorkspace` method (the intent is to provide a `mutableSourceKitTibsWorkspace` method in the future for tests that mutate source code).
163-
164-
```swift
165-
func testFoo() {
166-
// Create the workspace, including opening a connection to the TestServer.
167-
guard let ws = try staticSourceKitTibsWorkspace(name: "MyTestProj") else { return }
168-
let loc = ws.testLoc("myLocation")
169-
170-
// Build the project and populate the index.
171-
try ws.buildAndIndex()
172-
173-
// Open a document from the test project sources.
174-
try ws.openDocument(loc.url, language: .swift)
175-
176-
// Send requests to the server.
177-
let response = try ws.sk.sendSync(...)
178-
}
179-
```
180-
181-
#### Source Locations
182-
183-
It is common to want to refer to specific locations in the source code of a test project. This is supported using inline comment syntax.
184-
185-
```swift
186-
Test.swift:
187-
func /*myFuncDef*/myFunc() {
188-
/*myFuncCall*/myFunc()
189-
}
190-
```
191-
192-
In a test, these locations can be referenced by name. The named location is immediately after the comment.
193-
194-
```swift
195-
196-
let loc = ws.testLoc("myFuncDef")
197-
// TestLocation(url: ..., line: 1, column: 19)
198-
```
199-
200-
`TestLocation`s can be easily converted to LSP `Location` and `Position`s.
201-
202-
```swift
203-
Location(ws.testLoc("aaa:call"))
204-
Position(ws.testLoc("aaa:call"))
205-
```
206-
207137
### Long tests
208138

209139
Tests that run longer than approx. 1 second are only executed if the the `SOURCEKIT_LSP_ENABLE_LONG_TESTS` environment variable is set to `YES` or `1`. This, in particular, includes the crash recovery tests.
210-
211-
## Tibs
212-
213-
We use Tibs, the "Test Index Build System" from the IndexStoreDB project to provide build system support for test projects, including getting compiler arguments and building an index.
214-
For much more information about Tibs, see [IndexStoreDB/Documentation/Tibs.md](https://github.com/apple/indexstore-db/blob/main/Documentation/Tibs.md).

Sources/SKTestSupport/SKSwiftPMTestWorkspace.swift

Lines changed: 0 additions & 217 deletions
This file was deleted.

0 commit comments

Comments
 (0)