Allow aos::Sha256() to take a file path
This enables writing some tests where we want to conveniently compare
that the contents of two files are identical or haven't changed from
some known-good baseline.
Change-Id: I7f62fb1b3fffb7feafd34dd776e8a4981820b7d6
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/BUILD b/aos/BUILD
index f1cb6ba..acef762 100644
--- a/aos/BUILD
+++ b/aos/BUILD
@@ -809,7 +809,18 @@
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = [
+ "//aos/util:file",
"@boringssl//:crypto",
"@com_google_absl//absl/types:span",
],
)
+
+cc_test(
+ name = "sha256_test",
+ srcs = ["sha256_test.cc"],
+ deps = [
+ ":sha256",
+ "//aos/testing:googletest",
+ "//aos/testing:tmpdir",
+ ],
+)