diff options
author | Blaž Tomažič <blaz.tomazic@gmail.com> | 2012-08-29 22:39:35 +0200 |
---|---|---|
committer | Blaž Tomažič <blaz.tomazic@gmail.com> | 2012-09-05 14:56:00 +0200 |
commit | 9a6044d069f3c96b61eabf59b58ada52391fbb46 (patch) | |
tree | 4991fb6f438d04bf010c92ee83b79f1d4ffd44aa /tests | |
parent | 13d744e7c3cf04f41529675e09761c845deba85d (diff) |
cmake: Build OpenCL tests
Build OpenCL tests to binaries with 'cl-' prefix. Each test type adds
another prefix to it, for example Custom test has a 'cl-custom-' prefix.
Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/cl/CMakeLists.txt | 47 | ||||
-rw-r--r-- | tests/cl/api/CMakeLists.cl.txt | 41 | ||||
-rw-r--r-- | tests/cl/api/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/cl/custom/CMakeLists.cl.txt | 1 | ||||
-rw-r--r-- | tests/cl/custom/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/cl/program/CMakeLists.cl.txt | 2 | ||||
-rw-r--r-- | tests/cl/program/CMakeLists.txt | 1 |
8 files changed, 98 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 05824b473..64f38c54c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,6 +25,10 @@ IF(OPENGL_egl_LIBRARY) add_subdirectory (egl) ENDIF(OPENGL_egl_LIBRARY) +IF(BUILD_CL_TESTS) + add_subdirectory (cl) +ENDIF(BUILD_CL_TESTS) + IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") add_subdirectory (mesa) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") diff --git a/tests/cl/CMakeLists.txt b/tests/cl/CMakeLists.txt new file mode 100644 index 000000000..b91eda54b --- /dev/null +++ b/tests/cl/CMakeLists.txt @@ -0,0 +1,47 @@ +include_directories( + ${OPENCL_INCLUDE_PATH} + ${piglit_SOURCE_DIR}/tests/util +) + +link_libraries ( + piglitutil_${piglit_target_api} + ${OPENCL_opencl_LIBRARY} +) + +function(piglit_cl_add_test) + add_executable(${ARGV}) +endfunction(piglit_cl_add_test) + +function(piglit_cl_add_custom_test name) + + list(REMOVE_AT ARGV 0) + piglit_cl_add_test( + cl-custom-${name} + ${ARGV} + ) + +endfunction(piglit_cl_add_custom_test) + +function(piglit_cl_add_api_test name) + + list(REMOVE_AT ARGV 0) + piglit_cl_add_test( + cl-api-${name} + ${ARGV} + ) + +endfunction(piglit_cl_add_api_test) + +function(piglit_cl_add_program_test name) + + list(REMOVE_AT ARGV 0) + piglit_cl_add_test( + cl-program-${name} + ${ARGV} + ) + +endfunction(piglit_cl_add_program_test) + +add_subdirectory (custom) +add_subdirectory (api) +add_subdirectory (program) diff --git a/tests/cl/api/CMakeLists.cl.txt b/tests/cl/api/CMakeLists.cl.txt new file mode 100644 index 000000000..ae7e3bfe0 --- /dev/null +++ b/tests/cl/api/CMakeLists.cl.txt @@ -0,0 +1,41 @@ +# Basic +piglit_cl_add_api_test (get-platform-ids get-platform-ids.c) +piglit_cl_add_api_test (get-platform-info get-platform-info.c) +piglit_cl_add_api_test (get-device-ids get-device-ids.c) +piglit_cl_add_api_test (get-device-info get-device-info.c) +piglit_cl_add_api_test (create-context create-context.c) +piglit_cl_add_api_test (create-context-from-type create-context-from-type.c) +piglit_cl_add_api_test (get-context-info get-context-info.c) +piglit_cl_add_api_test (retain_release-context retain_release-context.c) + +# Command queues +piglit_cl_add_api_test (create-command-queue create-command-queue.c) +piglit_cl_add_api_test (get-command-queue-info get-command-queue-info.c) +piglit_cl_add_api_test (retain_release-command-queue retain_release-command-queue.c) + +# Memory objects +piglit_cl_add_api_test (create-buffer create-buffer.c) +piglit_cl_add_api_test (enqueue-read_write-buffer enqueue-read_write-buffer.c) +piglit_cl_add_api_test (retain_release-mem-object retain_release-mem-object.c) +piglit_cl_add_api_test (get-mem-object-info get-mem-object-info.c) +piglit_cl_add_api_test (get-image-info get-image-info.c) + +# Programs +piglit_cl_add_api_test (create-program-with-source create-program-with-source.c) +piglit_cl_add_api_test (retain_release-program retain_release-program.c) +piglit_cl_add_api_test (build-program build-program.c) +piglit_cl_add_api_test (unload-compiler unload-compiler.c) +piglit_cl_add_api_test (get-program-info get-program-info.c) +piglit_cl_add_api_test (get-program-build-info get-program-build-info.c) + +# Kernels +piglit_cl_add_api_test (create-kernel create-kernel.c) +piglit_cl_add_api_test (create-kernels-in-program create-kernels-in-program.c) +piglit_cl_add_api_test (set-kernel-arg set-kernel-arg.c) +piglit_cl_add_api_test (retain_release-kernel retain_release-kernel.c) +piglit_cl_add_api_test (get-kernel-info get-kernel-info.c) +piglit_cl_add_api_test (get-kernel-work-group-info get-kernel-work-group-info.c) + +# Events +piglit_cl_add_api_test (retain_release-event retain_release-event.c) +piglit_cl_add_api_test (get-event-info get-event-info.c) diff --git a/tests/cl/api/CMakeLists.txt b/tests/cl/api/CMakeLists.txt new file mode 100644 index 000000000..144a306f4 --- /dev/null +++ b/tests/cl/api/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/cl/custom/CMakeLists.cl.txt b/tests/cl/custom/CMakeLists.cl.txt new file mode 100644 index 000000000..4f93e2ae6 --- /dev/null +++ b/tests/cl/custom/CMakeLists.cl.txt @@ -0,0 +1 @@ +piglit_cl_add_custom_test (run-simple-kernel run-simple-kernel.c) diff --git a/tests/cl/custom/CMakeLists.txt b/tests/cl/custom/CMakeLists.txt new file mode 100644 index 000000000..144a306f4 --- /dev/null +++ b/tests/cl/custom/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/cl/program/CMakeLists.cl.txt b/tests/cl/program/CMakeLists.cl.txt new file mode 100644 index 000000000..343e2937b --- /dev/null +++ b/tests/cl/program/CMakeLists.cl.txt @@ -0,0 +1,2 @@ +piglit_cl_add_program_test (tester program-tester.c) +piglit_cl_add_program_test (max-work-item-sizes max-work-item-sizes.c) diff --git a/tests/cl/program/CMakeLists.txt b/tests/cl/program/CMakeLists.txt new file mode 100644 index 000000000..144a306f4 --- /dev/null +++ b/tests/cl/program/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() |