diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1598ebea2..447b0b348 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,34 @@ name: Windows on: [push] jobs: + clang-cl: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + - uses: ilammy/msvc-dev-cmd@v1 + - name: Configure + run: cmake -Bbuild -G"Ninja Multi-Config" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl + - name: Build (Debug) + run: cmake --build build --config Debug + - name: Unittest (Debug) + run: | + build/Debug/jngl-unittest Drawable + build/Debug/jngl-unittest ImageData + build/Debug/jngl-unittest FinallyTest + build/Debug/jngl-unittest halfLoadTest + build/Debug/jngl-unittest getBinaryPath + build/Debug/jngl-unittest readAsset + - name: Build (Release) + run: cmake --build build --config Release + - name: Unittest (Release) + run: | + build/Release/jngl-unittest Drawable + build/Release/jngl-unittest ImageData + build/Release/jngl-unittest FinallyTest + build/Release/jngl-unittest halfLoadTest + build/Release/jngl-unittest getBinaryPath + build/Release/jngl-unittest readAsset + msvc: runs-on: windows-2022 steps: @@ -9,8 +37,24 @@ jobs: run: cmake -Bbuild - name: Build (Debug) run: cmake --build build --config Debug + - name: Unittest (Debug) + run: | + build/Debug/jngl-unittest Drawable + build/Debug/jngl-unittest ImageData + build/Debug/jngl-unittest FinallyTest + build/Debug/jngl-unittest halfLoadTest + build/Debug/jngl-unittest getBinaryPath + build/Debug/jngl-unittest readAsset - name: Build (Release) run: cmake --build build --config Release + - name: Unittest (Release) + run: | + build/Release/jngl-unittest Drawable + build/Release/jngl-unittest ImageData + build/Release/jngl-unittest FinallyTest + build/Release/jngl-unittest halfLoadTest + build/Release/jngl-unittest getBinaryPath + build/Release/jngl-unittest readAsset - name: Configure (UWP) run: cmake -Bbuild-uwp -DCMAKE_SYSTEM_NAME=WindowsStore '-DCMAKE_SYSTEM_VERSION=10.0' - name: Build (UWP, Debug) diff --git a/src/unittest/SoundTest.cpp b/src/unittest/SoundTest.cpp new file mode 100644 index 000000000..b430bd2b8 --- /dev/null +++ b/src/unittest/SoundTest.cpp @@ -0,0 +1,20 @@ +// Copyright 2024 Jan Niklas Hasse +// For conditions of distribution and use, see copyright notice in LICENSE.txt + +#include "../jngl/sound.hpp" + +#include + +#include + +namespace { +boost::ut::suite _ = [] { + using namespace boost::ut; // NOLINT + "Sound"_test = [] { + jngl::play("../data/test.ogg"); + expect(jngl::isPlaying("../data/test.ogg")); + jngl::stop("../data/test.ogg"); + expect(!jngl::isPlaying("../data/test.ogg")); + }; +}; +} // namespace diff --git a/src/unittest/main.cpp b/src/unittest/main.cpp index a24242387..1f5156b5e 100644 --- a/src/unittest/main.cpp +++ b/src/unittest/main.cpp @@ -1,8 +1,13 @@ -// Copyright 2018-2023 Jan Niklas Hasse +// Copyright 2018-2024 Jan Niklas Hasse // For conditions of distribution and use, see copyright notice in LICENSE.txt #include +#include -int main() { +int main(int argc, char** argv) { + assert(argc <= 2); + if (argc == 2) { + boost::ut::cfg = { .filter = argv[1] }; + } return boost::ut::cfg<>.run(); // explicitly run registered test suites }