diff options
Diffstat (limited to 'test_vectors')
| -rw-r--r-- | test_vectors/Cargo.toml | 2 | ||||
| -rwxr-xr-x | test_vectors/cross_test.sh | 25 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test_vectors/Cargo.toml b/test_vectors/Cargo.toml index aa4c0e7..47d98f1 100644 --- a/test_vectors/Cargo.toml +++ b/test_vectors/Cargo.toml @@ -4,6 +4,8 @@ version = "0.0.0" edition = "2018" [dependencies] +# If you ever change these path dependencies, you'll probably need to update +# cross_test.sh, or CI will break. I'm sorry >.< blake3 = { path = "../" } hex = "0.4.0" reference_impl = { path = "../reference_impl" } diff --git a/test_vectors/cross_test.sh b/test_vectors/cross_test.sh new file mode 100755 index 0000000..9d00c84 --- /dev/null +++ b/test_vectors/cross_test.sh @@ -0,0 +1,25 @@ +#! /usr/bin/env bash + +# This hacky script works around the fact that `cross test` does not support +# path dependencies. (It uses a docker shared folder to let the guest access +# project files, so parent directories aren't available.) Solve this problem by +# copying the entire project to a temp dir and rearranging paths to put +# "blake3" and "reference_impl" underneath "test_vectors", so that everything +# is accessible. Hopefully this will just run on CI forever and no one will +# ever read this and discover my deep shame. + +set -e -u -o pipefail + +project_root="$(realpath "$(dirname "$BASH_SOURCE")/..")" +tmpdir="$(mktemp -d)" +echo "Running cross tests in $tmpdir" +cd "$tmpdir" +git clone "$project_root" blake3 +mv blake3/test_vectors . +mv blake3/reference_impl test_vectors +mv blake3 test_vectors +cd test_vectors +sed -i 's|blake3 = { path = "../" }|blake3 = { path = "blake3" }|' Cargo.toml +sed -i 's|reference_impl = { path = "../reference_impl" }|reference_impl = { path = "reference_impl" }|' Cargo.toml + +cross test "$@" |
