summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-08-12 16:23:06 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-11-09 22:44:09 +0000
commitee18e7e27a15cf718b63e47d7bcaf5e1eb9d00ae (patch)
treefd440180ea3353ec8cacca74b105ab50dd5316a9 /tests
parent800fa9971cb5c798edbb5915cad8de1022e5e92f (diff)
cmake: misc fixes and cleanups
- Windows libraries (DLLs) are runtime. Set RUNTIME_OUTPUT_DIRECTORY, in order for Windows to pick up the DLL when running gl_basic_test. - gl_basic_test - add OUTPUT_DIRECTORY otherwise we end up with missing DLL and cannot run it. - Execute the target rather than constructing the path/binary name, drop unneeded DEPENDS as well. - Use target_link_libraries over depreciated link_libraries. With these changes 'make check' and 'make check-func' no longer blows up for Windows platforms and it even passes everything but test_wcore_error_thread_local. The test most likely fails as we create a new thread rather than fork() the process. The latter does not have any straight-forward equivalent and most of the current implementations use undocumented Win32 API. v2: Rebase. v3: Fix typos in cmake comment. Spotted by Chad. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/CMakeLists.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/functional/CMakeLists.txt b/tests/functional/CMakeLists.txt
index 9d453f2..0612829 100644
--- a/tests/functional/CMakeLists.txt
+++ b/tests/functional/CMakeLists.txt
@@ -1,8 +1,3 @@
-link_libraries(
- ${waffle_libname}
- waffle_test
- )
-
set(gl_basic_test_sources
gl_basic_test.c
)
@@ -34,9 +29,20 @@ add_executable(gl_basic_test
${gl_basic_test_sources}
)
+# Ensure that the executable is in the same folder as the library it's linked
+# against. Otherwise Windows will fail to load the DLL, and the test will fail.
+set_target_properties(gl_basic_test
+ PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+)
+
+target_link_libraries(gl_basic_test
+ ${waffle_libname}
+ waffle_test
+ )
+
add_custom_target(gl_basic_test_run
- DEPENDS gl_basic_test
- COMMAND ${CMAKE_BINARY_DIR}/tests/functional/gl_basic_test
+ COMMAND gl_basic_test
)
add_dependencies(check-func gl_basic_test_run)