diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index c8ea3fc19f..52002cec61 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/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)