use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method identicalTargets_testIncrementalUpdateFullReuse.
@Test
public void identicalTargets_testIncrementalUpdateFullReuse() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:binary"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc")))).build();
assertThatResolving(projectView, targetMap).producesConfigurationsFor("//foo/bar:binary");
Collection<BlazeResolveConfiguration> initialConfigurations = resolverResult.getAllConfigurations();
assertThatResolving(projectView, targetMap).reusedConfigurations(initialConfigurations);
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method newTarget_testIncrementalUpdatePartlyReused.
@Test
public void newTarget_testIncrementalUpdatePartlyReused() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:*"));
TargetMapBuilder targetMapBuilder = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc"))));
assertThatResolving(projectView, targetMapBuilder.build()).producesConfigurationsFor("//foo/bar:binary");
Collection<BlazeResolveConfiguration> initialConfigurations = resolverResult.getAllConfigurations();
targetMapBuilder.addTarget(createCcTarget("//foo/bar:library", Kind.CC_LIBRARY, ImmutableList.of(src("foo/bar/library.cc")), ImmutableList.of("OTHER=1")));
assertThatResolving(projectView, targetMapBuilder.build()).reusedConfigurations(initialConfigurations, "//foo/bar:library");
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method brokenCompiler_collectsIssues.
@Test
public void brokenCompiler_collectsIssues() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:*"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc")))).build();
createVirtualFile("/root/foo/bar/binary.cc");
compilerVersionChecker.setInjectFault(true);
computeResolverResult(projectView, targetMap);
errorCollector.assertIssueContaining("Unable to determine version of compiler");
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method testTargetWithoutSources.
@Test
public void testTargetWithoutSources() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:library"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:library", Kind.CC_LIBRARY, ImmutableList.of())).build();
assertThatResolving(projectView, targetMap).producesNoConfigurations();
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method completelyDifferentTargetsSameProjectView_testIncrementalUpdateNoReuse.
@Test
public void completelyDifferentTargetsSameProjectView_testIncrementalUpdateNoReuse() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:*"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc")))).build();
ImmutableList<BlazeResolveConfiguration> noReusedConfigurations = ImmutableList.of();
assertThatResolving(projectView, targetMap).reusedConfigurations(noReusedConfigurations, "//foo/bar:binary");
TargetMap targetMap2 = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:library", Kind.CC_LIBRARY, ImmutableList.of(src("foo/bar/library.cc")), ImmutableList.of("OTHER=1"))).build();
assertThatResolving(projectView, targetMap2).reusedConfigurations(noReusedConfigurations, "//foo/bar:library");
}
Aggregations