Menu
Public repository / e0753e49bfea7ef672aabf8df9a3a27b8bdd9dc7
AkurAI-Mail / scripts/test-lint-sibling-deps.sh
Latest change 045c6e9898aee39f49ad8d0e6ca4b5c7697877d2 - OLI-188: roll out lint-config CI job and sibling-dep lint by Ólafur Búi Ólafsson
#!/bin/sh
# Smoke test: lint-sibling-deps must reject unchecked-out sibling path deps and accept checked-out ones.
set -eu
lint="$(cd "$(dirname "$0")" && pwd)/lint-sibling-deps.sh"
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
mkdir -p "$tmp/repo/crates/a" "$tmp/repo/crates/b"
printf '[dependencies]\nb = { path = "../b" }\n' > "$tmp/repo/crates/a/Cargo.toml"
printf '[dependencies]\nfw = { path = "../../../Sibling/crates/x" }\n' > "$tmp/repo/crates/b/Cargo.toml"
expect() { # want-exit yml-content
printf '%s\n' "$2" > "$tmp/repo/.akurai.yml"
rc=0; (cd "$tmp/repo" && sh "$lint") >/dev/null 2>&1 || rc=$?
[ "$rc" -eq "$1" ] || { echo "FAIL: want $1 got $rc for: $2" >&2; exit 1; }
}
expect 1 'run: cargo build'
expect 1 'run: git clone ../Other'
expect 0 'run: git clone x ../Sibling'
echo ok