comparison ui/tests/CMakeLists.txt @ 636:2fd4f9980a2a

Add test for authenticode verificate (binverify) Still incomplete
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 23 Jun 2014 18:00:45 +0200
parents cf7e82e91875
children be30d50bc4f0
comparison
equal deleted inserted replaced
635:ed1887be5170 636:2fd4f9980a2a
13 ${CMAKE_SOURCE_DIR}/cinst) 13 ${CMAKE_SOURCE_DIR}/cinst)
14 14
15 find_package(Qt5Test) 15 find_package(Qt5Test)
16 include_directories(${Qt5Test_INCLUDE_DIRS}) 16 include_directories(${Qt5Test_INCLUDE_DIRS})
17 find_program(HIAWATHA_EXECUTABLE hiawatha) 17 find_program(HIAWATHA_EXECUTABLE hiawatha)
18 find_program(OSSLSIGNCODE_EXECUTABLE osslsigncode)
18 19
19 if (NOT HIAWATHA_EXECUTABLE) 20 if (NOT HIAWATHA_EXECUTABLE)
20 message (STATUS "WARNING: hiawatha webserver not found. Downloader tests will fail.") 21 message (STATUS "WARNING: hiawatha webserver not found. Downloader will not be run.")
21 else() 22 else()
22 add_definitions(-DHIAWATHA_EXECUTABLE="${HIAWATHA_EXECUTABLE}") 23 add_definitions(-DHIAWATHA_EXECUTABLE="${HIAWATHA_EXECUTABLE}")
24 endif()
25
26 if (WIN32 AND NOT OSSLSIGNCODE_EXECUTABLE)
27 message (STATUS "WARNING: osslsigncode not found. Authenticode tests will not be run.")
23 endif() 28 endif()
24 29
25 macro(add_custom_test _source _additional_sources) 30 macro(add_custom_test _source _additional_sources)
26 set(_test ${_source}) 31 set(_test ${_source})
27 get_filename_component(_name ${_source} NAME_WE) 32 get_filename_component(_name ${_source} NAME_WE)
63 # Using fakeinstaller here would cause windows UAC heuristics to trigger 68 # Using fakeinstaller here would cause windows UAC heuristics to trigger
64 add_executable(fakeinst fakeinstaller.c) 69 add_executable(fakeinst fakeinstaller.c)
65 70
66 if (WIN32) 71 if (WIN32)
67 add_custom_test(windowsstoretest.cpp "${CMAKE_SOURCE_DIR}/cinst/windowsstore.c") 72 add_custom_test(windowsstoretest.cpp "${CMAKE_SOURCE_DIR}/cinst/windowsstore.c")
68 endif (WIN32) 73
74 if (OSSLSIGNCODE_EXECUTABLE)
75 add_custom_test (binverifytest.cpp "")
76 add_custom_command(
77 TARGET binverifytest
78 POST_BUILD
79 COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_CURRENT_SOURCE_DIR}/data/codesign/codesigning.pem
80 -key ${CMAKE_CURRENT_SOURCE_DIR}/data/codesign/codesigning.key
81 -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/fakeinst.exe
82 -out ${CMAKE_CURRENT_BINARY_DIR}/fakeinst-signed.exe
83 )
84 endif()
85 else ()
86 add_custom_test (binverifytest.cpp "")
87 endif ()
69 88
70 if (NSS_FOUND) 89 if (NSS_FOUND)
71 include_directories(${NSS_INCLUDE_DIRS}) 90 include_directories(${NSS_INCLUDE_DIRS})
72 set(NSSTEST_SOURCES 91 set(NSSTEST_SOURCES
73 ${CMAKE_SOURCE_DIR}/cinst/nssstore_linux.c 92 ${CMAKE_SOURCE_DIR}/cinst/nssstore_linux.c

http://wald.intevation.org/projects/trustbridge/