summaryrefslogtreecommitdiffstats
path: root/source/core/slang-process-util.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-16 19:01:39 -0700
committerGitHub <noreply@github.com>2023-08-16 19:01:39 -0700
commit3e41d698714a3ab6235e9275d5e0687a1c5db9c9 (patch)
tree019635f444cb2efb320b7541ca3f341fbf191978 /source/core/slang-process-util.cpp
parenteaeb7cf2913b884f9328433090242f8202e00699 (diff)
Run vk tests on spirv backend with expected failure list. (#3128)
Diffstat (limited to 'source/core/slang-process-util.cpp')
-rw-r--r--source/core/slang-process-util.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/core/slang-process-util.cpp b/source/core/slang-process-util.cpp
index ef22c0392..99c81ee5c 100644
--- a/source/core/slang-process-util.cpp
+++ b/source/core/slang-process-util.cpp
@@ -57,7 +57,8 @@ static String _getText(const ConstArrayView<Byte>& bytes)
const auto preCount = _getCount(outStdOut) + _getCount(outStdError);
SLANG_RETURN_ON_FAIL(StreamUtil::readOrDiscard(stdOutStream, 0, outStdOut));
- SLANG_RETURN_ON_FAIL(StreamUtil::readOrDiscard(stdErrorStream, 0, outStdError));
+ if (stdErrorStream)
+ SLANG_RETURN_ON_FAIL(StreamUtil::readOrDiscard(stdErrorStream, 0, outStdError));
const auto postCount = _getCount(outStdOut) + _getCount(outStdError);
@@ -69,9 +70,16 @@ static String _getText(const ConstArrayView<Byte>& bytes)
}
// Read anything remaining
- SLANG_RETURN_ON_FAIL(StreamUtil::readOrDiscardAll(stdOutStream, 0, outStdOut));
- SLANG_RETURN_ON_FAIL(StreamUtil::readOrDiscardAll(stdErrorStream, 0, outStdError));
-
+ for(;;)
+ {
+ const auto preCount = _getCount(outStdOut) + _getCount(outStdError);
+ StreamUtil::readOrDiscard(stdOutStream, 0, outStdOut);
+ if (stdErrorStream)
+ StreamUtil::readOrDiscard(stdErrorStream, 0, outStdError);
+ const auto postCount = _getCount(outStdOut) + _getCount(outStdError);
+ if (preCount == postCount)
+ break;
+ }
return SLANG_OK;
}