]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/update-all-references.sh
Rollup merge of #71726 - ldm0:ref2ptr, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / update-all-references.sh
1 #!/bin/bash
2
3 # A script to update the references for all tests. The idea is that
4 # you do a run, which will generate files in the build directory
5 # containing the (normalized) actual output of the compiler. You then
6 # run this script, which will copy those files over. If you find
7 # yourself manually editing a foo.stderr file, you're doing it wrong.
8 #
9 # See all `update-references.sh`, if you just want to update a single test.
10
11 if [[ "$1" == "--help" || "$1" == "-h" ]]; then
12     echo "usage: $0"
13 fi
14
15 CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-$PWD/target}
16 PROFILE=${PROFILE:-debug}
17 BUILD_DIR=${CARGO_TARGET_DIR}/${PROFILE}/test_build_base
18
19 MY_DIR=$(dirname "$0")
20 cd "$MY_DIR" || exit
21 find . -name '*.rs' -exec ./update-references.sh "$BUILD_DIR" {} +