Pārlūkot izejas kodu

Tests: Fix RunCMake.CTestCommandLine case when no python is found

Do not try to run the python checks if the python executable is
not available.
Brad King 7 gadi atpakaļ
vecāks
revīzija
62fec84ad7
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake

+ 3 - 0
Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake

@@ -175,6 +175,9 @@ endfunction()
 run_TestStdin()
 
 function(show_only_json_check_python v)
+  if(RunCMake_TEST_FAILED OR NOT PYTHON_EXECUTABLE)
+    return()
+  endif()
   set(json_file "${RunCMake_TEST_BINARY_DIR}/ctest.json")
   file(WRITE "${json_file}" "${actual_stdout}")
   set(actual_stdout "" PARENT_SCOPE)