Skip to content

Commit 5128aff

Browse files
committed
Fix update-references for tests within subdirectories.
Fixes #50438. I'll make this more robust later for #49815.
1 parent c166b03 commit 5128aff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/test/ui/update-references.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,21 @@ if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then
2626
echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs"
2727
fi
2828

29+
MYDIR=$(dirname $0)
2930

3031
BUILD_DIR="$1"
3132
shift
3233

3334
shopt -s nullglob
3435

3536
while [[ "$1" != "" ]]; do
36-
MYDIR=$(dirname $1)
3737
for EXT in "stderr" "stdout" "fixed"; do
3838
for OUT_NAME in $BUILD_DIR/${1%.rs}.*$EXT; do
39+
OUT_DIR=`dirname "$1"`
3940
OUT_BASE=`basename "$OUT_NAME"`
40-
if ! (diff $OUT_NAME $MYDIR/$OUT_BASE >& /dev/null); then
41-
echo updating $MYDIR/$OUT_BASE
42-
cp $OUT_NAME $MYDIR
41+
if ! (diff $OUT_NAME $MYDIR/$OUT_DIR/$OUT_BASE >& /dev/null); then
42+
echo updating $MYDIR/$OUT_DIR/$OUT_BASE
43+
cp $OUT_NAME $MYDIR/$OUT_DIR
4344
fi
4445
done
4546
done

0 commit comments

Comments
 (0)