-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
scala_test_jvm_flags
to toolchain (#804)
* Add scala_test_jvm_flags to the toolchain * Fix package name * Fix target names * Add trivial test suite and rename some things * Wrap all jvm_flags in _expand_location
- Loading branch information
1 parent
17892bf
commit ca655e5
Showing
6 changed files
with
105 additions
and
10 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
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
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
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,43 @@ | ||
load("//scala:scala_toolchain.bzl", "scala_toolchain") | ||
load("//scala:scala.bzl", "scala_test") | ||
|
||
scala_toolchain( | ||
name = "failing_toolchain_impl", | ||
# This will fail because 1M isn't enough | ||
scala_test_jvm_flags = ["-Xmx1M"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_toolchain( | ||
name = "passing_toolchain_impl", | ||
# This will pass because 1G is enough | ||
scala_test_jvm_flags = ["-Xmx1G"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "failing_scala_toolchain", | ||
toolchain = "failing_toolchain_impl", | ||
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "passing_scala_toolchain", | ||
toolchain = "passing_toolchain_impl", | ||
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_test( | ||
name = "empty_test", | ||
srcs = ["EmptyTest.scala"], | ||
) | ||
|
||
scala_test( | ||
name = "empty_overriding_test", | ||
srcs = ["EmptyTest.scala"], | ||
# This overrides the option passed in on the toolchain, and should BUILD, even if | ||
# the `failing_scala_toolchain` is used. | ||
jvm_flags = ["-Xmx1G"], | ||
) |
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,9 @@ | ||
package test_expect_failure.scala_test_jvm_flags | ||
|
||
import org.scalatest.FunSuite | ||
|
||
class EmptyTest extends FunSuite { | ||
test("empty test") { | ||
assert(true) | ||
} | ||
} |
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