diff --git a/Home.md b/Home.md index 7e2e0bf..406420b 100644 --- a/Home.md +++ b/Home.md @@ -152,6 +152,7 @@ OrcaSlicer is a powerful open source slicer for FFF (FDM) 3D Printers. This wiki ![im_code](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/im_code.svg?raw=true) This is a documentation from someone exploring the code and is by no means complete or even completely accurate. Please edit the parts you might find inaccurate. This is probably going to be helpful nonetheless. - [How to build OrcaSlicer](How-to-build) +- [How to run tests](How-to-test) - [Localization and translation guide](Localization_guide) - [How to create profiles](How-to-create-profiles) - [How to contribute to the wiki](How-to-wiki) diff --git a/developer-reference/How-to-build.md b/developer-reference/How-to-build.md index fcebbf4..f8e2d99 100644 --- a/developer-reference/How-to-build.md +++ b/developer-reference/How-to-build.md @@ -279,9 +279,9 @@ The build system supports multiple Linux distributions including Ubuntu/Debian a ./build_linux.sh -d ``` -3. **Build OrcaSlicer:** +3. **Build OrcaSlicer with tests:** ```shell - ./build_linux.sh -s + ./build_linux.sh -st ``` 4. **Build AppImage (optional):** @@ -291,14 +291,15 @@ The build system supports multiple Linux distributions including Ubuntu/Debian a 5. **All-in-one build (recommended):** ```shell - ./build_linux.sh -dsi + ./build_linux.sh -dsti ``` **Additional build options:** -- `-b`: Build in debug mode +- `-b`: Build in debug mode (mostly broken at runtime for a long time; avoid unless you want to be fixing failed assertions) - `-c`: Force a clean build - `-C`: Enable ANSI-colored compile output (GNU/Clang only) +- `-e`: Build RelWithDebInfo (release + symbols) - `-j N`: Limit builds to N cores (useful for low-memory systems) - `-1`: Limit builds to one core - `-l`: Use Clang instead of GCC @@ -309,10 +310,14 @@ The build system supports multiple Linux distributions including Ubuntu/Debian a > The build script automatically detects your Linux distribution and uses the appropriate package manager (apt, pacman) to install dependencies. > [!TIP] -> For first-time builds, use `./build_linux.sh -u` to install dependencies, then `./build_linux.sh -dsi` to build everything. +> For first-time builds, use `./build_linux.sh -u` to install dependencies, then `./build_linux.sh -dsti` to build everything. > [!WARNING] -> If you encounter memory issues during compilation, use `-j 1` or `-1` to limit parallel compilation, or `-r` to skip memory checks. +> If you encounter memory issues during compilation, use `-j 1` or `-1` to limit parallel compilation and `-r` to skip memory checks. + +#### Unit Testing + +See [How to Test](How-to-test) for more details. --- diff --git a/developer-reference/How-to-test.md b/developer-reference/How-to-test.md new file mode 100644 index 0000000..2929384 --- /dev/null +++ b/developer-reference/How-to-test.md @@ -0,0 +1,27 @@ +# How to Test + +This wiki page describes how to build and run tests on Linux. It should eventually provide guidance on how to add tests for a new feature. + +## Build Tests + +Can be built when you are building Orca Slicer binary by including the `-t` flag for `build_linux.sh`: + +``` +build_linux.sh -st +``` + +Test binaries will then appear under `build/tests`. As of this writing, not all tests will be built. + +## Run Unit Tests + +### Run All + +``` +ctest --test-dir build/tests +``` + +### Run a Specific Set + +``` +ctest --test-dir build/tests/slic3rutils +```