Search in sources :

Example 16 with TargetGraphAndBuildTargets

use of com.facebook.buck.rules.TargetGraphAndBuildTargets in project buck by facebook.

the class VersionedTargetGraphCacheTest method testHit.

@Test
public void testHit() throws Exception {
    VersionedTargetGraphCache cache = new VersionedTargetGraphCache();
    TargetGraphAndBuildTargets graph = createSimpleGraph();
    VersionedTargetGraphCacheResult firstResult = cache.getVersionedTargetGraph(BUS, graph, ImmutableMap.of(), POOL);
    assertEmpty(firstResult);
    VersionedTargetGraphCacheResult secondResult = cache.getVersionedTargetGraph(BUS, graph, ImmutableMap.of(), POOL);
    assertHit(secondResult, firstResult.getTargetGraphAndBuildTargets());
}
Also used : TargetGraphAndBuildTargets(com.facebook.buck.rules.TargetGraphAndBuildTargets) Test(org.junit.Test)

Example 17 with TargetGraphAndBuildTargets

use of com.facebook.buck.rules.TargetGraphAndBuildTargets in project buck by facebook.

the class VersionedTargetGraphCacheTest method testPoolChangeCausesHit.

@Test
public void testPoolChangeCausesHit() throws Exception {
    VersionedTargetGraphCache cache = new VersionedTargetGraphCache();
    TargetGraphAndBuildTargets graph = createSimpleGraph();
    VersionedTargetGraphCacheResult firstResult = cache.getVersionedTargetGraph(BUS, graph, ImmutableMap.of(), POOL);
    assertEmpty(firstResult);
    VersionedTargetGraphCacheResult secondResult = cache.getVersionedTargetGraph(BUS, graph, ImmutableMap.of(), new ForkJoinPool(2));
    assertHit(secondResult, firstResult.getTargetGraphAndBuildTargets());
}
Also used : TargetGraphAndBuildTargets(com.facebook.buck.rules.TargetGraphAndBuildTargets) ForkJoinPool(java.util.concurrent.ForkJoinPool) Test(org.junit.Test)

Aggregations

TargetGraphAndBuildTargets (com.facebook.buck.rules.TargetGraphAndBuildTargets)17 Test (org.junit.Test)7 BuildTarget (com.facebook.buck.model.BuildTarget)5 BuildFileParseException (com.facebook.buck.json.BuildFileParseException)4 ParserConfig (com.facebook.buck.parser.ParserConfig)4 TargetNode (com.facebook.buck.rules.TargetNode)4 BuildTargetException (com.facebook.buck.model.BuildTargetException)3 ActionGraphAndResolver (com.facebook.buck.rules.ActionGraphAndResolver)3 TargetGraph (com.facebook.buck.rules.TargetGraph)3 VersionException (com.facebook.buck.versions.VersionException)3 Build (com.facebook.buck.command.Build)2 BuildEvent (com.facebook.buck.rules.BuildEvent)2 CachingBuildEngine (com.facebook.buck.rules.CachingBuildEngine)2 CachingBuildEngineBuckConfig (com.facebook.buck.rules.CachingBuildEngineBuckConfig)2 LocalCachingBuildEngineDelegate (com.facebook.buck.rules.LocalCachingBuildEngineDelegate)2 RuleKey (com.facebook.buck.rules.RuleKey)2 SourcePathResolver (com.facebook.buck.rules.SourcePathResolver)2 SourcePathRuleFinder (com.facebook.buck.rules.SourcePathRuleFinder)2 RuleKeyCacheRecycler (com.facebook.buck.rules.keys.RuleKeyCacheRecycler)2 RuleKeyFactoryManager (com.facebook.buck.rules.keys.RuleKeyFactoryManager)2