From 047bc2e7f7e640e528931054b8915ad54c46bc94 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Fri, 3 Mar 2023 10:46:29 +0000 Subject: [PATCH] tests: make it work aka hide HUDElements Currently the test is pulling an external reference to HUDElements, which is unresolved so the test fails to link. Signed-off-by: Emil Velikov --- meson.build | 1 + src/amdgpu.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/meson.build b/meson.build index e87bff97..a1e14ebd 100644 --- a/meson.build +++ b/meson.build @@ -271,6 +271,7 @@ if get_option('tests').enabled() 'src/mesa/util/os_time.c', 'src/file_utils.cpp', ), + cpp_args: ['-DTEST_ONLY'], dependencies: [ cmocka_dep, spdlog_dep, diff --git a/src/amdgpu.cpp b/src/amdgpu.cpp index 865f7731..9c5aae9e 100644 --- a/src/amdgpu.cpp +++ b/src/amdgpu.cpp @@ -156,9 +156,11 @@ void amdgpu_metrics_polling_thread() { memset(metrics_buffer, 0, sizeof(metrics_buffer)); while (1) { +#ifndef TEST_ONLY if (HUDElements.params->no_display && !logger->is_active()) usleep(100000); else +#endif amdgpu_get_samples_and_copy(metrics_buffer, gpu_load_needs_dividing); } }