aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
diff options
context:
space:
mode:
authorGravatar Dmitry Lomov <dslomov@google.com>2016-02-11 14:37:37 +0000
committerGravatar David Chen <dzc@google.com>2016-02-11 22:21:09 +0000
commitb98cfefda6906f68dfc60e94bdf5b6d6435530f9 (patch)
treed1a71ae2dab898b5f39b1ff99caa02a9989ad501 /src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
parent1aca9bf2b5b50f114b310dad374c82e6e61cef74 (diff)
Expose Java annotation processing information to Skylark.
Also added some features to Skylark aspect. -- MOS_MIGRATED_REVID=114431594
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java49
1 files changed, 21 insertions, 28 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
index 158344d10b..ea51474b4b 100644
--- a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
+++ b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java
@@ -32,8 +32,8 @@ import com.google.devtools.build.lib.ideinfo.androidstudio.AndroidStudioIdeInfo.
import com.google.devtools.build.lib.ideinfo.androidstudio.AndroidStudioIdeInfo.RuleIdeInfo.Kind;
import com.google.devtools.build.lib.skyframe.AspectValue;
import com.google.devtools.build.lib.vfs.Path;
-
import com.google.protobuf.TextFormat;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -785,10 +785,6 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase
@Test
public void testJavaLibraryWithoutGeneratedSourcesHasNoGenJars() throws Exception {
- if (!isNativeTest()) {
- return;
- }
-
scratch.file(
"java/com/google/example/BUILD",
"java_library(",
@@ -806,10 +802,6 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase
@Test
public void testJavaLibraryWithGeneratedSourcesHasGenJars() throws Exception {
- if (!isNativeTest()) {
- return;
- }
-
scratch.file(
"java/com/google/example/BUILD",
"java_library(",
@@ -912,10 +904,6 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase
@Test
public void testSourceFilesAreCorrectlyMarkedAsSourceOrGenerated() throws Exception {
- if (!isNativeTest()) {
- return;
- }
-
scratch.file(
"com/google/example/BUILD",
"genrule(",
@@ -929,25 +917,30 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase
")");
Map<String, RuleIdeInfo> ruleIdeInfos = buildRuleIdeInfo("//com/google/example:lib");
RuleIdeInfo ruleIdeInfo = getRuleInfoAndVerifyLabel("//com/google/example:lib", ruleIdeInfos);
- assertThat(ruleIdeInfo.getJavaRuleIdeInfo().getSourcesList()).containsExactly(
- ArtifactLocation.newBuilder()
- .setRootPath(targetConfig.getGenfilesDirectory().getPath().getPathString())
- .setRelativePath("com/google/example/gen.java")
- .setIsSource(false)
- .build(),
- ArtifactLocation.newBuilder()
- .setRootPath(directories.getWorkspace().getPathString())
- .setRelativePath("com/google/example/Test.java")
- .setIsSource(true)
- .build());
+ assertThat(ruleIdeInfo.getJavaRuleIdeInfo().getSourcesList())
+ .containsExactly(
+ expectedArtifactLocationWithRootPath(
+ targetConfig.getGenfilesDirectory().getPath().getPathString())
+ .setRelativePath("com/google/example/gen.java")
+ .setIsSource(false)
+ .build(),
+ expectedArtifactLocationWithRootPath(directories.getWorkspace().getPathString())
+ .setRelativePath("com/google/example/Test.java")
+ .setIsSource(true)
+ .build());
}
- @Test
- public void testAspectIsPropagatedAcrossRuntimeDeps() throws Exception {
- if (!isNativeTest()) {
- return;
+ private ArtifactLocation.Builder expectedArtifactLocationWithRootPath(String pathString) {
+ if (isNativeTest()) {
+ return ArtifactLocation.newBuilder().setRootPath(pathString);
+ } else {
+ // todo(dslomov): Skylark aspect implementation does not yet return a correct root path.
+ return ArtifactLocation.newBuilder();
}
+ }
+ @Test
+ public void testAspectIsPropagatedAcrossRuntimeDeps() throws Exception {
scratch.file(
"com/google/example/BUILD",
"java_library(",