AkurAI Build
Menu

Public repository / 8e8b37791b10d6119df0a2cff4be3c35376e8ea1

AkurAI-IDP / scripts/test-lint-sibling-deps.sh

Latest change 8bb2011e5a8f4daabce95da310f1021e9529069c - 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