mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 01:20:39 +00:00
To support using other diff tools than colordiff Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
25 lines
537 B
Bash
Executable File
25 lines
537 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Converts assertion failure text involving two mutations to a diff.
|
|
#
|
|
|
|
cmd="colordiff -u"
|
|
|
|
while getopts ":d:" opt; do
|
|
case $opt in
|
|
d)
|
|
cmd="$OPTARG";;
|
|
*)
|
|
echo "Usage: $0 [-d diff_command] <path-to-test-output-file>" 1>&2
|
|
exit 1;;
|
|
esac
|
|
done
|
|
shift $((OPTIND-1))
|
|
|
|
function filter {
|
|
sed 's/@0x[0-9a-f]*//g'
|
|
}
|
|
|
|
$cmd <(sed -n '/expected/,/got:/p' $1 | head -n-1 | sed 's/.*expected /&\n/' | filter) \
|
|
<(sed -n '/got:/,/^$/p' $1 | sed 's/.*got: /&\n/' | filter) | less -R
|