Skip to content

Commit

Permalink
add hashes e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Jan 17, 2023
1 parent f1600a4 commit a54c1fb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions e2e/bzlmod_coreutils/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@aspect_bazel_lib//tools:hashes.bzl", "hashes")

genrule(
name = "ls",
Expand All @@ -7,12 +8,33 @@ genrule(
toolchains = ["@coreutils_toolchains//:resolved_toolchain"],
)

hashes(
name = "hash",
src = "test.bin"
)

filegroup(
name = "md5",
output_group = "md5",
srcs = [":hash"]
)

filegroup(
name = "sha1",
output_group = "sha1",
srcs = [":hash"]
)


# This tests that the "in" file to write_source_files can be a
# label to an external repository target when bzlmod is enabled.
write_source_files(
name = "write_ls",
files = {
"ls.txt.expected": ":ls.txt",
"sha256.txt": ":hash",
"sha1.txt": ":sha1",
"md5.txt": ":md5"
},
)

1 change: 1 addition & 0 deletions e2e/bzlmod_coreutils/md5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
160e389707f172f2d1333084fec4e650 test.bin
1 change: 1 addition & 0 deletions e2e/bzlmod_coreutils/sha1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b3dd96b0db6a12a3ae53899e8fbc04b749c980d6 test.bin
1 change: 1 addition & 0 deletions e2e/bzlmod_coreutils/sha256.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3285d399e870df47749162ab2ebfd0b727e9142925ab5f5ad221c3a42a852b08 test.bin
1 change: 1 addition & 0 deletions e2e/bzlmod_coreutils/test.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
act as if this is binary file

0 comments on commit a54c1fb

Please sign in to comment.