diff --git a/docs/test_docs.sh b/docs/test_docs.sh index f6677b9e4f..3e51ad7b5e 100755 --- a/docs/test_docs.sh +++ b/docs/test_docs.sh @@ -19,8 +19,8 @@ bazel clean \ && chmod 0644 *.md if [ -n "$(git status --porcelain)" ]; then - git status - echo '/docs is out of date. Please run `./docs/update_docs.sh` from the root of rules_rust and push the results' >&2 + >&2 git status + >&2 echo '/docs is out of date. Please run `./docs/update_docs.sh` from the root of rules_rust and push the results' >&2 exit 1 fi diff --git a/test/clippy/clippy_failure_test.sh b/test/clippy/clippy_failure_test.sh index 4f047961bf..0accd98628 100755 --- a/test/clippy/clippy_failure_test.sh +++ b/test/clippy/clippy_failure_test.sh @@ -8,7 +8,7 @@ set -euo pipefail if [[ -z "${BUILD_WORKSPACE_DIRECTORY:-}" ]]; then - echo "This script should be run under Bazel" + >&2 echo "This script should be run under Bazel" exit 1 fi @@ -30,8 +30,8 @@ function check_build_result() { echo -n "Testing ${2}... " (bazel build ${@:3} //test/clippy:"${2}" &> /dev/null) || ret="$?" && true if [[ "${ret}" -ne "${1}" ]]; then - echo "FAIL: Unexpected return code [saw: ${ret}, want: ${1}] building target //test/clippy:${2}" - echo " Run \"bazel build //test/clippy:${2}\" to see the output" + >&2 echo "FAIL: Unexpected return code [saw: ${ret}, want: ${1}] building target //test/clippy:${2}" + >&2 echo " Run \"bazel build //test/clippy:${2}\" to see the output" exit 1 elif [[ $# -ge 3 ]] && [[ "${@:3}" == *"capture_clippy_output"* ]]; then # Make sure that content was written to the output file @@ -41,9 +41,9 @@ function check_build_result() { STATOPTS=(-c%s) fi if [[ $(stat ${STATOPTS[@]} "${NEW_WORKSPACE}/bazel-bin/test/clippy/${2%_clippy}.clippy.out") == 0 ]]; then - echo "FAIL: Output wasn't written to out file building target //test/clippy:${2}" - echo " Output file: ${NEW_WORKSPACE}/bazel-bin/test/clippy/${2%_clippy}.clippy.out" - echo " Run \"bazel build //test/clippy:${2}\" to see the output" + >&2 echo "FAIL: Output wasn't written to out file building target //test/clippy:${2}" + >&2 echo " Output file: ${NEW_WORKSPACE}/bazel-bin/test/clippy/${2%_clippy}.clippy.out" + >&2 echo " Run \"bazel build //test/clippy:${2}\" to see the output" exit 1 else echo "OK" diff --git a/test/current_toolchain_files/current_toolchain_files_test_runner.sh b/test/current_toolchain_files/current_toolchain_files_test_runner.sh index 6fdb8d8a87..7ab296750b 100755 --- a/test/current_toolchain_files/current_toolchain_files_test_runner.sh +++ b/test/current_toolchain_files/current_toolchain_files_test_runner.sh @@ -24,5 +24,5 @@ if [[ "${OPTION}" == "files" ]]; then exit 0 fi -echo "Unexpected option: ${OPTION}" +>&2 echo "Unexpected option: ${OPTION}" exit 1 diff --git a/test/portable_link_flags_darwin/test.sh b/test/portable_link_flags_darwin/test.sh index 01879b8d2f..a1f13cd4d8 100755 --- a/test/portable_link_flags_darwin/test.sh +++ b/test/portable_link_flags_darwin/test.sh @@ -2,11 +2,11 @@ set -e if otool -L $1 | grep -q libtest; then - echo "error: rust_binary is dynamically linked against libtest!" + >&2 echo "error: rust_binary is dynamically linked against libtest!" exit 1 fi if otool -L $1 | grep -q libstd; then - echo "error: rust_binary is dynamically linked against libstd!" + >&2 echo "error: rust_binary is dynamically linked against libstd!" exit 1 -fi \ No newline at end of file +fi diff --git a/test/rust_analyzer/rust_analyzer_test_runner.sh b/test/rust_analyzer/rust_analyzer_test_runner.sh index ffee052673..08f9bf3b45 100755 --- a/test/rust_analyzer/rust_analyzer_test_runner.sh +++ b/test/rust_analyzer/rust_analyzer_test_runner.sh @@ -6,13 +6,13 @@ set -euo pipefail if [[ -z "${BUILD_WORKSPACE_DIRECTORY:-}" ]]; then - echo "This script should be run under Bazel" + >&2 echo "This script should be run under Bazel" exit 1 fi PACKAGE_NAME="$1" if [[ -z "${PACKAGE_NAME:-}" ]]; then - echo "The first argument should be the package name of the test target" + >&2 echo "The first argument should be the package name of the test target" exit 1 fi diff --git a/test/rustfmt/rustfmt_failure_test.sh b/test/rustfmt/rustfmt_failure_test.sh index 263753c110..8d97612d73 100755 --- a/test/rustfmt/rustfmt_failure_test.sh +++ b/test/rustfmt/rustfmt_failure_test.sh @@ -25,8 +25,8 @@ function check_build_result() { echo -n "Testing ${2}... " (bazel test //test/rustfmt:"${2}") || ret="$?" && true if [[ "${ret}" -ne "${1}" ]]; then - echo "FAIL: Unexpected return code [saw: ${ret}, want: ${1}] building target //test/rustfmt:${2}" - echo " Run \"bazel test //test/rustfmt:${2}\" to see the output" + >&2 echo "FAIL: Unexpected return code [saw: ${ret}, want: ${1}] building target //test/rustfmt:${2}" + >&2 echo " Run \"bazel test //test/rustfmt:${2}\" to see the output" exit 1 else echo "OK"