Skip to content

Commit

Permalink
Rollup merge of rust-lang#50447 - ehuss:fix-update-references, r=alex…
Browse files Browse the repository at this point in the history
…crichton

Fix update-references for tests within subdirectories.

Fixes rust-lang#50438.

I'll make this more robust later for rust-lang#49815.
  • Loading branch information
alexcrichton authored May 10, 2018
2 parents 9179672 + 5128aff commit 6ef0b28
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/test/ui/update-references.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then
echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs"
fi

MYDIR=$(dirname $0)

BUILD_DIR="$1"
shift

shopt -s nullglob

while [[ "$1" != "" ]]; do
MYDIR=$(dirname $1)
for EXT in "stderr" "stdout" "fixed"; do
for OUT_NAME in $BUILD_DIR/${1%.rs}.*$EXT; do
OUT_DIR=`dirname "$1"`
OUT_BASE=`basename "$OUT_NAME"`
if ! (diff $OUT_NAME $MYDIR/$OUT_BASE >& /dev/null); then
echo updating $MYDIR/$OUT_BASE
cp $OUT_NAME $MYDIR
if ! (diff $OUT_NAME $MYDIR/$OUT_DIR/$OUT_BASE >& /dev/null); then
echo updating $MYDIR/$OUT_DIR/$OUT_BASE
cp $OUT_NAME $MYDIR/$OUT_DIR
fi
done
done
Expand Down

0 comments on commit 6ef0b28

Please sign in to comment.