Skip to content

Commit 925da08

Browse files
committed
[sourcekitd-test] Flush stdout and stderr before executing a shell command
Otherwise the order of sourcekitd-test’s output and the shell command is undefined.
1 parent 43fc897 commit 925da08

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/SourceKit/tools/sourcekitd-test/sourcekitd-test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ static int handleJsonRequestPath(StringRef QueryPath, const TestOptions &Opts) {
461461
}
462462

463463
static int performShellExecution(ArrayRef<const char *> Args) {
464+
llvm::outs().flush();
465+
llvm::errs().flush();
464466
auto Program = llvm::sys::findProgramByName(Args[0]);
465467
if (std::error_code ec = Program.getError()) {
466468
llvm::errs() << "command not found: " << Args[0] << "\n";

0 commit comments

Comments
 (0)