From 2cc7baa1bc7f9e37b1a19d6700c64890142030d8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 7 Apr 2020 10:14:58 -0400 Subject: Tests: Fix get_filename_component PROGRAM test to use an executable --- Tests/RunCMake/get_filename_component/KnownComponents.cmake | 8 ++++---- Tests/RunCMake/get_filename_component/KnownComponents.sh | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100755 Tests/RunCMake/get_filename_component/KnownComponents.sh diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake index 54b858f..c2762ad 100644 --- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake +++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake @@ -85,12 +85,12 @@ check("PROGRAM with args output: args" "${test_program_args}" " arg1 arg2") get_filename_component(test_program_name " " PROGRAM) check("PROGRAM with just a space" "${test_program_name}" "") -get_filename_component(test_program_name "${CMAKE_CURRENT_LIST_FILE}" PROGRAM) -check("PROGRAM specified explicitly without quoting" "${test_program_name}" "${CMAKE_CURRENT_LIST_FILE}") +get_filename_component(test_program_name "${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh" PROGRAM) +check("PROGRAM specified explicitly without quoting" "${test_program_name}" "${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh") -get_filename_component(test_program_name "\"${CMAKE_CURRENT_LIST_FILE}\" arg1 arg2" PROGRAM +get_filename_component(test_program_name "\"${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh\" arg1 arg2" PROGRAM PROGRAM_ARGS test_program_args) -check("PROGRAM specified explicitly with arguments: name" "${test_program_name}" "${CMAKE_CURRENT_LIST_FILE}") +check("PROGRAM specified explicitly with arguments: name" "${test_program_name}" "${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh") check("PROGRAM specified explicitly with arguments: args" "${test_program_args}" " arg1 arg2") list(APPEND non_cache_vars test_program_name) diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.sh b/Tests/RunCMake/get_filename_component/KnownComponents.sh new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/KnownComponents.sh @@ -0,0 +1 @@ +#!/bin/sh -- cgit v0.12