nix: add withTmpDir to checked-shell-script

This commit is contained in:
Wolfgang Walther
2021-04-12 19:03:16 +02:00
committed by Wolfgang Walther
parent 579a626de2
commit fc791a6320
3 changed files with 17 additions and 16 deletions
+1 -10
View File
@@ -174,6 +174,7 @@ let
inherit name;
docs = "Run spec and io tests while collecting hpc coverage data.";
inRootDir = true;
withTmpDir = true;
}
''
env="$(cat ${postgrest.env})"
@@ -184,14 +185,6 @@ let
mkdir -p coverage
rm -rf coverage/*
# temporary directory to collect data in
tmpdir="$(mktemp -d)"
# we keep the tmpdir when an error occurs for debugging
trap 'echo Temporary directory kept at: $tmpdir' ERR
# remove the tmpdir when cancelled (postgrest-watch)
trap 'rm -rf "$tmpdir"' SIGINT SIGTERM
# build once before running all the tests
${cabal-install}/bin/cabal v2-build ${devCabalOptions} --enable-tests all
@@ -234,8 +227,6 @@ let
echo "file://$(pwd)/coverage/hpc_index.html"
${ghc}/bin/hpc report coverage/postgrest.tix "$@"
fi
rm -rf "$tmpdir"
'';
coverageDraftOverlay =