From 1cc8aa56a44a83fd6d1841089fea8991d792207e Mon Sep 17 00:00:00 2001 From: zseri Date: Sat, 25 Dec 2021 05:23:13 +0100 Subject: refactor(zseri/store-ref-scanner): get rid of proc_unroll dependency Change-Id: I0d4a8b2af814fd2870c3eb4218ee4fbaba1216f5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4605 Tested-by: BuildkiteCI Reviewed-by: zseri --- users/zseri/store-ref-scanner/tests.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 users/zseri/store-ref-scanner/tests.nix (limited to 'users/zseri/store-ref-scanner/tests.nix') diff --git a/users/zseri/store-ref-scanner/tests.nix b/users/zseri/store-ref-scanner/tests.nix new file mode 100644 index 000000000000..a4c82fe3a936 --- /dev/null +++ b/users/zseri/store-ref-scanner/tests.nix @@ -0,0 +1,32 @@ +{ depot, lib, pkgs, ... }: + +let + parent = depot.users.zseri.store-ref-scanner; +in +pkgs.buildRustCrate { + pname = "store-ref-scanner-tests"; + inherit (parent) crateName src version edition; + buildTests = true; + postInstall = '' + set -ex + export RUST_BACKTRACE=1 + # recreate a file hierarchy as when running tests with cargo + # the source for test data + # build outputs + testRoot=target/debug + mkdir -p $testRoot + chmod +w -R . + # test harness executables are suffixed with a hash, + # like cargo does this allows to prevent name collision + # with the main executables of the crate + hash=$(basename $out) + ls -lasR $out + for file in $out/tests/*; do + f=$testRoot/$(basename $file)-$hash + cp $file $f + $f 2>&1 | tee -a $out/tests.log + done + rm -rf $out/tests + set +ex + ''; +} -- cgit 1.4.1