tests/amdgpu: create Active function for basic test suite

Acked-by: Huang Rui <ray.huang@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
main
Le Ma 2019-03-04 18:27:48 +08:00 committed by Alex Deucher
parent ba0d45eca6
commit 301b4b64d0
3 changed files with 19 additions and 1 deletions

View File

@ -149,7 +149,7 @@ static CU_BOOL always_active()
static Suites_Active_Status suites_active_stat[] = { static Suites_Active_Status suites_active_stat[] = {
{ {
.pName = BASIC_TESTS_STR, .pName = BASIC_TESTS_STR,
.pActive = always_active, .pActive = suite_basic_tests_enable,
}, },
{ {
.pName = BO_TESTS_STR, .pName = BO_TESTS_STR,

View File

@ -54,6 +54,11 @@ int suite_basic_tests_init();
*/ */
int suite_basic_tests_clean(); int suite_basic_tests_clean();
/**
* Decide if the suite is enabled by default or not.
*/
CU_BOOL suite_basic_tests_enable(void);
/** /**
* Tests in basic test suite * Tests in basic test suite
*/ */

View File

@ -39,6 +39,7 @@
#include "amdgpu_test.h" #include "amdgpu_test.h"
#include "amdgpu_drm.h" #include "amdgpu_drm.h"
#include "amdgpu_internal.h"
#include "util_math.h" #include "util_math.h"
static amdgpu_device_handle device_handle; static amdgpu_device_handle device_handle;
@ -599,6 +600,18 @@ static bool asic_is_arcturus(uint32_t asic_id)
} }
} }
CU_BOOL suite_basic_tests_enable(void)
{
if (amdgpu_device_initialize(drm_amdgpu[0], &major_version,
&minor_version, &device_handle))
return CU_FALSE;
if (amdgpu_device_deinitialize(device_handle))
return CU_FALSE;
return CU_TRUE;
}
int suite_basic_tests_init(void) int suite_basic_tests_init(void)
{ {
struct amdgpu_gpu_info gpu_info = {0}; struct amdgpu_gpu_info gpu_info = {0};