(t *testing.T)
| 19 | ) |
| 20 | |
| 21 | func TestGPUEnvs(t *testing.T) { |
| 22 | t.Parallel() |
| 23 | |
| 24 | t.Run("OK", func(t *testing.T) { |
| 25 | t.Parallel() |
| 26 | |
| 27 | ctx := xunix.WithEnvironFn(context.Background(), func() []string { |
| 28 | return []string{ |
| 29 | "NVIDIA_TEST=1", |
| 30 | "VULKAN_TEST=1", |
| 31 | "LIBGL_TEST=1", |
| 32 | "TEST_NVIDIA=1", |
| 33 | "nvidia_test=1", |
| 34 | } |
| 35 | }) |
| 36 | |
| 37 | envs := xunix.GPUEnvs(ctx) |
| 38 | require.Contains(t, envs, "NVIDIA_TEST=1") |
| 39 | require.Contains(t, envs, "TEST_NVIDIA=1") |
| 40 | require.Contains(t, envs, "nvidia_test=1") |
| 41 | require.NotContains(t, envs, "VULKAN_TEST=1") |
| 42 | require.NotContains(t, envs, "LIBGL_TEST=1") |
| 43 | }) |
| 44 | } |
| 45 | |
| 46 | func TestGPUs(t *testing.T) { |
| 47 | t.Parallel() |
nothing calls this directly
no test coverage detected