Skip to content

[Swift 6]: Update test doc #826

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions docs/TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ When you are in the directory for an exercise, you should see two subdirectories
* `Sources/<Exercise>` contains your solution to the exercise
* `Tests/<Exercise>Tests` contains the tests to run for the exercise

If you're in the right directory (i.e. the one containing `Sources` and `Tests`), you can run the tests for that exercise by running `swift test` if you are using 5.4 or later:
If you're in the right directory (i.e. the one containing `Sources` and `Tests`), you can run the tests for that exercise by running `swift test`:

```bash
$ pwd
Expand All @@ -19,16 +19,17 @@ HELP.md Package.swift README.md Sources Tests
$ swift test
```

If you are using `5.1` through `5.3` you may have to add the `--enable-test-discovery` flag:
When you got a test passing remove `.enabled(if: RUNALL)` in the `@Test` statement to enable the next test, alternatively you can run all the tests with the `RUNALL` environment variable set to `true` on Linux or macOS:

```bash
$ swift test --enable-test-discovery
$ export RUNALL=true
```

This will run all of the test files in the `Test` directory.

For concept exercises, when you got a test passing change the `true` in the `XCTSkipIf` to `false` to enable the next test.
Or if you are using PowerShell on Windows:

```powershell
set RUNALL=true
```

## Submitting Your Solution

Expand Down