2 # Convenience script to rename test cases in Automake.
7 fatal () { echo "$me: $*" >&2; exit 1; }
11 1) input=$(cat -- "$1");;
12 *) fatal "too many arguments";;
18 [[ -f automake.in && -d lib/Automake ]] \
19 || fatal "can only be run from the top-level of the Automake source tree"
21 $SED --version 2>&1 | grep GNU >/dev/null 2>&1 \
22 || fatal "GNU sed is required by this script"
24 # Validate and cleanup input.
29 (NF != 2) { print me \": wrong number of fields at line \" NR;
31 { printf (\"t/%s t/%s\\n\", \$1, \$2); }
34 # Prepare git commit message.
36 echo "tests: more significant names for some tests" >&5
38 $AWK >&5 <<<"$input" \
39 '{ printf ("* %s: Rename...\n* %s: ... like this.\n", $1, $2) }'
43 eval "$($AWK '{ printf ("git mv %s %s\n", $1, $2) }' <<<"$input")"
45 # Adjust the list of tests (do this conditionally, since such a
46 # list is not required nor used in Automake-NG.
47 if test -f t/list-of-tests.mk; then
48 $SED -e "$($AWK '{ printf ("s|^%s |%s |\n", $1, $2) }' <<<"$input")" \