-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcheck-msrv.sh
executable file
·48 lines (40 loc) · 1.02 KB
/
check-msrv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
set -Ceu
if [ "$*" = "" ]; then quiet='--quiet'; else quiet=''; fi
set -x
# Make sure the files are clean before we modify them
git diff --exit-code -- Cargo.lock Cargo.toml
trap 'git checkout -- Cargo.lock Cargo.toml' EXIT
update_workspace_member() {
cat >| Cargo.toml <<EOF
[workspace]
members = ["$1"]
resolver = "2"
EOF
}
# $1 = package name
# $2, $3, ... = additional options to `cargo test`
check() {
package="$1"
shift
if [ "$#" -eq 0 ]; then
set ''
fi
update_workspace_member "$package"
cargo +nightly update -Z direct-minimal-versions
msrv=$(cargo metadata --format-version=1 |
jq -r ".packages[] | select(.name == \"$package\") | .rust_version")
for options do
cargo +$msrv test --package "$package" $options -- $quiet
done
}
check yash-arith
check yash-builtin
check yash-cli
check yash-env
check yash-env-test-helper
check yash-executor
check yash-fnmatch
check yash-prompt
check yash-quote
check yash-semantics
check yash-syntax '' '--features annotate-snippets'