From 3e41d698714a3ab6235e9275d5e0687a1c5db9c9 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 16 Aug 2023 19:01:39 -0700 Subject: Run vk tests on spirv backend with expected failure list. (#3128) --- source/core/slang-process-util.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source/core/slang-process-util.cpp') 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& 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& 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; } -- cgit v1.2.3