summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Johnston <johnstonj.public@codenest.com>2015-08-05 04:30:58 (GMT)
committerJames Johnston <johnstonj.public@codenest.com>2015-08-06 17:53:25 (GMT)
commit38ed5866ed212effe0217f193f728ee54ea7378b (patch)
tree3e424defdc93f35db9d2902a091ee93c5f743704
parent772ca69f803a8f294d6e04f9e258becc35179233 (diff)
downloadCMake-38ed5866ed212effe0217f193f728ee54ea7378b.zip
CMake-38ed5866ed212effe0217f193f728ee54ea7378b.tar.gz
CMake-38ed5866ed212effe0217f193f728ee54ea7378b.tar.bz2
get_filename_component: Added initial tests for PROGRAM component.
The RunCMake.get_filename_component test now tests basic functionality of the PROGRAM component argument of get_filename_component. Signed-off-by: James Johnston <johnstonj.public@codenest.com>
-rw-r--r--Tests/RunCMake/get_filename_component/KnownComponents.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
index 3f20e1a..1532792 100644
--- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake
+++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
@@ -38,6 +38,18 @@ check("ABSOLUTE .. in windows root" "${test_absolute}" "c:/path/to/filename.ext.
list(APPEND non_cache_vars test_absolute)
+# Test the PROGRAM component type.
+get_filename_component(test_program_name "/ arg1 arg2" PROGRAM)
+check("PROGRAM with no args output" "${test_program_name}" "/")
+
+get_filename_component(test_program_name "/ arg1 arg2" PROGRAM
+ PROGRAM_ARGS test_program_args)
+check("PROGRAM with args output: name" "${test_program_name}" "/")
+check("PROGRAM with args output: args" "${test_program_args}" " arg1 arg2")
+
+list(APPEND non_cache_vars test_program_name)
+list(APPEND non_cache_vars test_program_args)
+
# Test CACHE parameter for most component types.
get_filename_component(test_cache "/path/to/filename.ext.in" DIRECTORY CACHE)
check("CACHE 1" "${test_cache}" "/path/to")