|
1 | 1 | # Tests |
2 | 2 |
|
3 | | -<!-- TODO: write document |
| 3 | +## Installing the Exercism GDScript track test runner |
4 | 4 |
|
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. |
6 | 6 |
|
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. |
9 | 9 |
|
10 | | - This document can also link to the testing framework documentation. |
| 10 | +### Step 1: Installing the overall test runner infrastructure |
11 | 11 |
|
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/`: |
14 | 13 |
|
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 |
0 commit comments