summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_program
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-14 18:49:49 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-15 12:53:06 (GMT)
commit7a6e5f06e7a32c894313b3a07c3d3c9abad8d2ca (patch)
tree773f4f7da0be89db15a4d76a451d06ae1e4d713e /Tests/RunCMake/find_program
parent401229759c2a738b085b3337babdded645415664 (diff)
downloadCMake-7a6e5f06e7a32c894313b3a07c3d3c9abad8d2ca.zip
CMake-7a6e5f06e7a32c894313b3a07c3d3c9abad8d2ca.tar.gz
CMake-7a6e5f06e7a32c894313b3a07c3d3c9abad8d2ca.tar.bz2
Tests: Cover find_program when the environment duplicate some HINTS
Reported-by: Marc CHEVRIER <marc.chevrier@sap.com>
Diffstat (limited to 'Tests/RunCMake/find_program')
-rwxr-xr-xTests/RunCMake/find_program/A/testAandB1
-rwxr-xr-xTests/RunCMake/find_program/B/testAandB1
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints.cmake8
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake1
5 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_program/A/testAandB b/Tests/RunCMake/find_program/A/testAandB
new file mode 100755
index 0000000..1a24852
--- /dev/null
+++ b/Tests/RunCMake/find_program/A/testAandB
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/Tests/RunCMake/find_program/B/testAandB b/Tests/RunCMake/find_program/B/testAandB
new file mode 100755
index 0000000..1a24852
--- /dev/null
+++ b/Tests/RunCMake/find_program/B/testAandB
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/Tests/RunCMake/find_program/EnvAndHints-stdout.txt b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt
new file mode 100644
index 0000000..39329b2
--- /dev/null
+++ b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt
@@ -0,0 +1 @@
+-- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB'
diff --git a/Tests/RunCMake/find_program/EnvAndHints.cmake b/Tests/RunCMake/find_program/EnvAndHints.cmake
new file mode 100644
index 0000000..14ebd6e
--- /dev/null
+++ b/Tests/RunCMake/find_program/EnvAndHints.cmake
@@ -0,0 +1,8 @@
+set(ENV_PATH "$ENV{PATH}")
+set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A)
+find_program(PROG
+ NAMES testAandB
+ HINTS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
+ )
+message(STATUS "PROG='${PROG}'")
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index 2adec11..89307c1 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(EnvAndHints)
run_cmake(DirsPerName)
run_cmake(NamesPerDir)