-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathVulkanSupportTest.php
More file actions
50 lines (43 loc) · 1.41 KB
/
VulkanSupportTest.php
File metadata and controls
50 lines (43 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
namespace GL\Tests\Vulkan;
use PHPUnit\Framework\TestCase;
/**
* Tests for Vulkan/MoltenVK support detection.
*
* @group glfwinit
*/
#[\PHPUnit\Framework\Attributes\Group('glfwinit')]
class VulkanSupportTest extends TestCase
{
protected function setUp(): void
{
if (!glfwInit()) {
$this->markTestSkipped('glfwInit() failed — no display available');
}
}
/**
* glfwVulkanSupported() must return a valid value (int 0/1 or bool) without crashing.
*/
public function testVulkanSupportedDoesNotCrash(): void
{
$result = glfwVulkanSupported();
$this->assertTrue(
$result === true || $result === false || $result === 0 || $result === 1,
'glfwVulkanSupported() must return a boolean-compatible value, got: ' . var_export($result, true),
);
}
/**
* Log Vulkan support status for CI diagnostic visibility.
*/
public function testVulkanSupportedReportsStatus(): void
{
$supported = (bool) glfwVulkanSupported();
fwrite(STDERR, sprintf(
"\n[VulkanSupportTest] glfwVulkanSupported() = %s\n",
$supported ? 'true (Vulkan available)' : 'false (Vulkan not available)',
));
// This test always passes — it's purely diagnostic.
// The actual value depends on the system's Vulkan installation.
$this->addToAssertionCount(1);
}
}