Skip to content

Commit

Permalink
GD-456: Improve Documentation (#459)
Browse files Browse the repository at this point in the history
# Why
Streamline documentation to ease setup and usage for developers allowing
them to find content quicker.

# What

- Created "Testing" section
- Merged "Inspector" page into "How to Run Tests"
- Moved several pages from FAQ to Testing section
- Improved titles
- Separated "Basic Test Example" so that users can easily find and
utilize it
- Other small enhancements

---------

Co-authored-by: Nullpointer <[email protected]>
  • Loading branch information
olinic and Nullpointer committed May 20, 2024
1 parent 1c0851a commit 656eb74
Show file tree
Hide file tree
Showing 30 changed files with 489 additions and 466 deletions.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ GEM
PLATFORMS
x64-mingw-ucrt
x86_64-darwin-15
x86_64-linux

DEPENDENCIES
http_parser.rb (~> 0.6.0)
Expand Down
2 changes: 1 addition & 1 deletion _advanced_testing/signals.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ By using these tools, you can test the emission of signals in your Godot project

## Verify Signals
The `assert_signal()` an Assertion Tool to verify for emitted signals until a certain time. When the timeout is reached, the assertion fails with a timeout error.<br>
For more details show [assert_signal](/gdUnit4/asserts/assert-signal/#signal-assertions)
For more details show [assert_signal](/gdUnit4/testing/assert-signal/#signal-assertions)

Here's an example of using `assert_signal()`:

Expand Down
10 changes: 8 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ collections:
first_steps:
permalink: "/:collection/:path/"
output: true
asserts:
csharp_project_setup:
permalink: "/:collection/:path/"
output: true
testing:
permalink: "/:collection/:path/"
output: true
advanced_testing:
Expand All @@ -46,7 +49,10 @@ just_the_docs:
collections:
first_steps:
name: First Steps
asserts:
csharp_project_setup:
name: C# Project Setup
testing:
name: Testing
advanced_testing:
tutorials:
faq:
Expand Down
34 changes: 16 additions & 18 deletions _faq/C#.md → _csharp_project_setup/csharp-setup.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
---
layout: default
title: C# Support on Godot Editor
nav_order: 6
title: C# Setup
nav_order: 1
---

# The GdUnit4 Godot Editor C# Support

{% include advice.html
content="Please note that running C# tests is only supported with GdUnit4 version 4.2.x and higher.<br>
To be able to use the GdUnit4 C# Test API, at least one Godot-Mono version 4.2.x must be installed."
%}

GdUnit4 supports with [gdUnit4.api](https://github.com/MikeSchulze/gdUnit4Net/blob/master/api/README.md){:target="_blank"} v4.2.0 to write and run tests inside the Godot editor.
For support **Visual Studio**, **Visual Studio Code** and **JetBrains Rider** [click here](/gdUnit4/faq/vstest-adapter/){:target="_blank"}.
## GdUnit4 C# Test Setup

With gdUnit4 version 4.2.2, we fully support .net7, .net8 and LangVersion 11.<br>
This ensures compatibility and access to the enhanced features and capabilities provided by GdUnit4's C# testing functionality.

## How to Enable GdUnit4 C# Test Support?

Before diving into gdUnit4 C# testing API, make sure your project is configured appropriately.<br>
Follow the steps outlined in the
[Official Godot documentary](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_basics.html#setting-up-c-for-godot)
Expand Down Expand Up @@ -71,6 +62,16 @@ Here is a complete example of what your project should look like.
</Project>
```

## The GdUnit4 Godot Editor C# Support

{% include advice.html
content="Please note that running C# tests is only supported with GdUnit4 version 4.2.x and higher.<br>
To be able to use the GdUnit4 C# Test API, at least one Godot-Mono version 4.2.x must be installed."
%}

GdUnit4 supports with [gdUnit4.api](https://github.com/MikeSchulze/gdUnit4Net/blob/master/api/README.md){:target="_blank"} v4.2.0 to write and run tests inside the Godot editor.
For support **Visual Studio**, **Visual Studio Code** and **JetBrains Rider** [click here](/gdUnit4/csharp_project_setup/vstest-adapter/){:target="_blank"}.

## Test You C# build Settings in the Godot Editor

Open the **MSBuild** inspector at the bottom of the Godot editor and press **Rebuild Solution**.
Expand All @@ -79,16 +80,13 @@ The output should indicate that the project is built successfully.

### Running C# Tests inside the Godot Editor

How to [run test](/gdUnit4/faq/run-tests/)
How to [run test](/gdUnit4/testing/run-tests/)


### Using External C# Editor
## Using External C# Editor

Open your Godot editor settings, and navigate to **dotnet** and select your preferred C# tool.
![](/gdUnit4/assets/images/install/cs-setup.png)

### How to Setup and Running C# Tests with the Visual Studio Test Adapter

See here [here](/gdUnit4/faq/vstest-adapter/)

---
<h4> document version v4.2.4 </h4>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: C# Supported IDE's
nav_order: 7
title: C# Configure Your IDE
nav_order: 2
---

# The gdUnit4 Test Adapter
Expand Down
39 changes: 0 additions & 39 deletions _faq/run-tests.md

This file was deleted.

10 changes: 5 additions & 5 deletions _first_steps/firstTest.md → _first_steps/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
layout: default
title: Create Your First Test
title: Getting Started with GDScript Tests
nav_order: 3
---

# Create Your First Test
# Getting Started with GDScript Tests

## Before You Start
Create a new folder called **first_steps** in your project's root directory and copy the following class into it. It should be located at `res://first_steps/test_person.gd`.
Expand Down Expand Up @@ -92,7 +92,7 @@ func test_full_name() -> void:

Now, run the test again by pressing the **ReRun Debug** button in the inspector.<br>
![](/gdUnit4/assets/images/first-steps/rerun-test.png){:.centered}
For more details about the inspector buttons, see [Button Bar](/gdUnit4/faq/inspector/#button-bar)
For more details about the inspector buttons, see [Button Bar](/gdUnit4/testing/run-tests/#button-bar)


The test failure is fixed but now we get a warning!
Expand Down Expand Up @@ -121,8 +121,8 @@ func test_full_name() -> void:
{% endtabs %}


GdUnit offers a wide range of [Asserts](/gdUnit4/asserts/index/) for all basic built-in types and much more. A collection of tests is called a Test Suite in GdUnit.<br>
You can find more details about creating Test Suite's [here](/gdUnit4/faq/test-suite).
GdUnit offers a wide range of [Asserts](/gdUnit4/testing/assert/) for all basic built-in types and much more. A collection of tests is called a Test Suite in GdUnit.<br>
You can find more details about creating Test Setup/Teardown [here](/gdUnit4/testing/hooks).

Now, run your test again and it should complete successfully.<br>
![](/gdUnit4/assets/images/first-steps/fixed-rerun-test-result.png){:.centered}
Expand Down
4 changes: 2 additions & 2 deletions _first_steps/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To install GdUnit4 from the AssetLib, please follow these steps:
3. Select the GdUnit4 plugin from the search results.
![](/gdUnit4/assets/images/install/activate-gdunit-step0.png)
4. Click on the "Download" button to download and install the plugin.
5. Activate the plugin [follow this steps](/gdUnit4/first_steps/install/#activate-the-plugin)
5. Activate the plugin [follow this steps](/gdUnit4/first_steps/install/#activating-the-plugin)

{% include advice.html
content="It is recommended to restart the Godot Editor after the plugin installation.<br>
Expand Down Expand Up @@ -59,7 +59,7 @@ Godot has an issue with the project cache when installing plugins, for more deta

After successfully installing and activating the GdUnit4 plugin, you will find the GdUnit4 inspector in the upper left corner of the Godot editor.

* For detailed information about the inspector, please refer to the [GdUnit Inspector](/gdUnit4/faq/inspector/#the-gdunit-test-inspectorexplorer)
* For detailed information about the inspector, please refer to the [GdUnit Inspector](/gdUnit4/testing/run-tests/#the-gdunit-test-inspectorexplorer)
![](/gdUnit4/assets/images/install/activate-gdunit-step3.png)

---
Expand Down

0 comments on commit 656eb74

Please sign in to comment.