rusty-man/tests/update-snapshots.sh
Robin Krahl 6dc75f0c5d
Add support for Rust 1.54.0, 1.55.0, 1.56.0
This patch adds tests for Rust 1.54.0, 1.55.0 and 1.56.0.  To make the
tests pass, we have to take care of some changes like more details
elements and changed heading levels.  To make it easier to generate the
tests for new Rust versions, we also add two bash scripts that take care
of that.
2021-10-26 23:29:54 +02:00

27 lines
582 B
Bash
Executable File

#!/bin/bash
# SPDX-FileCopyrightText: 2021 Robin Krahl <robin.krahl@ireas.org>
# SPDX-License-Identifier: MIT
set -euo pipefail
if [ $# -ne 2 ]
then
echo "Usage: $0 <old_version> <version>" >&2
exit 1
fi
old_version=$1
version=$2
tests_dir=$(dirname $(readlink -f $0))
snapshot_dir=$tests_dir/snapshots
old_prefix=output__$old_version
new_prefix=output__$version
for old_snapshot in "$snapshot_dir/$old_prefix"*
do
new_snapshot=$(basename "$old_snapshot")
new_snapshot=$new_prefix${new_snapshot#$old_prefix}
cp --verbose "$old_snapshot" "$snapshot_dir/$new_snapshot"
done