r363199 - [test] Reinstate the assignment to the diagnostic log in the unittest

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 12 13:35:44 PDT 2019


Author: arphaman
Date: Wed Jun 12 13:35:44 2019
New Revision: 363199

URL: http://llvm.org/viewvc/llvm-project?rev=363199&view=rev
Log:
[test] Reinstate the assignment to the diagnostic log in the unittest
from r363009

The diagnostic log is now set to "-" which forces it to use STDERR
instead of the filesystem. A new comment is added to explain why
the assignment is needed in the test.

Modified:
    cfe/trunk/unittests/Frontend/CompilerInstanceTest.cpp

Modified: cfe/trunk/unittests/Frontend/CompilerInstanceTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Frontend/CompilerInstanceTest.cpp?rev=363199&r1=363198&r2=363199&view=diff
==============================================================================
--- cfe/trunk/unittests/Frontend/CompilerInstanceTest.cpp (original)
+++ cfe/trunk/unittests/Frontend/CompilerInstanceTest.cpp Wed Jun 12 13:35:44 2019
@@ -73,6 +73,10 @@ TEST(CompilerInstance, DefaultVFSOverlay
 
 TEST(CompilerInstance, AllowDiagnosticLogWithUnownedDiagnosticConsumer) {
   auto DiagOpts = new DiagnosticOptions();
+  // Tell the diagnostics engine to emit the diagnostic log to STDERR. This
+  // ensures that a chained diagnostic consumer is created so that the test can
+  // exercise the unowned diagnostic consumer in a chained consumer.
+  DiagOpts->DiagnosticLogFile = "-";
 
   // Create the diagnostic engine with unowned consumer.
   std::string DiagnosticOutput;




More information about the cfe-commits mailing list