Skip to content

Commit

Permalink
Adds some protected accessors to MemoizingEvaluatorTest.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 220018722
  • Loading branch information
aoeui authored and Copybara-Service committed Nov 4, 2018
1 parent f8be43c commit 7bf7f03
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
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;
Expand Down Expand Up @@ -78,7 +79,7 @@
public class MemoizingEvaluatorTest {

protected MemoizingEvaluatorTester tester;
private EventCollector eventCollector;
protected EventCollector eventCollector;
private ExtendedEventHandler reporter;
protected MemoizingEvaluator.EmittedEventState emittedEventState;

Expand Down Expand Up @@ -148,7 +149,7 @@ protected boolean preciseEvaluationStatusStored() {
return true;
}

private void initializeReporter() {
protected void initializeReporter() {
eventCollector = new EventCollector();
reporter = new Reporter(new EventBus(), eventCollector);
tester.resetPlayedEvents();
Expand Down Expand Up @@ -1367,9 +1368,12 @@ protected void parentOfCycleAndErrorInternal(
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
Expand Down

0 comments on commit 7bf7f03

Please sign in to comment.