@@ -57,17 +57,34 @@ verify_status() {
5757 fi
5858}
5959
60+ check_dispatch () {
61+ if [ " $1 " = submodule_changed ]; then
62+ # ignore $2 (branch id)
63+ verify_status $3 $4
64+ elif [ " $2 " = beta ]; then
65+ echo " Requiring test passing for $3 ..."
66+ if grep -q ' "' " $3 " ' ":"\(test\|build\)-fail"' " $TOOLSTATE_FILE " ; then
67+ exit 4
68+ fi
69+ fi
70+ }
71+
72+ status_check () {
73+ check_dispatch $1 beta book src/doc/book
74+ check_dispatch $1 beta nomicon src/doc/nomicon
75+ check_dispatch $1 beta reference src/doc/reference
76+ check_dispatch $1 beta rust-by-example src/doc/rust-by-example
77+ check_dispatch $1 beta rls src/tool/rls
78+ check_dispatch $1 beta rustfmt src/tool/rustfmt
79+ # these tools are not required for beta to successfully branch
80+ check_dispatch $1 nightly clippy-driver src/tool/clippy
81+ check_dispatch $1 nightly miri src/tool/miri
82+ }
83+
6084# If this PR is intended to update one of these tools, do not let the build pass
6185# when they do not test-pass.
6286
63- verify_status book src/doc/book
64- verify_status nomicon src/doc/nomicon
65- verify_status reference src/doc/reference
66- verify_status rust-by-example src/doc/rust-by-example
67- verify_status rls src/tool/rls
68- verify_status rustfmt src/tool/rustfmt
69- verify_status clippy-driver src/tool/clippy
70- verify_status miri src/tool/miri
87+ status_check " submodule_changed"
7188
7289if [ " $RUST_RELEASE_CHANNEL " = nightly -a -n " ${TOOLSTATE_REPO_ACCESS_TOKEN+is_set} " ]; then
7390 . " $( dirname $0 ) /repo.sh"
@@ -86,6 +103,4 @@ $COMMIT\t$(cat "$TOOLSTATE_FILE")
86103 exit 0
87104fi
88105
89- if grep -q fail " $TOOLSTATE_FILE " ; then
90- exit 4
91- fi
106+ status_check " beta_required"
0 commit comments