Skip to content

Commit d6e7bd2

Browse files
authored
Merge pull request #101 from codingthat/add-track-test-instructions
Add track test instructions
2 parents fc0d6e8 + fdb9a08 commit d6e7bd2

File tree

2 files changed

+45
-16
lines changed

2 files changed

+45
-16
lines changed

docs/TESTS.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
# Tests
22

3-
<!-- TODO: write document
3+
## Installing the Exercism GDScript track test runner
44

5-
This document should describe everything related to running tests in the track.
5+
You'll need [Godot installed][installation] correctly to use the test runner.
66

7-
If your track uses skipped tests, this document can explain why thet is used and
8-
how to unskip tests.
7+
To build and test GDScript scripts for Exercism, Godot will be run in "headless" mode from the CLI.
8+
These instructions currently require Linux and bash.
99

10-
This document can also link to the testing framework documentation.
10+
### Step 1: Installing the overall test runner infrastructure
1111

12-
The contents of this document are displayed on the track's documentation
13-
page at `https://exercism.org/docs/tracks/<track>/tests`.
12+
To set up for testing, clone [https://github.com/exercism/gdscript-test-runner][gdscript-test-runner] and move its contents to `/opt/exercism/gdscript/test-runner/`:
1413

15-
See https://exercism.org/docs/building/tracks/docs for more information. -->
14+
```sh
15+
git clone https://github.com/exercism/gdscript-test-runner.git
16+
sudo mkdir -p /opt/exercism/gdscript/
17+
sudo mv gdscript-test-runner/ /opt/exercism/gdscript/test-runner/
18+
```
19+
20+
### Step 2: Downloading the single-exercise test runner script
21+
22+
Assuming you have the `exercism` tool set up and have downloaded at least one GDScript exercise, it should have created an `exercism/gdscript` folder to house the exercises.
23+
Save [the test runner][test-local-gdscript-solution] in this folder and mark the file executable, or just create a link to it:
24+
25+
```sh
26+
cd ~/exercism/gdscript # replace with your exercism/gdscript directory
27+
ln /opt/exercism/gdscript/test-runner/bin/test-local-gdscript-solution.sh
28+
```
29+
30+
## Running tests
31+
32+
With the installation steps done, you should be able start from any exercise directory (e.g., `~/exercism/gdscript/two-fer`) and run the script (living one level up, in `../`) to test your local solution to that exercise:
33+
34+
```sh
35+
../test-local-gdscript-solution.sh
36+
```
37+
38+
[installation]: https://exercism.org/docs/tracks/gdscript/installation
39+
[gdscript-test-runner]: https://github.com/exercism/gdscript-test-runner
40+
[test-local-gdscript-solution]: https://raw.githubusercontent.com/exercism/gdscript-test-runner/refs/heads/main/bin/test-local-gdscript-solution.sh

exercises/shared/.docs/tests.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# Tests
22

3-
<!-- TODO: write document
3+
## Running tests
44

5-
This document should contain instructions on how to run the exercise's tests.
5+
With the [installation steps][test-installation-steps] done, you should be able start from any exercise directory (e.g., `~/exercism/gdscript/two-fer`) and run the script (living one level up, in `../`) to test your local solution to that exercise:
66

7-
The instructions should be short and to the point.
7+
```sh
8+
../test-local-gdscript-solution.sh
9+
```
810

9-
The docs/TESTS.md file can contain a more verbose description on how to run tests.
11+
## Solving an exercise
1012

11-
When a student downloads an exercise via the CLI, this file's contents are
12-
included into the HELP.md file.
13+
Solving an exercise means making all its tests pass.
1314

14-
See https://exercism.org/docs/building/tracks/shared-files for more information.
15-
-->
15+
To help you get started, each exercise comes with a GDScript file named after the exercise (e.g., `exercism/gdscript/two-fer/two_fer.gd`).
16+
You can use this file as a starting point for building your solution.
17+
Feel free to change it as needed, but the tests expect the function names to be as originally provided.
18+
19+
[test-installation-steps]: https://exercism.org/docs/tracks/gdscript/tests

0 commit comments

Comments
 (0)