-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0895f3a
commit 9bb64f0
Showing
4 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Test for java_library rules using src_dir | ||
java_library( | ||
name = 'src_dir_lib', | ||
src_dir = 'src', | ||
) | ||
|
||
java_test( | ||
name = 'src_dir_test', | ||
srcs = ['test/build/please/java/test/SrcDirTest.java'], | ||
deps = [ | ||
':src_dir_lib', | ||
'//third_party/java:junit', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package build.please.java.test; | ||
|
||
public class SrcDirLib { | ||
public static int WhatDoYouGetWhenYouMultiply(int a, int b) { | ||
return a == 6 && b == 9 ? 42 : a * b; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/java_rules/test/build/please/java/test/SrcDirTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package build.please.java.test; | ||
|
||
import org.junit.Test; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
public class SrcDirTest { | ||
@Test | ||
public void TestTheAnswer() { | ||
assertEquals(42, SrcDirLib.WhatDoYouGetWhenYouMultiply(6, 9)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters