summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-26 19:08:02 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-27 14:50:43 (GMT)
commit10f906106e7d05cfe7f4c0ea871ad8462df2f89c (patch)
treee2c56f55be4106bbcddd85b4c9d33115bb94631d /Tests
parentc0247376c69bde5180c58052835f2a695578435c (diff)
downloadCMake-10f906106e7d05cfe7f4c0ea871ad8462df2f89c.zip
CMake-10f906106e7d05cfe7f4c0ea871ad8462df2f89c.tar.gz
CMake-10f906106e7d05cfe7f4c0ea871ad8462df2f89c.tar.bz2
Tests: Teach pseudo_emulator helper to pass by default
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake2
-rw-r--r--Tests/RunCMake/pseudo_emulator.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake
index af3712c..8cd5a02 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake
@@ -1,5 +1,7 @@
set(CMAKE_CROSSCOMPILING 1)
+set(ENV{PSEUDO_EMULATOR_FAIL} 1)
+
try_run(run_result compile_result
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/simple_src_exiterror.cxx
diff --git a/Tests/RunCMake/pseudo_emulator.c b/Tests/RunCMake/pseudo_emulator.c
index 15f64dc..cc921f0 100644
--- a/Tests/RunCMake/pseudo_emulator.c
+++ b/Tests/RunCMake/pseudo_emulator.c
@@ -1,8 +1,14 @@
+#ifndef _CRT_SECURE_NO_WARNINGS
+# define _CRT_SECURE_NO_WARNINGS
+#endif
+
#include <stdio.h>
+#include <stdlib.h>
int main(int argc, char* argv[])
{
int ii;
+ const char* fail = getenv("PSEUDO_EMULATOR_FAIL");
printf("Command:");
for (ii = 1; ii < argc; ++ii) {
@@ -10,5 +16,9 @@ int main(int argc, char* argv[])
}
printf("\n");
- return 42;
+ if (fail && *fail) {
+ return 42;
+ }
+
+ return 0;
}