3 # A script to update the references for particular tests. The idea is
4 # that you do a run, which will generate files in the build directory
5 # containing the (normalized) actual output of the compiler. This
6 # script will then copy that output and replace the "expected output"
7 # files. You can then commit the changes.
9 # If you find yourself manually editing a foo.stderr file, you're
12 if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then
13 echo "usage: $0 <build-directory> <relative-path-to-rs-files>"
16 echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs"
24 while [[ "$1" != "" ]]; do
25 STDERR_NAME="${1/%.rs/.stderr}"
26 STDOUT_NAME="${1/%.rs/.stdout}"
28 if [[ -f "$BUILD_DIR"/"$STDOUT_NAME" ]] && \
29 ! (cmp -s -- "$BUILD_DIR"/"$STDOUT_NAME" "$MYDIR"/"$STDOUT_NAME"); then
30 echo updating "$MYDIR"/"$STDOUT_NAME"
31 cp "$BUILD_DIR"/"$STDOUT_NAME" "$MYDIR"/"$STDOUT_NAME"
33 if [[ -f "$BUILD_DIR"/"$STDERR_NAME" ]] && \
34 ! (cmp -s -- "$BUILD_DIR"/"$STDERR_NAME" "$MYDIR"/"$STDERR_NAME"); then
35 echo updating "$MYDIR"/"$STDERR_NAME"
36 cp "$BUILD_DIR"/"$STDERR_NAME" "$MYDIR"/"$STDERR_NAME"