]> granicus.if.org Git - clang/commitdiff
[test] Reinstate the assignment to the diagnostic log in the unittest
authorAlex Lorenz <arphaman@gmail.com>
Wed, 12 Jun 2019 20:35:44 +0000 (20:35 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 12 Jun 2019 20:35:44 +0000 (20:35 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363199 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Frontend/CompilerInstanceTest.cpp

index 3b3dc527df5c5b11ed47a43f9c8182a19ffbc184..4935853f1383d0396f6fbbbaf68c2db7f56effc5 100644 (file)
@@ -73,6 +73,10 @@ TEST(CompilerInstance, DefaultVFSOverlayFromInvocation) {
 
 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;