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:
Brad King 2015-09-01 16:33:24 -04:00
parent 907a919be1
commit fdbfc9f677
14 changed files with 35 additions and 0 deletions

View File

@ -183,6 +183,7 @@ add_RunCMake_test(find_file)
add_RunCMake_test(find_library) add_RunCMake_test(find_library)
add_RunCMake_test(find_package) add_RunCMake_test(find_package)
add_RunCMake_test(find_path) 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_filename_component)
add_RunCMake_test(get_property) add_RunCMake_test(get_property)
add_RunCMake_test(if) add_RunCMake_test(if)

View File

@ -0,0 +1 @@
#!/bin/sh

View File

@ -0,0 +1 @@
#!/bin/sh

View File

@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)

View File

@ -0,0 +1 @@
-- PROG='[^']*/Tests/RunCMake/find_program/B/testB'

View File

@ -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}'")

View File

@ -0,0 +1,8 @@
include(RunCMake)
run_cmake(DirsPerName)
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
run_cmake(WindowsCom)
run_cmake(WindowsExe)
endif()

View File

View File

View File

View File

@ -0,0 +1 @@
-- PROG='[^']*/Tests/RunCMake/find_program/Win/testCom.com'

View File

@ -0,0 +1,6 @@
find_program(PROG
NAMES testCom
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Win
NO_DEFAULT_PATH
)
message(STATUS "PROG='${PROG}'")

View File

@ -0,0 +1 @@
-- PROG='[^']*/Tests/RunCMake/find_program/Win/testExe.exe'

View File

@ -0,0 +1,6 @@
find_program(PROG
NAMES testExe
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Win
NO_DEFAULT_PATH
)
message(STATUS "PROG='${PROG}'")