Tests: Add explicit testing for find_program
Previously this command was tested only implicitly as part of larger tests. Add a RunCMake.find_program test to cover find_program cases specifically and independently.
This commit is contained in:
parent
907a919be1
commit
fdbfc9f677
|
@ -183,6 +183,7 @@ add_RunCMake_test(find_file)
|
|||
add_RunCMake_test(find_library)
|
||||
add_RunCMake_test(find_package)
|
||||
add_RunCMake_test(find_path)
|
||||
add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
|
||||
add_RunCMake_test(get_filename_component)
|
||||
add_RunCMake_test(get_property)
|
||||
add_RunCMake_test(if)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#!/bin/sh
|
|
@ -0,0 +1 @@
|
|||
#!/bin/sh
|
|
@ -0,0 +1,3 @@
|
|||
cmake_minimum_required(VERSION 3.3)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
|
@ -0,0 +1 @@
|
|||
-- PROG='[^']*/Tests/RunCMake/find_program/B/testB'
|
|
@ -0,0 +1,6 @@
|
|||
find_program(PROG
|
||||
NAMES testB testA
|
||||
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
message(STATUS "PROG='${PROG}'")
|
|
@ -0,0 +1,8 @@
|
|||
include(RunCMake)
|
||||
|
||||
run_cmake(DirsPerName)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
|
||||
run_cmake(WindowsCom)
|
||||
run_cmake(WindowsExe)
|
||||
endif()
|
|
@ -0,0 +1 @@
|
|||
-- PROG='[^']*/Tests/RunCMake/find_program/Win/testCom.com'
|
|
@ -0,0 +1,6 @@
|
|||
find_program(PROG
|
||||
NAMES testCom
|
||||
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Win
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
message(STATUS "PROG='${PROG}'")
|
|
@ -0,0 +1 @@
|
|||
-- PROG='[^']*/Tests/RunCMake/find_program/Win/testExe.exe'
|
|
@ -0,0 +1,6 @@
|
|||
find_program(PROG
|
||||
NAMES testExe
|
||||
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Win
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
message(STATUS "PROG='${PROG}'")
|
Loading…
Reference in New Issue