Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2925,8 +2925,9 @@ if(BUILD_TESTING)
set(CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND")
endif()
set_tests_properties(CTestTestBadExe PROPERTIES
PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}")

PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}"
TIMEOUT 30)

# CI tooling such as CodeQL may inject libraries via LD_PRELOAD that alter
# process execution error reporting, preventing the BAD_COMMAND string from
# appearing in the output. Clear LD_PRELOAD for this test so that the
Expand Down
7 changes: 5 additions & 2 deletions Tests/CTestTestBadExe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.10)
project(CTestTestBadExe)
include(CTest)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe.txt" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt" COPYONLY)
# Use a file without an extension to avoid Windows file associations
# (e.g. .txt -> Notepad) which can cause the test to hang instead of
# reporting BAD_COMMAND.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe" COPYONLY)

add_test (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt")
add_test (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe")
File renamed without changes.