6 if [ -z "$1" ] || [ "$1" = "--help" ]; then
7 echo "Usage: $0 path_to_test new_path_to_test"
25 test "${src}" != "${dest}" || die "Test \"${src}\" is the same as dest."
26 test -e "tests/${src}" || die "Test \"${src}\" does not exist."
27 test ! -e "tests/${dest}" || die "Test \"${src}\" already exists."
29 sid="$(basename "${src}")"
30 did="$(basename "${dest}")"
32 sgroup="$(basename "$(dirname "tests/${src}")")"
33 dgroup="$(basename "$(dirname "tests/${dest}")")"
35 sgroupfile="tests/${sgroup}/group"
36 dgroupfile="tests/${dgroup}/group"
38 git mv "tests/${src}" "tests/${dest}"
39 git mv "tests/${src}.out" "tests/${dest}.out"
40 sed -e "s/^# FS[[:space:]]*QA.*Test.*[0-9]\+$/# FS QA Test No. ${did}/g" -i "tests/${dest}"
41 sed -e "s/^QA output created by ${sid}$/QA output created by ${did}/g" -i "tests/${dest}.out"
42 sed -e "s/test-${sid}/test-${did}/g" -i "tests/${dest}.out"
44 grpline="$(grep "^${sid} " "${sgroupfile}")"
45 newgrpline="$(echo "${grpline}" | sed -e "s/^${sid} /${did} /g")"
47 sed -e "/^${sid} .*$/d" -i "${sgroupfile}"
48 cp "${dgroupfile}" "${dgroupfile}.new"
49 append "${dgroupfile}.new" "${newgrpline}"
50 "${dir}/sort-group" "${dgroupfile}.new"
51 mv "${dgroupfile}.new" "${dgroupfile}"
53 echo "Moved \"${src}\" to \"${dest}\"."