-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
8 changed files
with
93 additions
and
0 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 @@ | ||
integration/ |
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,38 @@ | ||
load("@bazel_bats//:rules.bzl", "bats_test") | ||
|
||
bats_test( | ||
name = "hello_world_test", | ||
srcs = ["hello_world.bats"], | ||
env = { | ||
"PROGRAM": "hello_world", | ||
"LOCATED": "$(location :dummy)", | ||
}, | ||
deps = [":dummy"], | ||
) | ||
|
||
bats_test( | ||
name = "hello_world_twofiles_test", | ||
srcs = [ | ||
"hello_world_1.bats", | ||
"hello_world_2.bats", | ||
], | ||
) | ||
|
||
bats_test( | ||
name = "hello_world_twofiles_1_test", | ||
srcs = [ | ||
"hello_world_1.bats", | ||
], | ||
) | ||
|
||
bats_test( | ||
name = "hello_world_twofiles_2_test", | ||
srcs = [ | ||
"hello_world_2.bats", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "dummy", | ||
srcs = ["dummy.txt"], | ||
) |
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,23 @@ | ||
workspace(name = "bazel_bats_integration") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
BAZEL_BATS_VERSION = "0.29.1" | ||
HEAD = "75dea0bc4d15d48a4238ad2143e998509c0cb3e4" | ||
|
||
http_archive( | ||
name = "bazel_bats", | ||
# TODO: Tag and release HEAD. | ||
# strip_prefix = "bazel-bats-%s" % BAZEL_BATS_VERSION, | ||
strip_prefix = "bazel-bats-%s" % HEAD, | ||
urls = [ | ||
# TODO: Tag and release HEAD. | ||
# "https://github.com/jmelahman/bazel-bats/archive/refs/tags/v%s.tar.gz" % BAZEL_BATS_VERSION, | ||
"https://github.com/jmelahman/bazel-bats/archive/%s.tar.gz" % HEAD, | ||
], | ||
sha256 = "e57d61da26bbb5428e8162da4fa2432d85abc2530b6211dd2d096d75be18d9fb", | ||
) | ||
|
||
load("@bazel_bats//:deps.bzl", "bazel_bats_dependencies") | ||
|
||
bazel_bats_dependencies() |
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 @@ | ||
#empty file |
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,15 @@ | ||
#!/usr/bin/env bats | ||
|
||
@test "addition using bc" { | ||
result="$(echo 4)" | ||
[ "$result" -eq 4 ] | ||
} | ||
|
||
@test "Test program name" { | ||
[ "${PROGRAM}" == "hello_world" ] | ||
} | ||
|
||
@test "Test program name with location" { | ||
echo "Location: ${LOCATED}" | ||
[ "${LOCATED}" == "./dummy.txt" ] | ||
} |
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 @@ | ||
#!/usr/bin/env bats | ||
|
||
@test "addition using bc" { | ||
result="$(echo 4)" | ||
[ "$result" -eq 4 ] | ||
} | ||
|
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 @@ | ||
#!/usr/bin/env bats | ||
|
||
@test "addition using bc" { | ||
result="$(echo 4)" | ||
[ "$result" -eq 4 ] | ||
} | ||
|