summaryrefslogtreecommitdiff
blob: 3c6d500f2fbf8e41efd836c469150a1bf97f2e1d (plain)
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
Run tests in src_test() instead of src_compile() and src_install()

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,8 @@ if("${os_name}" STREQUAL "clear-linux-os")
     set(CMAKE_INSTALL_SYSCONFDIR "usr/share/defaults/etc")
 endif()
 
+include(CTest)
+
 include(CMakeDependentOption)
 
 option (ENABLE_KERNELS "Build driver with shaders (kernels) support" ON)
--- a/media_driver/linux/ult/CMakeLists.txt
+++ b/media_driver/linux/ult/CMakeLists.txt
@@ -52,9 +52,3 @@ endif ()
 add_subdirectory(libdrm_mock)
 add_subdirectory(ult_app)
 
-enable_testing()
-add_test(NAME test_devult COMMAND devult ${UMD_PATH})
-set_tests_properties(test_devult
-    PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
-set_tests_properties(test_devult
-    PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
--- a/media_driver/linux/ult/ult_app/CMakeLists.txt
+++ b/media_driver/linux/ult/ult_app/CMakeLists.txt
@@ -68,13 +68,11 @@ if (DEFINED BYPASS_MEDIA_ULT AND "${BYPASS_MEDIA_ULT}" STREQUAL "yes")
     message("-- media -- BYPASS_MEDIA_ULT = ${BYPASS_MEDIA_ULT}")
 else ()
     if (ENABLE_NONFREE_KERNELS)
-        add_custom_target(RunULT ALL DEPENDS ${LIB_NAME} devult)
 
-        add_custom_command(
-            TARGET RunULT
-            POST_BUILD
-            COMMAND LD_PRELOAD=../libdrm_mock/libdrm_mock.so ./devult ../../../${LIB_NAME}.so
+        add_test(
+            NAME RunULT
+            COMMAND "${CMAKE_COMMAND}" -E env "LD_PRELOAD=${CMAKE_CURRENT_BINARY_DIR}/../libdrm_mock/libdrm_mock.so" "${CMAKE_CURRENT_BINARY_DIR}/devult" "${CMAKE_CURRENT_BINARY_DIR}/../../../${LIB_NAME}.so"
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-            COMMENT "Running devult...")
+            )
         endif ()
 endif ()