From 76483ae32e675fe41ca9bdc10910b82cf03a54fa Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Sun, 12 Jan 2025 21:12:11 +0100 Subject: [PATCH] adding test --- .github/workflows/linux-build.yml | 2 +- .github/workflows/msys2-build.yml | 2 +- .github/workflows/windows-build.yml | 2 +- Tests/Vulkan/Backend.c | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 78580ae..078f492 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -95,7 +95,7 @@ jobs: run: xmake --yes # Test the engine - - name: Build Pulse + - name: Test Vulkan run: | xmake config --vulkan-tests=y --yes xmake build --yes VulkanUnitTests diff --git a/.github/workflows/msys2-build.yml b/.github/workflows/msys2-build.yml index 3507c5e..a9bdc7d 100644 --- a/.github/workflows/msys2-build.yml +++ b/.github/workflows/msys2-build.yml @@ -91,7 +91,7 @@ jobs: run: xmake --yes # Test the engine - - name: Build Pulse + - name: Test Vulkan run: | xmake config --vulkan-tests=y --yes xmake build --yes VulkanUnitTests diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index bec073d..73e1017 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -86,7 +86,7 @@ jobs: run: xmake --yes # Test the engine - - name: Build Pulse + - name: Test Vulkan run: | xmake config --vulkan-tests=y --yes xmake build --yes VulkanUnitTests diff --git a/Tests/Vulkan/Backend.c b/Tests/Vulkan/Backend.c index ac694bc..44a186b 100644 --- a/Tests/Vulkan/Backend.c +++ b/Tests/Vulkan/Backend.c @@ -9,6 +9,15 @@ void DumbDebugCallBack(PulseDebugMessageSeverity severity, const char* message) (void)message; } +void TestVulkanSupport() +{ + if(!PulseSupportsBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT)) + { + TEST_FAIL_MESSAGE("Vulkan is not supported"); + exit(1); + } +} + void TestBackendSetup() { PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_HIGH_DEBUG); @@ -36,6 +45,7 @@ void TestWrongBackendSetup() void TestBackend() { + RUN_TEST(TestVulkanSupport); RUN_TEST(TestBackendSetup); RUN_TEST(TestBackendAnySetup); RUN_TEST(TestWrongBackendSetup);