================
@@ -1361,6 +1361,16 @@ int endPreamble;
                   Source.range("inactive3"), Source.range("inactive4"))));
 }
 
+TEST(ClangdServer, BackgroundIndexPriorityPropagatesToIndexingThreads) {
+  auto Opts = ClangdServer::optsForTest();
+  for (auto Priority :
+       {llvm::ThreadPriority::Background, llvm::ThreadPriority::Low,
+        llvm::ThreadPriority::Default}) {
+    Opts.BackgroundIndexPriority = Priority;
+    EXPECT_EQ(BackgroundIndex::Options(Opts).IndexingPriority, Priority);
+  }
+}
----------------
ArcsinX wrote:

This test verifies that the newly introduced operator correctly sets the 
`IndexingPriority` field, but it does not verify that the original issue (where 
`BackgroundIndexPriority` was not being passed to the `BackgroundIndex` 
options) has actually been fixed.
Ideally, the test should look something like this: a `ClangdServer` object is 
created, and then we verify that the `BackgroundIndex` has actually got correct 
`IndexingPriority` based on `BackgroundIndexPriority` value.
I am not sure if the current interfaces allow to this check, but the test as it 
stands for now does not seem to be related to `ClangdServer` at all.

https://github.com/llvm/llvm-project/pull/212700
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to