just: make new bash completion test work from build

This commit is contained in:
László Vaskó 2024-06-06 13:30:41 +02:00
parent 21ea0e48c8
commit 8d548d61ec
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,20 @@
diff --git a/tests/completions/just.bash b/tests/completions/just.bash
index 6d5c12c..13bff87 100755
--- a/tests/completions/just.bash
+++ b/tests/completions/just.bash
@@ -17,11 +17,13 @@ reply_equals() {
fi
}
+just() {
+ cargo run -- "$@"
+}
+
# --- Initial Setup ---
source "$1"
cd tests/completions
-cargo build
-PATH="$(git rev-parse --show-toplevel)/target/debug:$PATH"
exit_code=0
# --- Tests ---

View File

@ -2,6 +2,7 @@
, stdenv
, fetchFromGitHub
, rustPlatform
, bashInteractive
, coreutils
, installShellFiles
, libiconv
@ -42,8 +43,16 @@ rustPlatform.buildRustPackage rec {
# Return unchanged string.rs
cp $TMPDIR/string.rs tests/string.rs
# For shell completion tests
export PATH=${bashInteractive}/bin:$PATH
patchShebangs tests
'';
patches = [
./fix-just-path-in-tests.patch
];
postBuild = ''
cargo run --package generate-book