use of com.google.idea.blaze.base.ideinfo.TargetMap in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method testSingleSourceTargetWithLibraryDependencies.
@Test
public void testSingleSourceTargetWithLibraryDependencies() {
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"))).addDependency("//bar/baz:library").addDependency("//third_party:library")).addTarget(createCcTarget("//bar/baz:library", Kind.CC_LIBRARY, ImmutableList.of(src("bar/baz/library.cc")))).addTarget(createCcTarget("//third_party:library", Kind.CC_LIBRARY, ImmutableList.of(src("third_party/library.cc")))).build();
assertThatResolving(projectView, targetMap).producesConfigurationsFor("//foo/bar:binary");
}
use of com.google.idea.blaze.base.ideinfo.TargetMap in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method firstResolve_testNotIncremental.
@Test
public void firstResolve_testNotIncremental() {
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();
ImmutableList<BlazeResolveConfiguration> noReusedConfigurations = ImmutableList.of();
assertThatResolving(projectView, targetMap).reusedConfigurations(noReusedConfigurations, "//foo/bar:binary");
}
use of com.google.idea.blaze.base.ideinfo.TargetMap 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.ideinfo.TargetMap 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.ideinfo.TargetMap 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();
}
Aggregations