Merge "Add worlddump unit test"

This commit is contained in:
Jenkins 2015-07-16 23:55:34 +00:00 committed by Gerrit Code Review
commit f0e86a7ac7

35
tests/test_worlddump.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
# Simple test of worlddump.py
TOP=$(cd $(dirname "$0")/.. && pwd)
source $TOP/tests/unittest.sh
OUT_DIR=$(mktemp -d)
$TOP/tools/worlddump.py -d $OUT_DIR
if [[ $? -ne 0 ]]; then
fail "worlddump failed"
else
# worlddump creates just one output file
OUT_FILE=($OUT_DIR/*.txt)
if [ ! -r $OUT_FILE ]; then
failed "worlddump output not seen"
else
passed "worlddump output $OUT_FILE"
if [[ $(stat -c %s $OUT_DIR/*.txt) -gt 0 ]]; then
passed "worlddump output is not zero sized"
fi
# put more extensive examination here, if required.
fi
fi
rm -rf $OUT_DIR
report_results