]> git.lizzy.rs Git - rust.git/blob - tests/ui-cargo/update-all-references.sh
7028b251ea0307bb669524afb702a8d62a038924
[rust.git] / tests / ui-cargo / 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 BUILD_DIR=$PWD/target/debug/test_build_base
16 MY_DIR=$(dirname "$0")
17 cd "$MY_DIR" || exit
18 find . -name '*.rs' -exec ./update-references.sh "$BUILD_DIR" {} +