Mercurial > hg > audiodb
changeset 164:218106b4db14
Add a test for dump/restore functionality.
Since it takes a long time (and must be run after the other tests), put
it in 9000/ and adjust run-tests.sh to take a --full argument.
author | mas01cr |
---|---|
date | Mon, 05 Nov 2007 10:54:53 +0000 |
parents | b852e652a9a1 |
children | 324699d56429 |
files | tests/9000/run-test.sh tests/9000/short-description tests/run-tests.sh |
diffstat | 3 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/9000/run-test.sh Mon Nov 05 10:54:53 2007 +0000 @@ -0,0 +1,18 @@ +#! /bin/sh + +. ../test-utils.sh + +for file in `find .. -name testdb -print | sort -n` +do + dir=`mktemp -d` + echo dumping "${file}" into "${dir}/${file:3:4}" + ${AUDIODB} -d ${file} -D --output="${dir}/${file:3:4}" + echo restoring "${file}" into "${dir}"/"${file:3:4}"/restoredb + export restoreadb=${AUDIODB} + (export AUDIODB=`pwd`/$restoreadb && cd "${dir}"/"${file:3:4}" && sh ./restore.sh restoredb) + echo comparing dbs for "${file:3:4}" + cmp "${file}" "${dir}"/"${file:3:4}"/restoredb + rm -rf "${dir}" +done + +exit 104
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/9000/short-description Mon Nov 05 10:54:53 2007 +0000 @@ -0,0 +1,1 @@ +dump/restore of testdbs \ No newline at end of file
--- a/tests/run-tests.sh Thu Nov 01 15:18:17 2007 +0000 +++ b/tests/run-tests.sh Mon Nov 05 10:54:53 2007 +0000 @@ -10,7 +10,13 @@ exit 1 fi -for file in [0-9][0-9][0-9][0-9]*; do +if [ "$1" = "--full" ]; then + pattern="[0-9][0-9][0-9][0-9]*" +else + pattern="[0-8][0-9][0-9][0-9]*" +fi + +for file in ${pattern}; do if [ -d ${file} ]; then if [ -f ${file}/run-test.sh ]; then echo -n Running test ${file}