Skip to content
Merged
Show file tree
Hide file tree
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
55 changes: 9 additions & 46 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
# Installation

## Installing Godot Engine
The [Godot Engine][godot-engine] is used to run GDScript code.
The Godot Engine runs on Windows, Linux, macOS, and Android.


The GDScript track is built on top of [Godot Engine][godot-engine], which runs on Windows, Linux, macOS, and Android.
For the moment, the test runner for [working locally][working-locally] requires Linux.
This track requires Godot version 4.0 or greater.

## Installing Godot Engine

The Godot Engine can be downloaded directly from [the Godot Engine website][godot-engine].
The download contains a single executable, named with the Godot Engine version.
This file needs to renamed `godot` and placed in one of the `$PATH` directories.
After completing the installation, you can verify if the CLI was installed successfully by running this command in a terminal:

```bash
godot --version
```

## Installing the Exercism GDScript track test runner

You'll need [Godot installed][installation] correctly to use the test runner.

To build and test GDScript scripts for Exercism, Godot will be run in "headless" mode from the CLI.
These instructions currently require Linux and bash.

### Step 1: Installing the overall test runner infrastructure

To set up for testing, clone [https://github.com/exercism/gdscript-test-runner][gdscript-test-runner] and move its contents to `/opt/test-runner/`:

```sh
git clone https://github.com/exercism/gdscript-test-runner.git
sudo mv gdscript-test-runner/ /opt/test-runner/
```

### Step 2: Downloading the single-exercise test runner script

Assuming you have the `exercism` tool set up and have downloaded at least one GDScript exercise, it should have created a `gdscript` folder under your workspace (as shown by running `exercism configure`) to house the exercises.
Save [the test runner][test-local-gdscript-solution] in this folder and mark the file executable.

## Running tests

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:

```sh
../test-local-gdscript-solution.sh
```

[installation]: https://exercism.org/docs/tracks/gdscript/installation
[gdscript-test-runner]: https://github.com/exercism/gdscript-test-runner
[test-local-gdscript-solution]: https://raw.githubusercontent.com/exercism/gdscript-test-runner/refs/heads/main/bin/test-local-gdscript-solution.sh

## Using an IDE

To get GDScript syntax highlighting inside an editor like [Visual Studio Code][vscode], you'll need an extension such as [godot-tools][godot-tools] installed plus a running debug server.
Godot starts this debug server automatically whenever a project is open in its own editor and keeps it running until the project or Godot itself is closed.

[godot-engine]: https://godotengine.org/
[working-locally]: /docs/using/solving-exercises/working-locally.md
[vscode]: https://code.visualstudio.com/download
[godot-tools]: https://open-vsx.org/vscode/item?itemName=geequlim.godot-tools
This track uses Godot version 4.7.2.
36 changes: 9 additions & 27 deletions docs/TESTS.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
# Tests

## Installing the Exercism GDScript track test runner

You'll need [Godot installed][installation] correctly to use the test runner.

To build and test GDScript scripts for Exercism, Godot will be run in "headless" mode from the CLI.
These instructions currently require Linux and bash.

### Step 1: Installing the overall test runner infrastructure
## Running tests

To set up for testing, clone [https://github.com/exercism/gdscript-test-runner][gdscript-test-runner] and move its contents to `/opt/test-runner/`:
The [test runner][] is used to load and test solutions.
To run the test runner, download it locally then use `godot` to run the test runner.
In the future, the test runner will automatically be downloaded alongside exercises when using `exercism download`.

```sh
git clone https://github.com/exercism/gdscript-test-runner.git
sudo mkdir -p /opt/
sudo mv gdscript-test-runner/ /opt/test-runner/
```bash
godot --headless -s /path/to/test_runner.gd -- <solution-slug> <path/to/solution>
```

### Step 2: Downloading the single-exercise test runner script

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.
Save [the test runner][test-local-gdscript-solution] in this folder and mark the file executable, or just create a link to it:
For example,

```sh
cd ~/exercism/gdscript # replace with your exercism/gdscript directory
ln /opt/test-runner/bin/test-local-gdscript-solution.sh
```bash
```

## Running tests

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:

```sh
../test-local-gdscript-solution.sh
```

[installation]: https://exercism.org/docs/tracks/gdscript/installation
[gdscript-test-runner]: https://github.com/exercism/gdscript-test-runner
[test-local-gdscript-solution]: https://raw.githubusercontent.com/exercism/gdscript-test-runner/refs/heads/main/bin/test-local-gdscript-solution.sh
[test runner]: https://raw.githubusercontent.com/exercism/gdscript-test-runner/refs/heads/main/bin/test_runner.gd
Loading