diff options
author | philwo <philwo@google.com> | 2017-06-06 05:12:51 -0400 |
---|---|---|
committer | John Cater <jcater@google.com> | 2017-06-06 09:50:54 -0400 |
commit | a2194e580c4c6a0325a0531d8ef170f78dd6f415 (patch) | |
tree | 443e56310dfa67521a56c9f61f4840b4dd1a4ca3 /examples/java-native/src/test/java/com/example/myproject/BUILD | |
parent | 7e7d94efbfecfea43ab32d62bf6770875947b77e (diff) |
Add an example that shows how to use the cpu:<num> tag for tests.
Also serves as an example for bug #3106.
PiperOrigin-RevId: 158116940
Diffstat (limited to 'examples/java-native/src/test/java/com/example/myproject/BUILD')
-rw-r--r-- | examples/java-native/src/test/java/com/example/myproject/BUILD | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/java-native/src/test/java/com/example/myproject/BUILD b/examples/java-native/src/test/java/com/example/myproject/BUILD index c804f9fe60..72066b3f0a 100644 --- a/examples/java-native/src/test/java/com/example/myproject/BUILD +++ b/examples/java-native/src/test/java/com/example/myproject/BUILD @@ -35,6 +35,40 @@ java_test( deps = ["//third_party:junit4"], ) +# This exercises the "cpu:<num>" tag. +# +# Expected behavior: +# test0 and test1 run together then one of the other two alone, and then the remaining one alone. +java_test( + name = "sleep0", + srcs = ["TestSleep.java"], + test_class = "com.example.myproject.TestSleep", + deps = ["//third_party:junit4"], +) + +java_test( + name = "sleep1", + srcs = ["TestSleep.java"], + test_class = "com.example.myproject.TestSleep", + deps = ["//third_party:junit4"], +) + +java_test( + name = "sleep2", + srcs = ["TestSleep.java"], + tags = ["cpu:20000"], + test_class = "com.example.myproject.TestSleep", + deps = ["//third_party:junit4"], +) + +java_test( + name = "sleep3", + srcs = ["TestSleep.java"], + tags = ["cpu:20000"], + test_class = "com.example.myproject.TestSleep", + deps = ["//third_party:junit4"], +) + # This attempts to run TestCustomGreeting.java without any resources, so fails. java_test( name = "resource-fail", |