-
-
Notifications
You must be signed in to change notification settings - Fork 286
Specs2 toolchain #1136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Specs2 toolchain #1136
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ee7a6da
Update testing docs, toolchain and repository loading
liucijus 05d6b3b
Add testing toolchain to version tests WORKSPACE
liucijus 181ca23
specs2 and specs2 junit toolchain deps
liucijus a7d6005
Use external name in toolchain helpers
liucijus 550e5c0
Update and add specs2 docs and examples
liucijus 66f188b
Docs update
liucijus 445df2e
Remove duplicate toolchain registration
liucijus 14f3d6c
Move example workspace tests to a separete Travis CI job
liucijus 638da03
Fix typo in docs
liucijus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Empty file.
This file contains hidden or 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,35 @@ | ||
workspace(name = "specs2_junit_repositories") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
skylib_version = "1.0.3" | ||
|
||
http_archive( | ||
name = "bazel_skylib", | ||
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", | ||
type = "tar.gz", | ||
url = "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib-{}.tar.gz".format(skylib_version, skylib_version), | ||
) | ||
|
||
local_repository( | ||
name = "io_bazel_rules_scala", | ||
path = "../../..", | ||
) | ||
|
||
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config") | ||
|
||
scala_config() | ||
|
||
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories") | ||
|
||
scala_repositories() | ||
|
||
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") | ||
|
||
scala_register_toolchains() | ||
|
||
load("@io_bazel_rules_scala//testing:specs2_junit.bzl", "specs2_junit_repositories", "specs2_junit_toolchain") | ||
|
||
specs2_junit_repositories() | ||
|
||
specs2_junit_toolchain() |
This file contains hidden or 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 @@ | ||
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_specs2_junit_test") | ||
|
||
scala_specs2_junit_test( | ||
name = "example", | ||
srcs = ["Specs2ExampleTest.scala"], | ||
suffixes = ["Test"], | ||
) |
9 changes: 9 additions & 0 deletions
9
examples/testing/specs2_junit_repositories/example/Specs2ExampleTest.scala
This file contains hidden or 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 example | ||
|
||
import org.specs2.mutable.SpecWithJUnit | ||
|
||
class Specs2ExampleTest extends SpecWithJUnit { | ||
"works" in { | ||
1 mustEqual 1 | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
test_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/test/shell | ||
|
||
. "${test_dir}"/test_examples.sh |
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
load("//specs2:specs2_junit.bzl", _repositories = "specs2_junit_repositories") | ||
|
||
def specs2_junit_repositories(): | ||
_repositories() | ||
|
||
def specs2_junit_toolchain(): | ||
native.register_toolchains("@io_bazel_rules_scala//testing:specs2_junit_toolchain") |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all other deps are in form
//external:io_bazel_rules_scala/dependency/...
and these are not?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes from the existing code: https://github.com/bazelbuild/rules_scala/blob/master/specs2/BUILD#L9
It's binded later in https://github.com/bazelbuild/rules_scala/blob/master/specs2/specs2.bzl#L26
Existing binds are subject to be removed later. Currently the goal is to give a way to not use binds.