diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ExternalProject/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 77 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json | 2 | ||||
-rw-r--r-- | Tests/RunCMake/AutoExportDll/AutoExport.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/AutoExportDll/nop.asm | 12 | ||||
-rw-r--r-- | Tests/RunCMake/AutoExportDll/say.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 13 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/reject_fifo-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/reject_fifo-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/LibArchLink-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/LibArchLink.cmake | 24 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/RunCMakeTest.cmake | 3 |
15 files changed, 124 insertions, 46 deletions
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 72c20eb..6b73563 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -90,6 +90,16 @@ ExternalProject_Add(${proj} ) set_property(TARGET ${proj} PROPERTY FOLDER "") +set(proj NoExtractLogDownload) +ExternalProject_Add(${proj} + URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz + DOWNLOAD_NO_EXTRACT 1 + LOG_DOWNLOAD 1 + BUILD_COMMAND "" + CONFIGURE_COMMAND "" + INSTALL_COMMAND "" +) + # CVS-based tests: # diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 257c187..dc631c6 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -232,55 +232,56 @@ if (NOT QT_TEST_VERSION STREQUAL 4) endif() set(timeformat "%Y%j%H%M%S") - set(mocPluginBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin") - find_library(style_a_file "PluginStyleA" "${mocPluginBinDir}") - find_library(style_b_file "PluginStyleB" "${mocPluginBinDir}") - find_library(style_c_file "PluginStyleC" "${mocPluginBinDir}") - find_library(style_d_file "PluginStyleD" "${mocPluginBinDir}") - - file(TIMESTAMP "${style_a_file}" style_a_before "${timeformat}") - file(TIMESTAMP "${style_b_file}" style_b_before "${timeformat}") - file(TIMESTAMP "${style_c_file}" style_c_before "${timeformat}") - file(TIMESTAMP "${style_d_file}" style_d_before "${timeformat}") - - # Ensure that the timestamp will change and touch the json files + set(mocPlugSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin") + set(mocPlugBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin") + find_library(plAFile "PlugA" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) + find_library(plBFile "PlugB" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) + find_library(plCFile "PlugC" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) + find_library(plDFile "PlugD" PATHS "${mocPlugBinDir}" NO_DEFAULT_PATH) + + file(TIMESTAMP "${plAFile}" plABefore "${timeformat}") + file(TIMESTAMP "${plBFile}" plBBefore "${timeformat}") + file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}") + file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}") + + # Ensure that the timestamp will change and change the json files execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) - execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${mocPluginBinDir}/jsonFiles/StyleC.json") - execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${mocPluginBinDir}/jsonFiles/sub/StyleD.json") - execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPluginBinDir}") + configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleC.json") + configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD.json") + execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}") - file(TIMESTAMP "${style_a_file}" style_a_after "${timeformat}") - file(TIMESTAMP "${style_b_file}" style_b_after "${timeformat}") - file(TIMESTAMP "${style_c_file}" style_c_after "${timeformat}") - file(TIMESTAMP "${style_d_file}" style_d_after "${timeformat}") + file(TIMESTAMP "${plAFile}" plAAfter "${timeformat}") + file(TIMESTAMP "${plBFile}" plBAfter "${timeformat}") + file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}") + file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}") - if (style_a_after GREATER style_a_before) - message(SEND_ERROR "file (${style_a_file}) should not have changed!") + if (plAAfter GREATER plABefore) + message(SEND_ERROR "file (${plAFile}) should not have changed!") endif() - if (style_b_after GREATER style_b_before) - message(SEND_ERROR "file (${style_b_file}) should not have changed!") + if (plBAfter GREATER plBBefore) + message(SEND_ERROR "file (${plBFile}) should not have changed!") endif() - if (NOT style_c_after GREATER style_c_before) - message(SEND_ERROR "file (${style_c_file}) should have changed!") + if (NOT plCAfter GREATER plCBefore) + message(SEND_ERROR "file (${plCFile}) should have changed!") endif() - if (NOT style_d_after GREATER style_d_before) - message(SEND_ERROR "file (${style_d_file}) should have changed!") + if (NOT plDAfter GREATER plDBefore) + message(SEND_ERROR "file (${plDFile}) should have changed!") endif() # Test custom macro - file(TIMESTAMP "${style_c_file}" style_c_before "${timeformat}") - file(TIMESTAMP "${style_d_file}" style_d_before "${timeformat}") + file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}") + file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}") execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) - execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${mocPluginBinDir}/jsonFiles/StyleC_Custom.json") - execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${mocPluginBinDir}/jsonFiles/sub/StyleD_Custom.json") - execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPluginBinDir}") - file(TIMESTAMP "${style_c_file}" style_c_after "${timeformat}") - file(TIMESTAMP "${style_d_file}" style_d_after "${timeformat}") - if (NOT style_c_after GREATER style_c_before) - message(SEND_ERROR "file (${style_c_file}) should have changed!") + configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleC_Custom.json") + configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD_Custom.json") + execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}") + file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}") + file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}") + if (NOT plCAfter GREATER plCBefore) + message(SEND_ERROR "file (${plCFile}) should have changed!") endif() - if (NOT style_d_after GREATER style_d_before) - message(SEND_ERROR "file (${style_d_file}) should have changed!") + if (NOT plDAfter GREATER plDBefore) + message(SEND_ERROR "file (${plDFile}) should have changed!") endif() endif() diff --git a/Tests/QtAutogen/mocPlugin/CMakeLists.txt b/Tests/QtAutogen/mocPlugin/CMakeLists.txt index b72b05d..4843c21 100644 --- a/Tests/QtAutogen/mocPlugin/CMakeLists.txt +++ b/Tests/QtAutogen/mocPlugin/CMakeLists.txt @@ -25,8 +25,8 @@ set(CMAKE_AUTOMOC TRUE) include_directories("${CMAKE_CURRENT_BINARY_DIR}/jsonFiles") link_libraries(Qt5::Widgets) -add_library(PluginStyleA MODULE StyleA.cpp) -add_library(PluginStyleB MODULE StyleB.cpp) -add_library(PluginStyleC MODULE StyleC.cpp) -add_library(PluginStyleD MODULE StyleD.cpp) -add_library(PluginStyleE MODULE StyleE.cpp) +add_library(PlugA STATIC StyleA.cpp) +add_library(PlugB STATIC StyleB.cpp) +add_library(PlugC STATIC StyleC.cpp) +add_library(PlugD STATIC StyleD.cpp) +add_library(PlugE STATIC StyleE.cpp) diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json b/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json index bf17580..119aaa4 100644 --- a/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json +++ b/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json @@ -1 +1 @@ -{ "Keys": [ "Rocket", "StarbusterC" ] } +{ "Keys": [ "Boat", "Ship" ] } diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json b/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json index f7fcc19..732c547 100644 --- a/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json +++ b/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json @@ -1 +1 @@ -{ "Keys": [ "Rocket", "StarbusterD" ] } +{ "Keys": [ "Bike", "Car" ] } diff --git a/Tests/RunCMake/AutoExportDll/AutoExport.cmake b/Tests/RunCMake/AutoExportDll/AutoExport.cmake index d37e896..a550005 100644 --- a/Tests/RunCMake/AutoExportDll/AutoExport.cmake +++ b/Tests/RunCMake/AutoExportDll/AutoExport.cmake @@ -11,5 +11,11 @@ if(MSVC) set_target_properties(say PROPERTIES ENABLE_EXPORTS ON) add_library(autoexport_for_exec SHARED hello2.c) target_link_libraries(autoexport_for_exec say) + if(NOT MSVC_VERSION VERSION_LESS 1600) + enable_language(ASM_MASM) + target_sources(autoexport PRIVATE nop.asm) + set_property(SOURCE nop.asm PROPERTY COMPILE_FLAGS /safeseh) + target_compile_definitions(say PRIVATE HAS_JUSTNOP) + endif() endif() target_link_libraries(say autoexport autoexport2) diff --git a/Tests/RunCMake/AutoExportDll/nop.asm b/Tests/RunCMake/AutoExportDll/nop.asm new file mode 100644 index 0000000..fd6892f --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/nop.asm @@ -0,0 +1,12 @@ +IFDEF RAX +ELSE +.MODEL FLAT,C +ENDIF + +SOME SEGMENT EXECUTE READ + +public justnop +justnop: + ret + +END diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx index e966b1f..51060e8 100644 --- a/Tests/RunCMake/AutoExportDll/say.cxx +++ b/Tests/RunCMake/AutoExportDll/say.cxx @@ -12,6 +12,7 @@ int WINAPI foo(); // test regular C int bar(); int objlib(); +void justnop(); } // test c++ functions @@ -42,5 +43,8 @@ int main() bar(); objlib(); printf("\n"); +#ifdef HAS_JUSTNOP + justnop(); +#endif return 0; } diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index bd92013..6423bfd 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -290,7 +290,7 @@ add_RunCMake_test(target_link_libraries) add_RunCMake_test(target_compile_features) add_RunCMake_test(CheckModules) -add_RunCMake_test(CommandLine) +add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(CommandLineTar) add_RunCMake_test(install) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 0c4f71c..b213ee2 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.1) + include(RunCMake) run_cmake_command(NoArgs ${CMAKE_COMMAND}) @@ -301,3 +303,14 @@ set(CMAKE_RELATIVE_PATH_TOP_BINARY \"${RunCMake_TEST_BINARY_DIR}\") ) endfunction() run_cmake_depends() + +function(reject_fifo) + find_program(BASH_EXECUTABLE bash) + if(BASH_EXECUTABLE) + set(BASH_COMMAND_ARGUMENT "'${CMAKE_COMMAND}' -P <(echo 'return()')") + run_cmake_command(reject_fifo ${BASH_EXECUTABLE} -c ${BASH_COMMAND_ARGUMENT}) + endif() +endfunction() +if(CMAKE_HOST_UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "CYGWIN") + reject_fifo() +endif() diff --git a/Tests/RunCMake/CommandLine/reject_fifo-result.txt b/Tests/RunCMake/CommandLine/reject_fifo-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/reject_fifo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/reject_fifo-stderr.txt b/Tests/RunCMake/CommandLine/reject_fifo-stderr.txt new file mode 100644 index 0000000..7a335c3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/reject_fifo-stderr.txt @@ -0,0 +1,2 @@ +CMake Error in .* + Error while reading Byte-Order-Mark\. File not seekable\? diff --git a/Tests/RunCMake/find_library/LibArchLink-stderr.txt b/Tests/RunCMake/find_library/LibArchLink-stderr.txt new file mode 100644 index 0000000..139e077 --- /dev/null +++ b/Tests/RunCMake/find_library/LibArchLink-stderr.txt @@ -0,0 +1,2 @@ +TOP_LIBRARY='[^']*/Tests/RunCMake/find_library/LibArchLink-build/lib/libtop.a' +SUB_LIBRARY='[^']*/Tests/RunCMake/find_library/LibArchLink-build/lib/sub/libsub.a' diff --git a/Tests/RunCMake/find_library/LibArchLink.cmake b/Tests/RunCMake/find_library/LibArchLink.cmake new file mode 100644 index 0000000..c91381d --- /dev/null +++ b/Tests/RunCMake/find_library/LibArchLink.cmake @@ -0,0 +1,24 @@ +set(CMAKE_SIZEOF_VOID_P 4) +set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS ON) +list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink lib ${CMAKE_CURRENT_BINARY_DIR}/lib32) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libtop.a" "top") +find_library(TOP_LIBRARY + NAMES top + PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib + NO_DEFAULT_PATH + ) +message("TOP_LIBRARY='${TOP_LIBRARY}'") + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/sub) +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink . ${CMAKE_CURRENT_BINARY_DIR}/lib/sub/32) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/sub/libsub.a" "sub") +find_library(SUB_LIBRARY + NAMES sub + PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib/sub + NO_DEFAULT_PATH + ) +message("SUB_LIBRARY='${SUB_LIBRARY}'") diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake index 5733965..e7e8db3 100644 --- a/Tests/RunCMake/find_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake @@ -1,6 +1,9 @@ include(RunCMake) run_cmake(Created) +if(CMAKE_HOST_UNIX) + run_cmake(LibArchLink) +endif() if(WIN32 OR CYGWIN) run_cmake(PrefixInPATH) endif() |