diff options
Diffstat (limited to 'Tests')
19 files changed, 109 insertions, 11 deletions
diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt index 18a73a3..e39ffb1 100644 --- a/Tests/FindX11/Test/CMakeLists.txt +++ b/Tests/FindX11/Test/CMakeLists.txt @@ -32,10 +32,13 @@ test_x11_component(x11_components Xau) test_x11_component(x11_components Xaw) test_x11_component(x11_components xcb) test_x11_component(x11_components X11_xcb) +test_x11_component(x11_components xcb_cursor) test_x11_component(x11_components xcb_icccm) test_x11_component(x11_components xcb_randr) +test_x11_component(x11_components xcb_shape) test_x11_component(x11_components xcb_util) test_x11_component(x11_components xcb_xfixes) +test_x11_component(x11_components xcb_xrm) test_x11_component(x11_components xcb_xtest) test_x11_component(x11_components xcb_keysyms) test_x11_component(x11_components xcb_xkb) @@ -76,10 +79,13 @@ foreach(lib Xaw xcb X11_xcb + xcb_cursor xcb_icccm xcb_randr + xcb_shape xcb_util xcb_xfixes + xcb_xrm Xcomposite Xdamage Xdmcp diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c index 653a2be..5240de0 100644 --- a/Tests/FindX11/Test/main.c +++ b/Tests/FindX11/Test/main.c @@ -336,6 +336,22 @@ static void test_xcb(void) xcb_disconnect(connection); } +# ifdef HAVE_xcb_cursor +# include <xcb/xcb_cursor.h> + +static void test_xcb_cursor(void) +{ + int screen_nbr; + xcb_connection_t* connection = xcb_connect(NULL, &screen_nbr); + xcb_screen_t* screen = xcb_aux_get_screen(conn, screen_nbr); + xcb_cursor_context_t* ctx; + xcb_cursor_context_new(connection, screen, &ctx); + xcb_cursor_context_free(ctx); + xcb_disconnect(connection); +} + +# endif + # ifdef HAVE_xcb_randr # include <xcb/randr.h> @@ -350,6 +366,20 @@ static void test_xcb_randr(void) # endif +# ifdef HAVE_xcb_shape +# include <xcb/shape.h> + +static void test_xcb_shape(void) +{ + int screen_nbr; + xcb_connection_t* connection = xcb_connect(NULL, &screen_nbr); + xcb_shape_query_version_cookie_t cookie = + xcb_shape_query_version(connection); + xcb_disconnect(connection); +} + +# endif + # ifdef HAVE_xcb_util # include <xcb/xcb_aux.h> @@ -376,6 +406,20 @@ static void test_xcb_xfixes(void) # endif +# ifdef HAVE_xcb_xrm +# include <xcb/xcb_xrm.h> + +static void test_xcb_xrm(void) +{ + int screen_nbr; + xcb_connection_t* connection = xcb_connect(NULL, &screen_nbr); + xcb_xrm_database_t* db = xcb_xrm_database_from_default(connection); + xcb_xrm_database_free(db); + xcb_disconnect(connection); +} + +# endif + # ifdef HAVE_xcb_xtest # include <xcb/xtest.h> @@ -496,15 +540,24 @@ int main(int argc, char* argv[]) #ifdef HAVE_xcb test_xcb, #endif -#ifdef HAVE_xcb_util +#ifdef HAVE_xcb_cursor + test_xcb_cursor, +#endif +#ifdef HAVE_xcb_randr test_xcb_randr, #endif +#ifdef HAVE_xcb_shape + test_xcb_shape, +#endif #ifdef HAVE_xcb_util test_xcb_util, #endif #ifdef HAVE_xcb_xfixes test_xcb_xfixes, #endif +#ifdef HAVE_xcb_xrm + test_xcb_xrm, +#endif NULL, }; diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index e372286..72de742 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -270,8 +270,6 @@ if(want_NoQt_test) add_RunCMake_test(AutogenNoQt TEST_DIR Autogen) endif() -add_RunCMake_test(ArtifactOutputDirs) - if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC") AND CMAKE_GENERATOR MATCHES "^Ninja" @@ -396,6 +394,7 @@ if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STRE endif() add_RunCMake_test(ScriptMode) add_RunCMake_test(Swift -DCMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) +add_RunCMake_test(TargetArtifacts -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetProperties) add_RunCMake_test(ToolchainFile) diff --git a/Tests/RunCMake/FetchContent/IgnoreToolchainFile.cmake b/Tests/RunCMake/FetchContent/IgnoreToolchainFile.cmake new file mode 100644 index 0000000..f8ee749 --- /dev/null +++ b/Tests/RunCMake/FetchContent/IgnoreToolchainFile.cmake @@ -0,0 +1,2 @@ +set(ENV{CMAKE_TOOLCHAIN_FILE} path/to/somewhere/iDoNotExist.cmake) +include(DownloadFile.cmake) diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake index bb27491..3781089 100644 --- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake +++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake @@ -7,6 +7,7 @@ run_cmake(DirectIgnoresDetails) run_cmake(FirstDetailsWin) run_cmake(DownloadTwice) run_cmake(DownloadFile) +run_cmake(IgnoreToolchainFile) run_cmake(SameGenerator) run_cmake(System) run_cmake(VarDefinitions) diff --git a/Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt b/Tests/RunCMake/TargetArtifacts/CMakeLists.txt index ab1a20c..ab1a20c 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt +++ b/Tests/RunCMake/TargetArtifacts/CMakeLists.txt diff --git a/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt new file mode 100644 index 0000000..b375da6 --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt @@ -0,0 +1,2 @@ +.*exA_name="(libexA\.so\.2|libexA\.2\.dylib|(lib|cyg|msys-|)exA-2\.dll)" +.*exB_name="(libexB\.so\.2|libexB\.2\.dylib|(lib|cyg|msys-|)exB-2\.dll)" diff --git a/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake new file mode 100644 index 0000000..82eca0b --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +add_library(exA SHARED dll.c) +set_target_properties(exA PROPERTIES + SOVERSION 2 + DLL_NAME_WITH_SOVERSION 1 + ) + +set(CMAKE_DLL_NAME_WITH_SOVERSION 1) +add_library(exB SHARED dll.c) +set_property(TARGET exB PROPERTY SOVERSION 2) + +add_custom_target(checkNames ALL + COMMAND ${CMAKE_COMMAND} -E echo exA_name="$<TARGET_FILE_NAME:exA>" + COMMAND ${CMAKE_COMMAND} -E echo exB_name="$<TARGET_FILE_NAME:exB>" + VERBATIM + ) +add_dependencies(checkNames exA exB) diff --git a/Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake b/Tests/RunCMake/TargetArtifacts/OutputDirs.cmake index d0accd7..d0accd7 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake +++ b/Tests/RunCMake/TargetArtifacts/OutputDirs.cmake diff --git a/Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake index 1bf8438..de69936 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake @@ -2,18 +2,18 @@ include(RunCMake) function(run_cmake_and_verify_after_build case) set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${case}-build") - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - set(RunCMake_TEST_NO_CLEAN 1) if(RunCMake_GENERATOR_IS_MULTI_CONFIG) set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug) else() set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) endif() run_cmake(${case}) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command("${case}-build" ${CMAKE_COMMAND} --build .) - unset(RunCMake_TEST_NO_CLEAN) - unset(RunCMake_TEST_BINARY_DIR) endfunction() -run_cmake_and_verify_after_build(ArtifactOutputDirs) +if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX") + run_cmake_and_verify_after_build(DLL-SOVERSION) +endif() +run_cmake_and_verify_after_build(OutputDirs) diff --git a/Tests/RunCMake/ArtifactOutputDirs/check.cmake b/Tests/RunCMake/TargetArtifacts/check.cmake index ca37eba..ca37eba 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/check.cmake +++ b/Tests/RunCMake/TargetArtifacts/check.cmake diff --git a/Tests/RunCMake/TargetArtifacts/dll.c b/Tests/RunCMake/TargetArtifacts/dll.c new file mode 100644 index 0000000..31e1dbf --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/dll.c @@ -0,0 +1,6 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + void dll(void) +{ +} diff --git a/Tests/RunCMake/ArtifactOutputDirs/lib.c b/Tests/RunCMake/TargetArtifacts/lib.c index 22373f1..22373f1 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/lib.c +++ b/Tests/RunCMake/TargetArtifacts/lib.c diff --git a/Tests/RunCMake/ArtifactOutputDirs/main.c b/Tests/RunCMake/TargetArtifacts/main.c index 8488f4e..8488f4e 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/main.c +++ b/Tests/RunCMake/TargetArtifacts/main.c diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index fa61bdb..e5a0413 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -166,7 +166,6 @@ unset(RunCMake_TEST_OPTIONS) run_install_test(Deprecated) run_install_test(PRE_POST_INSTALL_SCRIPT) -run_install_test(SCRIPT) run_install_test(TARGETS-CONFIGURATIONS) run_install_test(DIRECTORY-PATTERN) run_install_test(TARGETS-Parts) @@ -174,6 +173,10 @@ run_install_test(FILES-PERMISSIONS) run_install_test(TARGETS-RPATH) run_install_test(InstallRequiredSystemLibraries) +set(RunCMake_TEST_OPTIONS "-DCMAKE_POLICY_DEFAULT_CMP0087:STRING=NEW") +run_install_test(SCRIPT) +unset(RunCMake_TEST_OPTIONS) + if(UNIX) run_install_test(DIRECTORY-symlink-clobber) endif() diff --git a/Tests/RunCMake/install/SCRIPT-all-check.cmake b/Tests/RunCMake/install/SCRIPT-all-check.cmake index 48d8e1a..b9c38e3 100644 --- a/Tests/RunCMake/install/SCRIPT-all-check.cmake +++ b/Tests/RunCMake/install/SCRIPT-all-check.cmake @@ -1 +1 @@ -check_installed([[^empty1.txt;empty2.txt$]]) +check_installed([[^empty1.txt;empty2.txt;empty3.cmake;empty3.txt;empty4.cmake;empty4.txt$]]) diff --git a/Tests/RunCMake/install/SCRIPT.cmake b/Tests/RunCMake/install/SCRIPT.cmake index f857b54..ee0c80e 100644 --- a/Tests/RunCMake/install/SCRIPT.cmake +++ b/Tests/RunCMake/install/SCRIPT.cmake @@ -1,4 +1,10 @@ install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/empty3.cmake ${CMAKE_CURRENT_SOURCE_DIR}/empty4.cmake + DESTINATION . + ) +install( SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/install_script.cmake" CODE "write_empty_file(empty2.txt)" + SCRIPT "$<INSTALL_PREFIX>/empty3.cmake" + CODE [[include($<INSTALL_PREFIX>/empty4.cmake)]] ) diff --git a/Tests/RunCMake/install/empty3.cmake b/Tests/RunCMake/install/empty3.cmake new file mode 100644 index 0000000..18c2ac5 --- /dev/null +++ b/Tests/RunCMake/install/empty3.cmake @@ -0,0 +1 @@ +write_empty_file(empty3.txt) diff --git a/Tests/RunCMake/install/empty4.cmake b/Tests/RunCMake/install/empty4.cmake new file mode 100644 index 0000000..026a4d2 --- /dev/null +++ b/Tests/RunCMake/install/empty4.cmake @@ -0,0 +1 @@ +write_empty_file(empty4.txt) |