llvm-reduce: Color output of child processes
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 11 Oct 2022 01:03:46 +0000 (18:03 -0700)
committerMatt Arsenault <arsenm2@gmail.com>
Thu, 13 Oct 2022 01:00:46 +0000 (18:00 -0700)
When reducing llvm-reduce with llvm-reduce, it can be confusing
to figure out what lines are printed by the child or parent. Not
sure this is the most reliable way to set and restore this.

llvm/tools/llvm-reduce/TestRunner.cpp

index 63de850..5681a81 100644 (file)
@@ -39,9 +39,13 @@ int TestRunner::run(StringRef Filename) {
     for (int i = 0; i < 3; ++i)
       Redirects.push_back(Empty);
   }
+
+  outs().changeColor(raw_ostream::YELLOW);
+
   int Result =
       sys::ExecuteAndWait(TestName, ProgramArgs, /*Env=*/None, Redirects,
                           /*SecondsToWait=*/0, /*MemoryLimit=*/0, &ErrMsg);
+  outs().resetColor();
 
   if (Result < 0) {
     Error E = make_error<StringError>("Error running interesting-ness test: " +