From ab3b81685a4d4e28915d56cdfe9747a7fe55b95b Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 4 May 2018 08:46:30 -0700 Subject: [PATCH] Fix update-references for tests within subdirectories. Fixes #50438. I'll make this more robust later for #49815. --- src/test/ui/update-references.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/ui/update-references.sh b/src/test/ui/update-references.sh index 4fc11daaa3afa..6ff05b5ab047e 100755 --- a/src/test/ui/update-references.sh +++ b/src/test/ui/update-references.sh @@ -36,10 +36,11 @@ shopt -s nullglob while [[ "$1" != "" ]]; do for EXT in "stderr" "stdout"; 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