From f12431ddd1a5fbc1c3f1ca12421f4daa81e660c1 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 11 Sep 2025 15:42:36 +1000 Subject: [PATCH 01/19] Use target all for build instead of skunit_tests This fixes an issue where resources for tests (such as images) aren't copied, causing tests to fail. This happens because building a specific executable target such as skunit_tests doesn't run the custom targets used for the copy. This could be fixed by altering CMakeLists.txt but updating this guide is simpler. --- .../01-unit-testing-guide.mdx | 12 ++++++------ .../build-unit-tests/3-target-unit-tests.png | Bin 9125 -> 0 bytes .../images/build-unit-tests/3-target.png | Bin 0 -> 9722 bytes .../images/build-unit-tests/5-build.png | Bin 2731 -> 1919 bytes 4 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/images/build-unit-tests/3-target-unit-tests.png create mode 100644 src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/images/build-unit-tests/3-target.png diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx index d627659d..a94aeb66 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx @@ -125,8 +125,8 @@ and `RESOURCE_PATH` variables will be defined. ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) In the CMake Tools extension click the button ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - skunit_tests - ![Select build target](images/build-unit-tests/3-target-unit-tests.png) + all + ![Select build target](images/build-unit-tests/3-target.png) Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to Debug and select skunit_tests ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) @@ -162,8 +162,8 @@ and `RESOURCE_PATH` variables will be defined. ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) In the CMake Tools extension click the button ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - skunit_tests - ![Select build target](images/build-unit-tests/3-target-unit-tests.png) + all + ![Select build target](images/build-unit-tests/3-target.png) Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to Debug and select skunit_tests ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) @@ -206,8 +206,8 @@ and `RESOURCE_PATH` variables will be defined. ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) In the CMake Tools extension click the button ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - skunit_tests - ![Select build target](images/build-unit-tests/3-target-unit-tests.png) + all + ![Select build target](images/build-unit-tests/3-target.png) Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to Debug and select skunit_tests ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/images/build-unit-tests/3-target-unit-tests.png b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/images/build-unit-tests/3-target-unit-tests.png deleted file mode 100644 index 03d4ffdc75c66d9adebfa439ec07bc4b9ddb1c89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9125 zcma)iXH*ky6efZNq$w(0_>?Y9KQS+%wLa}^bpF;uDkO?l#b?`|}I zjEx=TIPqNQB)__LEBpr7`Q-J}9JY7hn}96qFDm>|wEs}ql7NHd$!?HT;eWYzwfoIg z!aJd8wka6kgvEaIe; zY;8FSoNF_Pu2DQUFd%s|<;?N;F^Xkpf2q&X+FIMtP{qlK*R$m)^a`nH5cbh64vhob zF!=Q5rlYxq1=oWIZEK!{uPa_kqKA;kFUyl#-c+}4NuhUkO!|6zkz;?omvV0ki|t#Q z&+?hh&B=Ka8cNvP+v|HYLo}ZtWoYsU^S0`aM#&n)Pmj(BR!C;s$=>yh}MbibXK6F*1 zy{l?#6XN6N;-M=WCiuYbp@?7RU>cilUneEy;^8@{H$IlfUb#*>GixMs&MR>~DC8My z&^@Rl?*}g;KK73D;vA!pPxSw+dA9s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@b&5*)H&gn4=G4>( zhlVw`eB}f;3UFQB)%Bs1lM`8k_ZGdJoE&)6wBCnzO+GUCIypIbd=cp|_Dz5je1gdu zc$zdfH&+?`_gptpFt`Sr;As~<0|UwR>-RaOrQxJGrKKN#gk3BBq4)gxr*nV&rHJPg n^z~`LlVo5!5hefTf>Q7&Ut!_08wq%|hTxf^#*=UIuS5R_)q*zO diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/images/build-unit-tests/3-target.png b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/images/build-unit-tests/3-target.png new file mode 100644 index 0000000000000000000000000000000000000000..0796d6555921b4fdd7555f69855dec798ddaefb2 GIT binary patch literal 9722 zcmZu%by$>5za~UQ1Voe$1re0)4y8dtK|pHh?(Ps35D*dRZjlaYSbFL1hJ_^;fu-}z zzVCPbINx>lx?uO&otfu1zqs#vW}Z-0Wm)`t6!$PNF!1H&q~2j*U}=NTes^z!|CeV_ zIC#T!ekc1Hqj-R76I|Rff2H&a1EVYw@6r$lT;n>(eQ?IWAZSDXVZ!WxnP6ZrM9NFO zQuokD&ikvYPd1+HR}0;G^(Bq?c6NZ&Bb@eh<993?4Ez+{f66iro*mCjnemF~@oy?k z7RBWaBBRG+Tqlt$eC`Q(mKqa0k+vh+(P4i$mF$e|jjSHN_WLy)5o)n27mO>Yt3M(M`z#;* z{3#uH(bxN&ap{-Dq1FfC`ySx}RzLd9>TSxjN~di=`-G+@u?GDTPj4dd!fiDwdq6_c znJpi^v9Zy-eZ+Nku+}?e!*_mhvAMbV_B#U@&*^c4KD(%>=;6r;CAL;{kp^=dJ0!Qd zdQw+k3cNahfsa~0cm-d+{0hc)CPxoktKjSFDIc-#CQKt%;nP7P~>a&pGMIX6j zgoK22wI}gdK8!vcM~mGwAU zr8#c+%ciH~WkT1hS;RHKm@Z0RQB%+HWvhw@PStnCoHr}F>gYT90px9_Z>%S+BQJYm zG-kYz>(;4ErISN+g;|jxxv*+Y(}VT;B@m3iF6CafGw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U{KO5zrI{v+R$oWTs-1Y$}Ctx-C z{vo7BXup%-x8+=3fum(ox-+(k@boRPkuKa4rD+}_WZiS<5OK@;MBZ?&z+W4;NCAu1 zESm#!XYUY*P-sbsgYfVDMOBGOty5;$U81_$-}rkav)}}HkWq%~#n?GMCEz^ovgDU- z^y{;?;HPc3~V$$IkK+O+d+# zzfv}H-@v|7CdAuxzt+YWv{lCseMOI|-7e$%a67Fz;mxY9oQiO^j3a9SMlZd$5$O4) zXsli=>#D2}8e8wmoz-p;0DAULNNLp-7jL`TSB5#Q+t~)F?fSN%R9jbj+L@AJV<_}w zCjfmkD0*yNs()b0BE8y2uHMh^Xijms66(anOf~j|FtIm3Dj=qRN)qyaL20!5c#~Uh z$_83e=@fKcFqC;1u<{;$eh4ogLE00}Q8a9%w!XjonMoGiVc&+X&SZK{B&xD6`=QFB8^ik!b*PJ zxpsD#UxSHv4m@8ke_kJkBx}6=8ur69{pX(Y{ZKzGMH#1_eQz_068$oFj6b)j=tN Date: Thu, 18 Sep 2025 16:01:53 +1000 Subject: [PATCH 02/19] Move testing related content to new page --- .../SplashKit Expansion/01-testing.mdx | 208 ++++++++++++++++++ .../SplashKit Expansion/index.mdx | 67 +----- 2 files changed, 209 insertions(+), 66 deletions(-) create mode 100644 src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx new file mode 100644 index 00000000..9d511ef3 --- /dev/null +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -0,0 +1,208 @@ +--- +title: Testing Guide +--- + +import { Steps, Tabs, TabItem } from "@astrojs/starlight/components"; + +### Building the Test Programs + +You cannot create new programs with splashkit-core as you do when using the traditional SplashKit +library. Instead, two programs are generated which can be configured to test its functionality: +`sktest` and `skunit_tests`. They are built with CMake using a preconfigured `CMakeLists.txt` file. +Open a WSL terminal and enter: + +```shell +cd +cd splashkit-core/projects/cmake +cmake -G "Unix Makefiles" . +make +``` + +The associated macOS and Linux commands can be found here: +[CONTRIBUTING](https://github.com/thoth-tech/splashkit-core/blob/develop/CONTRIBUTING.md) + +### Running the Test Programs + +To run the test programs, open a WSL terminal and enter: + +```shell +cd +cd splashkit-core/bin +``` + +Then for sktest: + +```shell +./sktest +``` + +Or for skunit_tests: + +```shell +./skunit_tests +``` + +### Making Changes + +`sktest` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/`. To add your own +tests, modify one or more of the files such as `test_animation.cpp`. + +`skunit_tests` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/unit_tests/`. +When it runs, all unit tests from all files in this folder are executed. Additional files can be +added to this folder if necessary. If adding a new file, copy the structure from one of the existing +unit test files. Critically, `#include "catch.hpp"` must be present in the file for it to be +compiled into `skunit_tests`. Beyond that, the hierarchy of, `TEST_CASE > SECTION > ASSERTION` +should be followed to improve readability and tracing of errors. + +### Testing Changes + +If a change is made to the code, the test programs need to be rebuilt. In a WSL terminal enter: + +```shell +cd +cd splashkit-core/projects/cmake +make +``` + +If any files were created or deleted, the CMake files need to be regenerated. In that case use: + +```shell +cd +cd splashkit-core/projects/cmake +cmake -G "Unix Makefiles" . +make +``` + +## Building the test project + + + + + +1. Open a terminal and install prerequisites with these commands: + + ```shell + sudo apt-get update + sudo apt-get upgrade -y + sudo apt-get install -y \ + git build-essential cmake g++ libpng-dev libcurl4-openssl-dev libsdl2-dev \ + libsdl2-mixer-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-net-dev libsdl2-ttf-dev \ + libmikmod-dev libbz2-dev libflac-dev libvorbis-dev libwebp-dev libfreetype6-dev + ``` + +2. Install the CMake Tools extension from the VS Code extension browser or + [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). + +3. Configure the extension: + Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` + ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) + Select the Linux preset + ![Select Linux preset](images/build-unit-tests/2-select-preset-linux.png) + Select the Default configure preset + ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) + In the CMake Tools extension click the button + ![Build target button](images/build-unit-tests/select-target.png) next to Build and select + all + ![Select build target](images/build-unit-tests/3-target.png) + Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to + Debug and select skunit_tests + ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) + +4. Build test project: + From the command line: + + ```shell + cd projects/cmake + cmake --preset Linux + cmake --build build/ + ``` + + Or in VS Code: + In the CMake Tools extension, click the Build button. The test project will also be built when + you refresh tests on the Testing tab of VS Code. + ![Build tests](images/build-unit-tests/5-build.png) + + + + + + +1. Install the CMake Tools extension from the VS Code extension browser or + [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). + +2. Configure the extension: + Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` + ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) + Select the macOS preset + ![Select macOS preset](images/build-unit-tests/2-select-preset-mac.png) + Select the Default configure preset + ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) + In the CMake Tools extension click the button + ![Build target button](images/build-unit-tests/select-target.png) next to Build and select + all + ![Select build target](images/build-unit-tests/3-target.png) + Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to + Debug and select skunit_tests + ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) + +3. Build test project: + From the command line: + + ```shell + cd projects/cmake + cmake --preset macOS + cmake --build build/ + ``` + + Or in VS Code: + In the CMake Tools extension, click Build. The test project will also be built when you refresh + tests on the Testing tab of VS Code. + ![Build tests](images/build-unit-tests/5-build.png) + + + + + + +1. Open the MINGW64 terminal and install prerequisites with these commands: + + ```shell + pacman -Syu + pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-cmake mingw-w64-x86_64-make + ``` + +2. Install the CMake Tools extension from the VS Code extension browser or + [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). + +3. Configure the extension: + Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` + ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) + Select the Windows preset + ![Select Windows preset](images/build-unit-tests/2-select-preset-windows.png) + Select the Default configure preset + ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) + In the CMake Tools extension click the button + ![Build target button](images/build-unit-tests/select-target.png) next to Build and select + all + ![Select build target](images/build-unit-tests/3-target.png) + Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to + Debug and select skunit_tests + ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) + +4. Build test project: + From the command line: + + ```shell + cd projects/cmake + cmake --preset Windows + cmake --build build/ + ``` + + Or in VS Code: + In the CMake Tools extension, click Build. The test project will also be built when you refresh + tests on the Testing tab of VS Code. + ![Build tests](images/build-unit-tests/5-build.png) + + + + \ No newline at end of file diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx index d7f935ff..7cfdd509 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx @@ -44,74 +44,9 @@ git checkout {new branch name} Now that a new branch is created and active, development can begin. -### Building the Test Programs - -You cannot create new programs with splashkit-core as you do when using the traditional SplashKit -library. Instead, two programs are generated which can be configured to test its functionality: -`sktest` and `skunit_tests`. They are built with CMake using a preconfigured `CMakeLists.txt` file. -Open a WSL terminal and enter: - -```shell -cd -cd splashkit-core/projects/cmake -cmake -G "Unix Makefiles" . -make -``` - -The associated macOS and Linux commands can be found here: -[CONTRIBUTING](https://github.com/thoth-tech/splashkit-core/blob/develop/CONTRIBUTING.md) - -### Running the Test Programs - -To run the test programs, open a WSL terminal and enter: - -```shell -cd -cd splashkit-core/bin -``` - -Then for sktest: - -```shell -./sktest -``` - -Or for skunit_tests: - -```shell -./skunit_tests -``` - -### Making Changes - -`sktest` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/`. To add your own -tests, modify one or more of the files such as `test_animation.cpp`. - -`skunit_tests` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/unit_tests/`. -When it runs, all unit tests from all files in this folder are executed. Additional files can be -added to this folder if necessary. If adding a new file, copy the structure from one of the existing -unit test files. Critically, `#include "catch.hpp"` must be present in the file for it to be -compiled into `skunit_tests`. Beyond that, the hierarchy of, `TEST_CASE > SECTION > ASSERTION` -should be followed to improve readability and tracing of errors. - ### Testing Changes -If a change is made to the code, the test programs need to be rebuilt. In a WSL terminal enter: - -```shell -cd -cd splashkit-core/projects/cmake -make -``` - -If any files were created or deleted, the CMake files need to be regenerated. In that case use: - -```shell -cd -cd splashkit-core/projects/cmake -cmake -G "Unix Makefiles" . -make -``` +It is critical that changes made to splashkit-core are thoroughly tested, so that issues can be found and resolved early. When making changes to code, whether adding new functions or altering existing functions, be sure to run the existing tests and think about adding new ones to test your changes. See [the testing guide](/products/splashkit/splashkit-expansion/01-testing) to get started with testing. ### Documenting Changes From 4c5e75974527ac1b8d8ff07fea269cd33ed80ef5 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 16:06:16 +1000 Subject: [PATCH 03/19] Add link to CONTRIBUTING.md to overview --- .../SplashKit/Documentation/SplashKit Expansion/01-testing.mdx | 3 +-- .../SplashKit/Documentation/SplashKit Expansion/index.mdx | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index 9d511ef3..d0599504 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -18,8 +18,7 @@ cmake -G "Unix Makefiles" . make ``` -The associated macOS and Linux commands can be found here: -[CONTRIBUTING](https://github.com/thoth-tech/splashkit-core/blob/develop/CONTRIBUTING.md) + ### Running the Test Programs diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx index 7cfdd509..17b73aca 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx @@ -90,3 +90,6 @@ following guide details the procedure and etiquette which is expected while usin Solutions for common issues can be found below. Be sure to also check the following page for help troubleshooting: [Guide to resolving Common Issues](/products/splashkit/03-github-guide/#troubleshooting) + +### See Also +[splashkit-core CONTRIBUTING.md](https://github.com/thoth-tech/splashkit-core/blob/develop/CONTRIBUTING.md) \ No newline at end of file From 611c4cc7534525efe7c5370699ebfc23bc76490c Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 16:06:44 +1000 Subject: [PATCH 04/19] Remove setup instructions --- .../01-unit-testing-guide.mdx | 134 ------------------ 1 file changed, 134 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx index a94aeb66..e7ace23e 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx @@ -96,140 +96,6 @@ TEST_CASE("return a SplashKit resource of resource_kind with name filename as a This test has three `SECTION`s, so the `TEST_CASE` will run three times. Each time, the `RESOURCE` and `RESOURCE_PATH` variables will be defined. -## Building the test project - - - - - -1. Open a terminal and install prerequisites with these commands: - - ```shell - sudo apt-get update - sudo apt-get upgrade -y - sudo apt-get install -y \ - git build-essential cmake g++ libpng-dev libcurl4-openssl-dev libsdl2-dev \ - libsdl2-mixer-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-net-dev libsdl2-ttf-dev \ - libmikmod-dev libbz2-dev libflac-dev libvorbis-dev libwebp-dev libfreetype6-dev - ``` - -2. Install the CMake Tools extension from the VS Code extension browser or - [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). - -3. Configure the extension: - Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` - ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) - Select the Linux preset - ![Select Linux preset](images/build-unit-tests/2-select-preset-linux.png) - Select the Default configure preset - ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) - In the CMake Tools extension click the button - ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - all - ![Select build target](images/build-unit-tests/3-target.png) - Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to - Debug and select skunit_tests - ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) - -4. Build test project: - From the command line: - - ```shell - cd projects/cmake - cmake --preset Linux - cmake --build build/ - ``` - - Or in VS Code: - In the CMake Tools extension, click the Build button. The test project will also be built when - you refresh tests on the Testing tab of VS Code. - ![Build tests](images/build-unit-tests/5-build.png) - - - - - - -1. Install the CMake Tools extension from the VS Code extension browser or - [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). - -2. Configure the extension: - Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` - ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) - Select the macOS preset - ![Select macOS preset](images/build-unit-tests/2-select-preset-mac.png) - Select the Default configure preset - ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) - In the CMake Tools extension click the button - ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - all - ![Select build target](images/build-unit-tests/3-target.png) - Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to - Debug and select skunit_tests - ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) - -3. Build test project: - From the command line: - - ```shell - cd projects/cmake - cmake --preset macOS - cmake --build build/ - ``` - - Or in VS Code: - In the CMake Tools extension, click Build. The test project will also be built when you refresh - tests on the Testing tab of VS Code. - ![Build tests](images/build-unit-tests/5-build.png) - - - - - - -1. Open the MINGW64 terminal and install prerequisites with these commands: - - ```shell - pacman -Syu - pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-cmake mingw-w64-x86_64-make - ``` - -2. Install the CMake Tools extension from the VS Code extension browser or - [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). - -3. Configure the extension: - Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` - ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) - Select the Windows preset - ![Select Windows preset](images/build-unit-tests/2-select-preset-windows.png) - Select the Default configure preset - ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) - In the CMake Tools extension click the button - ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - all - ![Select build target](images/build-unit-tests/3-target.png) - Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to - Debug and select skunit_tests - ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) - -4. Build test project: - From the command line: - - ```shell - cd projects/cmake - cmake --preset Windows - cmake --build build/ - ``` - - Or in VS Code: - In the CMake Tools extension, click Build. The test project will also be built when you refresh - tests on the Testing tab of VS Code. - ![Build tests](images/build-unit-tests/5-build.png) - - - - - ## Running unit tests ### From the command line From 619e28b89dd9129d769de1a09b4a0ebbdbdc9f69 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 16:15:03 +1000 Subject: [PATCH 05/19] Move test running instructions --- .../SplashKit Expansion/01-testing.mdx | 108 +++++++++++++++--- .../01-unit-testing-guide.mdx | 93 --------------- 2 files changed, 95 insertions(+), 106 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index d0599504..1f2cefb3 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -4,21 +4,10 @@ title: Testing Guide import { Steps, Tabs, TabItem } from "@astrojs/starlight/components"; -### Building the Test Programs You cannot create new programs with splashkit-core as you do when using the traditional SplashKit library. Instead, two programs are generated which can be configured to test its functionality: -`sktest` and `skunit_tests`. They are built with CMake using a preconfigured `CMakeLists.txt` file. -Open a WSL terminal and enter: - -```shell -cd -cd splashkit-core/projects/cmake -cmake -G "Unix Makefiles" . -make -``` - - +`sktest` and `skunit_tests`. They are built with CMake using a preconfigured `CMakeLists.txt` file, which builds the SplashKit library and both test programs. ### Running the Test Programs @@ -204,4 +193,97 @@ make - \ No newline at end of file + + +## Running unit tests + +### From the command line + + + + +- It's a good idea to run the unit tests in a random order so that you can confirm that they run + indepedently of one another: + + ```shell + cd ../../bin + ./skunit_tests --order rand + ``` + + By default, this will only show reports for failed tests. To show reports for successful tests as + well, use the option `--success`. More command line options can be found in + [Catch2's documentation](https://github.com/catchorg/Catch2/blob/v2.x/docs/command-line.md). + +- If you want to run a specific test, or group of tests, you can do so: + + ```shell + ./skunit_tests + ``` + + The `test spec` can be a test name or tags and supports wildcards. For example, `*string*` would + run all of the tests with "string" in the name. + + + + +- It's a good idea to run the unit tests in a random order so that you can confirm that they run + indepedently of one another: + + ```shell + cd ../../bin + ./skunit_tests --order rand + ``` + + By default, this will only show reports for failed tests. To show reports for successful tests as + well, use the option `--success`. More command line options can be found in + [Catch2's documentation](https://github.com/catchorg/Catch2/blob/v2.x/docs/command-line.md). + +- If you want to run a specific test, or group of tests, you can do so: + + ```shell + ./skunit_tests + ``` + + The `test spec` can be a test name or tags and supports wildcards. For example, `*string*` would + run all of the tests with "string" in the name. + + + + +- It's a good idea to run the unit tests in a random order so that you can confirm that they run + indepedently of one another: + + ```shell + cd ../../bin + ./skunit_tests.exe --order rand + ``` + + By default, this will only show reports for failed tests. To show reports for successful tests as + well, use the option `--success`. More command line options can be found in + [Catch2's documentation](https://github.com/catchorg/Catch2/blob/v2.x/docs/command-line.md). + +- If you want to run a specific test, or group of tests, you can do so: + + ```shell + ./skunit_tests.exe + ``` + + The `test spec` can be a test name or tags and supports wildcards. For example, `*string*` would + run all of the tests with "string" in the name. + + + + +### In VS Code + +You can run tests from the Testing tab in VS Code +![Testing tab](images/run-unit-tests/1-testing-tab.png) + +- Running all tests: + Click Run Tests. Each test will be run and the status of each can be seen in the test list after a + test runs. + ![Run Tests](images/run-unit-tests/2-run-tests.png) +- Running a specific test: + Click Run Test next to any test on the test list to run it + ![Run Test](images/run-unit-tests/3-run-test.png) + ![Test status](images/run-unit-tests/4-test-status.png) \ No newline at end of file diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx index e7ace23e..975eee71 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx @@ -96,99 +96,6 @@ TEST_CASE("return a SplashKit resource of resource_kind with name filename as a This test has three `SECTION`s, so the `TEST_CASE` will run three times. Each time, the `RESOURCE` and `RESOURCE_PATH` variables will be defined. -## Running unit tests - -### From the command line - - - - -- It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another: - - ```shell - cd ../../bin - ./skunit_tests --order rand - ``` - - By default, this will only show reports for failed tests. To show reports for successful tests as - well, use the option `--success`. More command line options can be found in - [Catch2's documentation](https://github.com/catchorg/Catch2/blob/v2.x/docs/command-line.md). - -- If you want to run a specific test, or group of tests, you can do so: - - ```shell - ./skunit_tests - ``` - - The `test spec` can be a test name or tags and supports wildcards. For example, `*string*` would - run all of the tests with "string" in the name. - - - - -- It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another: - - ```shell - cd ../../bin - ./skunit_tests --order rand - ``` - - By default, this will only show reports for failed tests. To show reports for successful tests as - well, use the option `--success`. More command line options can be found in - [Catch2's documentation](https://github.com/catchorg/Catch2/blob/v2.x/docs/command-line.md). - -- If you want to run a specific test, or group of tests, you can do so: - - ```shell - ./skunit_tests - ``` - - The `test spec` can be a test name or tags and supports wildcards. For example, `*string*` would - run all of the tests with "string" in the name. - - - - -- It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another: - - ```shell - cd ../../bin - ./skunit_tests.exe --order rand - ``` - - By default, this will only show reports for failed tests. To show reports for successful tests as - well, use the option `--success`. More command line options can be found in - [Catch2's documentation](https://github.com/catchorg/Catch2/blob/v2.x/docs/command-line.md). - -- If you want to run a specific test, or group of tests, you can do so: - - ```shell - ./skunit_tests.exe - ``` - - The `test spec` can be a test name or tags and supports wildcards. For example, `*string*` would - run all of the tests with "string" in the name. - - - - -### In VS Code - -You can run tests from the Testing tab in VS Code -![Testing tab](images/run-unit-tests/1-testing-tab.png) - -- Running all tests: - Click Run Tests. Each test will be run and the status of each can be seen in the test list after a - test runs. - ![Run Tests](images/run-unit-tests/2-run-tests.png) -- Running a specific test: - Click Run Test next to any test on the test list to run it - ![Run Test](images/run-unit-tests/3-run-test.png) - ![Test status](images/run-unit-tests/4-test-status.png) - ## See Also - [Catch2 tutorial](https://github.com/catchorg/Catch2/blob/v2.x/docs/tutorial.md) From d3d2e3c70ff625201b005567ad0262f1bc16a803 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 16:21:55 +1000 Subject: [PATCH 06/19] Reduce redundant information --- .../SplashKit Expansion/01-testing.mdx | 62 +++++++------------ 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index 1f2cefb3..234059b5 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -9,27 +9,6 @@ You cannot create new programs with splashkit-core as you do when using the trad library. Instead, two programs are generated which can be configured to test its functionality: `sktest` and `skunit_tests`. They are built with CMake using a preconfigured `CMakeLists.txt` file, which builds the SplashKit library and both test programs. -### Running the Test Programs - -To run the test programs, open a WSL terminal and enter: - -```shell -cd -cd splashkit-core/bin -``` - -Then for sktest: - -```shell -./sktest -``` - -Or for skunit_tests: - -```shell -./skunit_tests -``` - ### Making Changes `sktest` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/`. To add your own @@ -42,26 +21,8 @@ unit test files. Critically, `#include "catch.hpp"` must be present in the file compiled into `skunit_tests`. Beyond that, the hierarchy of, `TEST_CASE > SECTION > ASSERTION` should be followed to improve readability and tracing of errors. -### Testing Changes - -If a change is made to the code, the test programs need to be rebuilt. In a WSL terminal enter: - -```shell -cd -cd splashkit-core/projects/cmake -make -``` - -If any files were created or deleted, the CMake files need to be regenerated. In that case use: - -```shell -cd -cd splashkit-core/projects/cmake -cmake -G "Unix Makefiles" . -make -``` - ## Building the test project +If a change is made to the code, the build process needs to be run. This applies whether changes were made to coresdk files (such as adding new functions to SplashKit or changing existing code) or new tests were added to sktest or skunit_tests. @@ -195,6 +156,27 @@ make +## Running the Test Programs + +To run the test programs, open a WSL terminal and enter: + +```shell +cd +cd splashkit-core/bin +``` + +Then for sktest: + +```shell +./sktest +``` + +Or for skunit_tests: + +```shell +./skunit_tests +``` + ## Running unit tests ### From the command line From 95e342a701de223774995bc05e5f122c02d9e943 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 17:48:19 +1000 Subject: [PATCH 07/19] Remove prerequisite install (they should be installed from onboarding) --- .../SplashKit Expansion/01-testing.mdx | 91 +++++++++---------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index 234059b5..6573883c 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -24,25 +24,54 @@ should be followed to improve readability and tracing of errors. ## Building the test project If a change is made to the code, the build process needs to be run. This applies whether changes were made to coresdk files (such as adding new functions to SplashKit or changing existing code) or new tests were added to sktest or skunit_tests. +### From the command line + - -1. Open a terminal and install prerequisites with these commands: + From the command line: + + ```shell + cd projects/cmake + cmake --preset Linux + cmake --build build/ + ``` + + + + + From the command line: + + ```shell + cd projects/cmake + cmake --preset macOS + cmake --build build/ + ``` + + + + + From the command line: ```shell - sudo apt-get update - sudo apt-get upgrade -y - sudo apt-get install -y \ - git build-essential cmake g++ libpng-dev libcurl4-openssl-dev libsdl2-dev \ - libsdl2-mixer-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-net-dev libsdl2-ttf-dev \ - libmikmod-dev libbz2-dev libflac-dev libvorbis-dev libwebp-dev libfreetype6-dev + cd projects/cmake + cmake --preset Windows + cmake --build build/ ``` -2. Install the CMake Tools extension from the VS Code extension browser or + + + +### In VS Code + + + + + +1. Install the CMake Tools extension from the VS Code extension browser or [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). -3. Configure the extension: +2. Configure the extension: Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) Select the Linux preset @@ -57,16 +86,7 @@ If a change is made to the code, the build process needs to be run. This applies Debug and select skunit_tests ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) -4. Build test project: - From the command line: - - ```shell - cd projects/cmake - cmake --preset Linux - cmake --build build/ - ``` - - Or in VS Code: +3. Build test project: In the CMake Tools extension, click the Build button. The test project will also be built when you refresh tests on the Testing tab of VS Code. ![Build tests](images/build-unit-tests/5-build.png) @@ -95,15 +115,6 @@ If a change is made to the code, the build process needs to be run. This applies ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) 3. Build test project: - From the command line: - - ```shell - cd projects/cmake - cmake --preset macOS - cmake --build build/ - ``` - - Or in VS Code: In the CMake Tools extension, click Build. The test project will also be built when you refresh tests on the Testing tab of VS Code. ![Build tests](images/build-unit-tests/5-build.png) @@ -113,17 +124,10 @@ If a change is made to the code, the build process needs to be run. This applies -1. Open the MINGW64 terminal and install prerequisites with these commands: - - ```shell - pacman -Syu - pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-cmake mingw-w64-x86_64-make - ``` - -2. Install the CMake Tools extension from the VS Code extension browser or +1. Install the CMake Tools extension from the VS Code extension browser or [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). -3. Configure the extension: +2. Configure the extension: Select `${workspaceFolder}/projects/cmake/CMakeLists.txt` ![Select CMake Lists](images/build-unit-tests/1-select-cmakelists.png) Select the Windows preset @@ -138,16 +142,7 @@ If a change is made to the code, the build process needs to be run. This applies Debug and select skunit_tests ![Select debug/launch target](images/build-unit-tests/4-debug-target.png) -4. Build test project: - From the command line: - - ```shell - cd projects/cmake - cmake --preset Windows - cmake --build build/ - ``` - - Or in VS Code: +3. Build test project: In the CMake Tools extension, click Build. The test project will also be built when you refresh tests on the Testing tab of VS Code. ![Build tests](images/build-unit-tests/5-build.png) From 1e98927da85420893efe874fde54aeb58bb4b568 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 17:50:54 +1000 Subject: [PATCH 08/19] Relabel Windows tab to clarify instructions are for MSYS --- .../Documentation/SplashKit Expansion/01-testing.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index 6573883c..8ff3d8ec 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -49,7 +49,7 @@ If a change is made to the code, the build process needs to be run. This applies ``` - + From the command line: @@ -121,7 +121,7 @@ If a change is made to the code, the build process needs to be run. This applies - + 1. Install the CMake Tools extension from the VS Code extension browser or @@ -225,7 +225,7 @@ Or for skunit_tests: run all of the tests with "string" in the name. - + - It's a good idea to run the unit tests in a random order so that you can confirm that they run indepedently of one another: From 17311a2966d840a5d69da559a7cc2e83f7fdf6cf Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:04:16 +1000 Subject: [PATCH 09/19] Expand sktest instructions --- .../SplashKit Expansion/01-testing.mdx | 70 +++++++++++++++++-- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index 8ff3d8ec..ba2c1a5d 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -153,26 +153,84 @@ If a change is made to the code, the build process needs to be run. This applies ## Running the Test Programs -To run the test programs, open a WSL terminal and enter: +### The sktest program + + + + +To run `sktest`, open a terminal and enter: ```shell -cd cd splashkit-core/bin +./sktest ``` -Then for sktest: + + + +To run `sktest`, open a terminal and enter: ```shell +cd splashkit-core/bin ./sktest ``` -Or for skunit_tests: + + + +To run `sktest`, open the MinGW terminal and enter: ```shell -./skunit_tests +cd splashkit-core/bin +./sktest.exe ``` -## Running unit tests + + + +A menu will be presented, showing a list of all the tests that are part of sktest. Select a test to run by entering the corresponding number. + +```plaintext +--------------------- + SplashKit Dev Tests +--------------------- + -1: Quit + 0: Animations + 1: Audio + 2: Bundles + 3: Camera + 4: Geometry + 5: Graphics + 6: Input + 7: Logging + 8: Physics + 9: Resources + 10: Shape drawing + 11: Sprite tests + 12: Terminal + 13: Text + 14: Timers + 15: Windows + 16: Cave Escape + 17: Web Server + 18: RESTful Web Service + 19: Network conversions + 20: UDP Networking Test + 21: TCP Networking Test + 22: GPIO Tests + 23: ADC Tests + 24: Motor Driver Tests + 25: Servo Driver Tests + 26: Remote GPIO Tests + 27: GPIO Tests - SPI + 28: UI Tests +--------------------- + Select test to run: +``` + +## Unit tests + +Unit tests are built with the same process as `sktest`, but run with the `skunit_tests` program. ### From the command line From 8f31237e37f91814f4a5a1f4e76c10e064d54a5f Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:06:18 +1000 Subject: [PATCH 10/19] Clarify reason for running tests in random order --- .../Documentation/SplashKit Expansion/01-testing.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index ba2c1a5d..dd95f773 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -238,7 +238,7 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit - It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another: + indepedently of one another. If tests run in order, you may miss issues that occur when a test runs without the tests before it passing. ```shell cd ../../bin @@ -262,7 +262,7 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit - It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another: + indepedently of one another. If tests run in order, you may miss issues that occur when a test runs without the tests before it passing. ```shell cd ../../bin @@ -286,7 +286,7 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit - It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another: + indepedently of one another. If tests run in order, you may miss issues that occur when a test runs without the tests before it passing. ```shell cd ../../bin From 4bda81ff5cb72051cf8a0ace03a593989cfa839e Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:15:23 +1000 Subject: [PATCH 11/19] Explain difference between sktest and skunit_tests --- .../Documentation/SplashKit Expansion/01-testing.mdx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index dd95f773..49e9c1b9 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -12,14 +12,13 @@ library. Instead, two programs are generated which can be configured to test its ### Making Changes `sktest` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/`. To add your own -tests, modify one or more of the files such as `test_animation.cpp`. +tests, modify one or more of the files such as `test_animation.cpp`. Tests in `sktest` tend to focus on demonstrating the output of functions, and require a human to validate that output. They are written in standard C++ and can make use of SplashKit functions. `skunit_tests` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/unit_tests/`. When it runs, all unit tests from all files in this folder are executed. Additional files can be added to this folder if necessary. If adding a new file, copy the structure from one of the existing -unit test files. Critically, `#include "catch.hpp"` must be present in the file for it to be -compiled into `skunit_tests`. Beyond that, the hierarchy of, `TEST_CASE > SECTION > ASSERTION` -should be followed to improve readability and tracing of errors. +unit test files. Unlike `sktest`, tests here need to be written as Catch2 test cases and `#include "catch.hpp"` must be present in a given file for it to be +compiled into `skunit_tests`. See the [unit testing guide](/products/splashkit/documentation/splashkit-expansion/01-unit-testing-guide) for a more in depth explanation of how unit tests are written. ## Building the test project If a change is made to the code, the build process needs to be run. This applies whether changes were made to coresdk files (such as adding new functions to SplashKit or changing existing code) or new tests were added to sktest or skunit_tests. From c1b01fe6dbadef879fa94c21bab68f146742f3b0 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:17:25 +1000 Subject: [PATCH 12/19] Heading formatting --- .../Documentation/SplashKit Expansion/01-testing.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index 49e9c1b9..9865b3e6 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -150,7 +150,7 @@ If a change is made to the code, the build process needs to be run. This applies -## Running the Test Programs +## Running Tests ### The sktest program @@ -227,11 +227,11 @@ A menu will be presented, showing a list of all the tests that are part of sktes Select test to run: ``` -## Unit tests +### Unit tests Unit tests are built with the same process as `sktest`, but run with the `skunit_tests` program. -### From the command line +#### From the command line @@ -308,9 +308,9 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit -### In VS Code +#### In VS Code -You can run tests from the Testing tab in VS Code +You can run tests from the Testing tab in VS Code if you've set up the CMake Tools extension as outlined above ![Testing tab](images/run-unit-tests/1-testing-tab.png) - Running all tests: From 5449ac0673384e492087c8c627fdced2dda1108b Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:24:05 +1000 Subject: [PATCH 13/19] Extra info on unit tests --- .../SplashKit/Documentation/SplashKit Expansion/01-testing.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx index 9865b3e6..e41d0c19 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx @@ -18,7 +18,7 @@ tests, modify one or more of the files such as `test_animation.cpp`. Tests in `s When it runs, all unit tests from all files in this folder are executed. Additional files can be added to this folder if necessary. If adding a new file, copy the structure from one of the existing unit test files. Unlike `sktest`, tests here need to be written as Catch2 test cases and `#include "catch.hpp"` must be present in a given file for it to be -compiled into `skunit_tests`. See the [unit testing guide](/products/splashkit/documentation/splashkit-expansion/01-unit-testing-guide) for a more in depth explanation of how unit tests are written. +compiled into `skunit_tests`. These tests evaluate actual output against expected output and produce an error if a test fails. See the [unit testing guide](/products/splashkit/documentation/splashkit-expansion/01-unit-testing-guide) for a more in depth explanation of how unit tests are written. ## Building the test project If a change is made to the code, the build process needs to be run. This applies whether changes were made to coresdk files (such as adding new functions to SplashKit or changing existing code) or new tests were added to sktest or skunit_tests. @@ -151,6 +151,7 @@ If a change is made to the code, the build process needs to be run. This applies ## Running Tests +After building the test programs, the compiled executables wiil be found in the `splashkit-core/bin` directory. Running tests differs depending on if the tests are part of `sktest` or `skunit_tests`. ### The sktest program From bf85c4397ce4f3351b977432345173a175b43cca Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:34:14 +1000 Subject: [PATCH 14/19] Expand unit testing intro --- .../SplashKit Expansion/01-unit-testing-guide.mdx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx index 975eee71..a48a3eb2 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx @@ -4,12 +4,13 @@ title: Unit Testing Guide import { FileTree, Steps, Tabs, TabItem } from "@astrojs/starlight/components"; -## Introduction -SplashKit uses [Catch2 2.x](https://github.com/catchorg/Catch2/tree/v2.x) as a framework for unit -tests. +Unit tests are written in C++ with the aid of macros from [Catch2 2.x](https://github.com/catchorg/Catch2/tree/v2.x). These tests are suited for larger scale testing than `sktest`, as a large number of tests can be quickly run and the output easily checked. This makes them suited for automation, because any failing test will be flagged so that any issues can be resolved before merging the changes into the main repository of SplashKit. -Tests are written in C++ with the aid of macros from Catch2. Test files are located at: +When writing unit tests, you should aim to test the expected behaviour of a specific function or procedure. In addition to positive test cases (where the function or procedure takes valid input and should produce the expected output), consider negative cases (cases where the function or procedure has invalid input), as well as edge cases. + +## File structure +Test files are located at: From d91c6d08dc8e1b0142a2f36e4f86237584c16cde Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:36:12 +1000 Subject: [PATCH 15/19] Rename files --- .../{01-testing.mdx => 01-testing-guide.mdx} | 2 +- .../{01-unit-testing-guide.mdx => 02-unit-testing-guide.mdx} | 0 .../{02-onboarding-guide.mdx => 03-onboarding-guide.mdx} | 0 ... 04-improvement-suggestion-add-oop-collision-resolution.mdx} | 0 .../SplashKit/Documentation/SplashKit Expansion/index.mdx | 2 +- 5 files changed, 2 insertions(+), 2 deletions(-) rename src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/{01-testing.mdx => 01-testing-guide.mdx} (99%) rename src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/{01-unit-testing-guide.mdx => 02-unit-testing-guide.mdx} (100%) rename src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/{02-onboarding-guide.mdx => 03-onboarding-guide.mdx} (100%) rename src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/{03-improvement-suggestion-add-oop-collision-resolution.mdx => 04-improvement-suggestion-add-oop-collision-resolution.mdx} (100%) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx similarity index 99% rename from src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx rename to src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx index e41d0c19..45220fba 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx @@ -18,7 +18,7 @@ tests, modify one or more of the files such as `test_animation.cpp`. Tests in `s When it runs, all unit tests from all files in this folder are executed. Additional files can be added to this folder if necessary. If adding a new file, copy the structure from one of the existing unit test files. Unlike `sktest`, tests here need to be written as Catch2 test cases and `#include "catch.hpp"` must be present in a given file for it to be -compiled into `skunit_tests`. These tests evaluate actual output against expected output and produce an error if a test fails. See the [unit testing guide](/products/splashkit/documentation/splashkit-expansion/01-unit-testing-guide) for a more in depth explanation of how unit tests are written. +compiled into `skunit_tests`. These tests evaluate actual output against expected output and produce an error if a test fails. See the [unit testing guide](/products/splashkit/documentation/splashkit-expansion/02-unit-testing-guide) for a more in depth explanation of how unit tests are written. ## Building the test project If a change is made to the code, the build process needs to be run. This applies whether changes were made to coresdk files (such as adding new functions to SplashKit or changing existing code) or new tests were added to sktest or skunit_tests. diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-unit-testing-guide.mdx similarity index 100% rename from src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-unit-testing-guide.mdx rename to src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-unit-testing-guide.mdx diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-onboarding-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/03-onboarding-guide.mdx similarity index 100% rename from src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-onboarding-guide.mdx rename to src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/03-onboarding-guide.mdx diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/03-improvement-suggestion-add-oop-collision-resolution.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/04-improvement-suggestion-add-oop-collision-resolution.mdx similarity index 100% rename from src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/03-improvement-suggestion-add-oop-collision-resolution.mdx rename to src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/04-improvement-suggestion-add-oop-collision-resolution.mdx diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx index 17b73aca..72ee997b 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx @@ -46,7 +46,7 @@ Now that a new branch is created and active, development can begin. ### Testing Changes -It is critical that changes made to splashkit-core are thoroughly tested, so that issues can be found and resolved early. When making changes to code, whether adding new functions or altering existing functions, be sure to run the existing tests and think about adding new ones to test your changes. See [the testing guide](/products/splashkit/splashkit-expansion/01-testing) to get started with testing. +It is critical that changes made to splashkit-core are thoroughly tested, so that issues can be found and resolved early. When making changes to code, whether adding new functions or altering existing functions, be sure to run the existing tests and think about adding new ones to test your changes. See [the testing guide](/products/splashkit/splashkit-expansion/01-testing-guide) to get started with testing. ### Documenting Changes From 9c305aca218f774be767ddd8328b655f64105dbc Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 18:40:36 +1000 Subject: [PATCH 16/19] Clean up formatting with npm run format --- .../SplashKit Expansion/01-testing-guide.mdx | 88 +++++++++++-------- .../02-unit-testing-guide.mdx | 13 ++- .../SplashKit Expansion/index.mdx | 9 +- 3 files changed, 67 insertions(+), 43 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx index 45220fba..e44a4a95 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx @@ -4,59 +4,68 @@ title: Testing Guide import { Steps, Tabs, TabItem } from "@astrojs/starlight/components"; - You cannot create new programs with splashkit-core as you do when using the traditional SplashKit library. Instead, two programs are generated which can be configured to test its functionality: -`sktest` and `skunit_tests`. They are built with CMake using a preconfigured `CMakeLists.txt` file, which builds the SplashKit library and both test programs. +`sktest` and `skunit_tests`. They are built with CMake using a preconfigured `CMakeLists.txt` file, +which builds the SplashKit library and both test programs. ### Making Changes `sktest` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/`. To add your own -tests, modify one or more of the files such as `test_animation.cpp`. Tests in `sktest` tend to focus on demonstrating the output of functions, and require a human to validate that output. They are written in standard C++ and can make use of SplashKit functions. +tests, modify one or more of the files such as `test_animation.cpp`. Tests in `sktest` tend to focus +on demonstrating the output of functions, and require a human to validate that output. They are +written in standard C++ and can make use of SplashKit functions. `skunit_tests` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/unit_tests/`. When it runs, all unit tests from all files in this folder are executed. Additional files can be added to this folder if necessary. If adding a new file, copy the structure from one of the existing -unit test files. Unlike `sktest`, tests here need to be written as Catch2 test cases and `#include "catch.hpp"` must be present in a given file for it to be -compiled into `skunit_tests`. These tests evaluate actual output against expected output and produce an error if a test fails. See the [unit testing guide](/products/splashkit/documentation/splashkit-expansion/02-unit-testing-guide) for a more in depth explanation of how unit tests are written. +unit test files. Unlike `sktest`, tests here need to be written as Catch2 test cases and +`#include "catch.hpp"` must be present in a given file for it to be compiled into `skunit_tests`. +These tests evaluate actual output against expected output and produce an error if a test fails. See +the +[unit testing guide](/products/splashkit/documentation/splashkit-expansion/02-unit-testing-guide) +for a more in depth explanation of how unit tests are written. ## Building the test project -If a change is made to the code, the build process needs to be run. This applies whether changes were made to coresdk files (such as adding new functions to SplashKit or changing existing code) or new tests were added to sktest or skunit_tests. + +If a change is made to the code, the build process needs to be run. This applies whether changes +were made to coresdk files (such as adding new functions to SplashKit or changing existing code) or +new tests were added to sktest or skunit_tests. ### From the command line - From the command line: +From the command line: - ```shell - cd projects/cmake - cmake --preset Linux - cmake --build build/ - ``` +```shell +cd projects/cmake +cmake --preset Linux +cmake --build build/ +``` - From the command line: +From the command line: - ```shell - cd projects/cmake - cmake --preset macOS - cmake --build build/ - ``` +```shell +cd projects/cmake +cmake --preset macOS +cmake --build build/ +``` - From the command line: +From the command line: - ```shell - cd projects/cmake - cmake --preset Windows - cmake --build build/ - ``` +```shell +cd projects/cmake +cmake --preset Windows +cmake --build build/ +``` @@ -78,8 +87,7 @@ If a change is made to the code, the build process needs to be run. This applies Select the Default configure preset ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) In the CMake Tools extension click the button - ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - all + ![Build target button](images/build-unit-tests/select-target.png) next to Build and select all ![Select build target](images/build-unit-tests/3-target.png) Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to Debug and select skunit_tests @@ -106,8 +114,7 @@ If a change is made to the code, the build process needs to be run. This applies Select the Default configure preset ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) In the CMake Tools extension click the button - ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - all + ![Build target button](images/build-unit-tests/select-target.png) next to Build and select all ![Select build target](images/build-unit-tests/3-target.png) Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to Debug and select skunit_tests @@ -134,8 +141,7 @@ If a change is made to the code, the build process needs to be run. This applies Select the Default configure preset ![Select Default preset](images/build-unit-tests/2-select-preset-default.png) In the CMake Tools extension click the button - ![Build target button](images/build-unit-tests/select-target.png) next to Build and select - all + ![Build target button](images/build-unit-tests/select-target.png) next to Build and select all ![Select build target](images/build-unit-tests/3-target.png) Click the button ![Select Default preset](images/build-unit-tests/select-target.png) next to Debug and select skunit_tests @@ -151,7 +157,9 @@ If a change is made to the code, the build process needs to be run. This applies ## Running Tests -After building the test programs, the compiled executables wiil be found in the `splashkit-core/bin` directory. Running tests differs depending on if the tests are part of `sktest` or `skunit_tests`. + +After building the test programs, the compiled executables wiil be found in the `splashkit-core/bin` +directory. Running tests differs depending on if the tests are part of `sktest` or `skunit_tests`. ### The sktest program @@ -188,7 +196,8 @@ cd splashkit-core/bin -A menu will be presented, showing a list of all the tests that are part of sktest. Select a test to run by entering the corresponding number. +A menu will be presented, showing a list of all the tests that are part of sktest. Select a test to +run by entering the corresponding number. ```plaintext --------------------- @@ -238,7 +247,8 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit - It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another. If tests run in order, you may miss issues that occur when a test runs without the tests before it passing. + indepedently of one another. If tests run in order, you may miss issues that occur when a test + runs without the tests before it passing. ```shell cd ../../bin @@ -262,7 +272,8 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit - It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another. If tests run in order, you may miss issues that occur when a test runs without the tests before it passing. + indepedently of one another. If tests run in order, you may miss issues that occur when a test + runs without the tests before it passing. ```shell cd ../../bin @@ -286,7 +297,8 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit - It's a good idea to run the unit tests in a random order so that you can confirm that they run - indepedently of one another. If tests run in order, you may miss issues that occur when a test runs without the tests before it passing. + indepedently of one another. If tests run in order, you may miss issues that occur when a test + runs without the tests before it passing. ```shell cd ../../bin @@ -311,8 +323,8 @@ Unit tests are built with the same process as `sktest`, but run with the `skunit #### In VS Code -You can run tests from the Testing tab in VS Code if you've set up the CMake Tools extension as outlined above -![Testing tab](images/run-unit-tests/1-testing-tab.png) +You can run tests from the Testing tab in VS Code if you've set up the CMake Tools extension as +outlined above ![Testing tab](images/run-unit-tests/1-testing-tab.png) - Running all tests: Click Run Tests. Each test will be run and the status of each can be seen in the test list after a @@ -321,4 +333,4 @@ You can run tests from the Testing tab in VS Code if you've set up the CMake Too - Running a specific test: Click Run Test next to any test on the test list to run it ![Run Test](images/run-unit-tests/3-run-test.png) - ![Test status](images/run-unit-tests/4-test-status.png) \ No newline at end of file + ![Test status](images/run-unit-tests/4-test-status.png) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-unit-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-unit-testing-guide.mdx index a48a3eb2..3065840f 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-unit-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/02-unit-testing-guide.mdx @@ -4,12 +4,19 @@ title: Unit Testing Guide import { FileTree, Steps, Tabs, TabItem } from "@astrojs/starlight/components"; +Unit tests are written in C++ with the aid of macros from +[Catch2 2.x](https://github.com/catchorg/Catch2/tree/v2.x). These tests are suited for larger scale +testing than `sktest`, as a large number of tests can be quickly run and the output easily checked. +This makes them suited for automation, because any failing test will be flagged so that any issues +can be resolved before merging the changes into the main repository of SplashKit. -Unit tests are written in C++ with the aid of macros from [Catch2 2.x](https://github.com/catchorg/Catch2/tree/v2.x). These tests are suited for larger scale testing than `sktest`, as a large number of tests can be quickly run and the output easily checked. This makes them suited for automation, because any failing test will be flagged so that any issues can be resolved before merging the changes into the main repository of SplashKit. - -When writing unit tests, you should aim to test the expected behaviour of a specific function or procedure. In addition to positive test cases (where the function or procedure takes valid input and should produce the expected output), consider negative cases (cases where the function or procedure has invalid input), as well as edge cases. +When writing unit tests, you should aim to test the expected behaviour of a specific function or +procedure. In addition to positive test cases (where the function or procedure takes valid input and +should produce the expected output), consider negative cases (cases where the function or procedure +has invalid input), as well as edge cases. ## File structure + Test files are located at: diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx index 72ee997b..517c4410 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx @@ -46,7 +46,11 @@ Now that a new branch is created and active, development can begin. ### Testing Changes -It is critical that changes made to splashkit-core are thoroughly tested, so that issues can be found and resolved early. When making changes to code, whether adding new functions or altering existing functions, be sure to run the existing tests and think about adding new ones to test your changes. See [the testing guide](/products/splashkit/splashkit-expansion/01-testing-guide) to get started with testing. +It is critical that changes made to splashkit-core are thoroughly tested, so that issues can be +found and resolved early. When making changes to code, whether adding new functions or altering +existing functions, be sure to run the existing tests and think about adding new ones to test your +changes. See [the testing guide](/products/splashkit/splashkit-expansion/01-testing-guide) to get +started with testing. ### Documenting Changes @@ -92,4 +96,5 @@ troubleshooting: [Guide to resolving Common Issues](/products/splashkit/03-github-guide/#troubleshooting) ### See Also -[splashkit-core CONTRIBUTING.md](https://github.com/thoth-tech/splashkit-core/blob/develop/CONTRIBUTING.md) \ No newline at end of file + +[splashkit-core CONTRIBUTING.md](https://github.com/thoth-tech/splashkit-core/blob/develop/CONTRIBUTING.md) From baf0d06ba2211846d6c3c6e878c2a41902a0db97 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 19:22:25 +1000 Subject: [PATCH 17/19] Fix typo in splashkit-core paths --- .../Documentation/SplashKit Expansion/01-testing-guide.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx index e44a4a95..5a9d3c56 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx @@ -11,12 +11,12 @@ which builds the SplashKit library and both test programs. ### Making Changes -`sktest` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/`. To add your own +`sktest` is built with the .cpp files from `splashkit-core/coresdk/src/test/`. To add your own tests, modify one or more of the files such as `test_animation.cpp`. Tests in `sktest` tend to focus on demonstrating the output of functions, and require a human to validate that output. They are written in standard C++ and can make use of SplashKit functions. -`skunit_tests` is built with the .cpp files from `~/splashkit-core/coreskd/src/test/unit_tests/`. +`skunit_tests` is built with the .cpp files from `splashkit-core/coresdk/src/test/unit_tests/`. When it runs, all unit tests from all files in this folder are executed. Additional files can be added to this folder if necessary. If adding a new file, copy the structure from one of the existing unit test files. Unlike `sktest`, tests here need to be written as Catch2 test cases and From ef5c49c4c5f2f9ee045a68ba03a1fa153ad9eb66 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 19:33:02 +1000 Subject: [PATCH 18/19] Remove redundant line --- .../Documentation/SplashKit Expansion/01-testing-guide.mdx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx index 5a9d3c56..8959c930 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/01-testing-guide.mdx @@ -37,8 +37,6 @@ new tests were added to sktest or skunit_tests. -From the command line: - ```shell cd projects/cmake cmake --preset Linux @@ -48,8 +46,6 @@ cmake --build build/ -From the command line: - ```shell cd projects/cmake cmake --preset macOS @@ -59,8 +55,6 @@ cmake --build build/ -From the command line: - ```shell cd projects/cmake cmake --preset Windows From 11426cc4327daf7502255c39f25ee482b1886a06 Mon Sep 17 00:00:00 2001 From: dijidiji Date: Thu, 18 Sep 2025 19:52:25 +1000 Subject: [PATCH 19/19] Fix broken link to testing guide --- .../SplashKit/Documentation/SplashKit Expansion/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx index 517c4410..6519fe58 100644 --- a/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx +++ b/src/content/docs/Products/SplashKit/Documentation/SplashKit Expansion/index.mdx @@ -49,7 +49,7 @@ Now that a new branch is created and active, development can begin. It is critical that changes made to splashkit-core are thoroughly tested, so that issues can be found and resolved early. When making changes to code, whether adding new functions or altering existing functions, be sure to run the existing tests and think about adding new ones to test your -changes. See [the testing guide](/products/splashkit/splashkit-expansion/01-testing-guide) to get +changes. See [the testing guide](/products/splashkit/documentation/splashkit-expansion/01-testing-guide/) to get started with testing. ### Documenting Changes