summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/render-test/options.cpp6
-rw-r--r--tools/slang-test/options.cpp14
-rw-r--r--tools/slang-test/options.h3
-rw-r--r--tools/slang-test/slang-test-main.cpp5
-rw-r--r--tools/slang-test/test-context.cpp6
-rw-r--r--tools/test-server/test-server-main.cpp12
6 files changed, 46 insertions, 0 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index 0ecda6944..69556b0e6 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -278,6 +278,12 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType)
{
outOptions.showAdapterInfo = true;
}
+ else if (argValue == "-ignore-abort-msg")
+ {
+#ifdef _MSC_VER
+ _set_abort_behavior(0, _WRITE_ABORT_MSG);
+#endif
+ }
else if (argValue == "-cache-rhi-device")
{
outOptions.cacheRhiDevice = true;
diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp
index 7a98caec6..1333407d1 100644
--- a/tools/slang-test/options.cpp
+++ b/tools/slang-test/options.cpp
@@ -90,6 +90,13 @@ static bool _isSubCommand(const char* arg)
" -use-test-server Run tests using test server\n"
" -use-fully-isolated-test-server Run each test in isolated server\n"
" -capability <name> Compile with the given capability\n"
+
+ // Recent Windows runtime versions started opening a dialog popup window when
+ // `abort()` is called, which breaks the CI workflow and some scripts that
+ // expect a normal termination.
+ // It can be helpful for debugging but we should ignore it for CI.
+ " -ignore-abort-msg Ignore abort message dialog popup on Windows\n"
+
" -enable-debug-layers [true|false] Enable or disable Validation Layer for Vulkan\n"
" and Debug Device for DX\n"
" -cache-rhi-device [true|false] Enable or disable RHI device caching (default: true)\n"
@@ -433,6 +440,13 @@ static bool _isSubCommand(const char* arg)
}
optionsOut->capabilities.add(*argCursor++);
}
+ else if (strcmp(arg, "-ignore-abort-msg") == 0)
+ {
+ optionsOut->ignoreAbortMsg = true;
+#ifdef _MSC_VER
+ _set_abort_behavior(0, _WRITE_ABORT_MSG);
+#endif
+ }
else if (strcmp(arg, "-expected-failure-list") == 0)
{
if (argCursor == argEnd)
diff --git a/tools/slang-test/options.h b/tools/slang-test/options.h
index 9223b2eaf..17ff666c3 100644
--- a/tools/slang-test/options.h
+++ b/tools/slang-test/options.h
@@ -142,6 +142,9 @@ struct Options
Slang::HashSet<Slang::String> capabilities;
Slang::HashSet<Slang::String> expectedFailureList;
+ // Ignore abort message dialog popup on Windows
+ bool ignoreAbortMsg = false;
+
/// Parse the args, report any errors into stdError, and write the results into optionsOut
static SlangResult parse(
int argc,
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 08019f995..04283e170 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -3644,6 +3644,11 @@ static void _addRenderTestOptions(const Options& options, CommandLine& ioCmdLine
ioCmdLine.addArg("-enable-debug-layers");
}
+ if (options.ignoreAbortMsg)
+ {
+ ioCmdLine.addArg("-ignore-abort-msg");
+ }
+
if (options.cacheRhiDevice)
{
ioCmdLine.addArg("-cache-rhi-device");
diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp
index e3655e61d..a864cb326 100644
--- a/tools/slang-test/test-context.cpp
+++ b/tools/slang-test/test-context.cpp
@@ -196,6 +196,12 @@ SlangResult TestContext::_createJSONRPCConnection(RefPtr<JSONRPCConnection>& out
{
CommandLine cmdLine;
cmdLine.setExecutableLocation(ExecutableLocation(exeDirectoryPath, "test-server"));
+
+ if (options.ignoreAbortMsg)
+ {
+ cmdLine.addArg("-ignore-abort-msg");
+ }
+
SLANG_RETURN_ON_FAIL(Process::create(
cmdLine,
Process::Flag::AttachDebugger | Process::Flag::DisableStdErrRedirection,
diff --git a/tools/test-server/test-server-main.cpp b/tools/test-server/test-server-main.cpp
index e98be6e5a..4ce9377f5 100644
--- a/tools/test-server/test-server-main.cpp
+++ b/tools/test-server/test-server-main.cpp
@@ -191,6 +191,18 @@ SlangResult TestServer::init(int argc, const char* const* argv)
{
m_exePath = argv[0];
+ // Command-line argument parsing
+ for (int i = 1; i < argc; i++)
+ {
+ if (strcmp(argv[i], "-ignore-abort-msg") == 0)
+ {
+#ifdef _MSC_VER
+ _set_abort_behavior(0, _WRITE_ABORT_MSG);
+#endif
+ }
+ // Ignore unknown arguments for now
+ }
+
String canonicalPath;
if (SLANG_SUCCEEDED(Path::getCanonical(m_exePath, canonicalPath)))
{