A set of bazel rules for BDD with cucumber/gherkin.
NOTE: This is alpha level software, the API may change without notice
Add the following to your WORKSPACE
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "rules_gherkin",
commit = "ef361f40f9716ad8a3c6a8a21111bb80d4cbd927", # Update this to match latest commit
remote = "https://github.com/silvergasp/rules_gherkin.git"
)
load("@rules_gherkin//:gherkin_deps.bzl","gherkin_deps")
gherkin_deps()
load("@rules_gherkin//:gherkin_workspace.bzl","gherkin_workspace")
gherkin_workspace()
Example BUILD file.
load("//gherkin:defs.bzl", "gherkin_library", "gherkin_test")
gherkin_library(
name = "feature_specs",
srcs = glob(["**/*.feature"]),
)
gherkin_test(
name = "calc_test",
steps = ":calculator_steps",
deps = [":feature_specs"],
)
load("//gherkin:defs.bzl", "cc_gherkin_steps")
cc_gherkin_steps(
name = "calculator_steps",
srcs = [
"CalculatorSteps.cpp",
],
visibility = ["//visibility:public"],
deps = [
"//examples/Calc/src:calculator",
"@cucumber_cpp//src:cucumber_main",
"@gtest",
],
)
Big thank you to 'Paolo Ambrosio', who authored the cucumber-cpp from whom I copied and modified the //examples directory in this repository. The examples/LICENCE.txt has been added to reflect the origins of the example.