From 6f3cf284778f831838e17ae18e3a425a8d9d8cf5 Mon Sep 17 00:00:00 2001 From: pajlada Date: Tue, 28 Jan 2025 18:39:40 +0100 Subject: [PATCH] docs: update linux & test docs (#5864) --- BUILDING_ON_LINUX.md | 2 ++ tests/README.md | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/BUILDING_ON_LINUX.md b/BUILDING_ON_LINUX.md index 104a41e2..595d932b 100644 --- a/BUILDING_ON_LINUX.md +++ b/BUILDING_ON_LINUX.md @@ -26,6 +26,8 @@ sudo apt install qt6-base-dev qt6-5compat-dev qt6-svg-dev qt6-image-formats-plug sudo pacman -S --needed qt6-base qt6-tools boost-libs openssl qt6-imageformats qt6-5compat qt6-svg boost rapidjson pkgconf openssl cmake ``` +If you use Wayland, you will also need to ensure `qt6-wayland` is installed. + Alternatively you can use the [chatterino2-git](https://aur.archlinux.org/packages/chatterino2-git/) package to build and install Chatterino for you. ### Fedora 39 and above diff --git a/tests/README.md b/tests/README.md index e5d73c1a..f3c62c51 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,7 +1,25 @@ +To run tests, you'll first need to enable the test flag in cmake. You can do this by adding the `-DBUILD_TESTS=On` flag to your cmake setup call. (e.g. `mkdir build && cd build && cmake -DBUILD_TESTS=On ..`) + +After you've built Chatterino, you can now run the tests with `ctest` or by manually running the newly created `chatterino-test` executable + # Pre-requisites to running tests - Download & run [httpbox](https://github.com/Chatterino/httpbox/releases/latest) + We expect this to be listening to port 9051, you can launch it like this: `httpbox --port 9051` - Download & run [twitch-pubsub-server-test](https://github.com/Chatterino/twitch-pubsub-server-test/releases/latest) - `twitch-pubsub-server-test` + We expect this to be listening to port 9050, you can launch it like this: + `twitch-pubsub-server-test 127.0.0.1:9050` + +# Modifying message building + +If you make a change that has to do with message building, there's a big chance that some of the snapshot tests will fail. +If this happens, you might want to: + +1. Set the `UPDATE_SNAPSHOTS` boolean at the top of the [IrcMessageHandler.cpp](./src/IrcMessageHandler.cpp) test file to `true` +1. Re-run the tests (this will update the snapshots to match your new reality) +1. Reset `UPDATE_SNAPSHOTS` to `false` again +1. Then run the tests a final time. + +Once this is done, you should take a look at the changes made to the snapshot json files to ensure that it looks correct.