From d0f395525fb4b28af52f5f0d253255e623302bd5 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Mon, 1 Jan 2024 11:58:22 +1100 Subject: Tests: Quote possibly empty string(REPLACE) argument The ${unity_source_line} variable should not normally be empty, but it has been observed that it sometimes is due to other factors. Rather than causing string(REPLACE) to fail due to the wrong number of arguments, quote the variable so that the UnityBuildPre2017 test case fails with a more appropriate error in the block just after the usage fixed by this change. --- Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake index 17e7b46..c904cd0 100644 --- a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake +++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake @@ -27,7 +27,7 @@ foreach(line IN LISTS tgt_projects_strings) endif() endforeach() -string(REPLACE "\\" "/" unity_source_line ${unity_source_line}) +string(REPLACE "\\" "/" unity_source_line "${unity_source_line}") string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0_c.c" unity_source_file_position) if (unity_source_file_position EQUAL "-1") set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.") -- cgit v0.12