Adds some protected accessors to MemoizingEvaluatorTest.
@@ -35,6 +35,7 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import com.google.common.eventbus.EventBus;
import com.google.common.testing.GcFinalization;
+import com.google.common.truth.IterableSubject;
import com.google.common.util.concurrent.Uninterruptibles;
import com.google.devtools.build.lib.events.DelegatingEventHandler;
import com.google.devtools.build.lib.events.Event;
@@ -78,7 +79,7 @@ import org.junit.runners.JUnit4;
public class MemoizingEvaluatorTest {
protected MemoizingEvaluatorTester tester;
- private EventCollector eventCollector;
+ protected EventCollector eventCollector;
private ExtendedEventHandler reporter;
protected MemoizingEvaluator.EmittedEventState emittedEventState;
@@ -148,7 +149,7 @@ public class MemoizingEvaluatorTest {
return true;
}
- private void initializeReporter() {
+ protected void initializeReporter() {
eventCollector = new EventCollector();
reporter = new Reporter(new EventBus(), eventCollector);
tester.resetPlayedEvents();
@@ -1367,9 +1368,12 @@ public class MemoizingEvaluatorTest {
assertThatErrorInfo(errorInfo).hasCycleInfoThat().hasSize(1);
}
// But the parent itself shouldn't have a direct dep on the special error transience node.
- assertThatEvaluationResult(evalResult)
- .hasDirectDepsInGraphThat(top)
- .doesNotContain(ErrorTransienceValue.KEY);
+ verifyParentDepsForParentOfCycleAndError(
+ assertThatEvaluationResult(evalResult).hasDirectDepsInGraphThat(top));
+ }
+
+ protected void verifyParentDepsForParentOfCycleAndError(IterableSubject parentDeps) {
+ parentDeps.doesNotContain(ErrorTransienceValue.KEY);
}
@Test
