Skip to content

Commit 5c7f39f

Browse files
committed
Add worlddump unit test
Add a worlddump unit test to avoid simple breakages Change-Id: I6b87d4dbe22da2c1ca5ceb13134e9bb570f5cef2
1 parent 3a9df1d commit 5c7f39f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/test_worlddump.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Simple test of worlddump.py
4+
5+
TOP=$(cd $(dirname "$0")/.. && pwd)
6+
7+
source $TOP/tests/unittest.sh
8+
9+
OUT_DIR=$(mktemp -d)
10+
11+
$TOP/tools/worlddump.py -d $OUT_DIR
12+
13+
if [[ $? -ne 0 ]]; then
14+
fail "worlddump failed"
15+
else
16+
17+
# worlddump creates just one output file
18+
OUT_FILE=($OUT_DIR/*.txt)
19+
20+
if [ ! -r $OUT_FILE ]; then
21+
failed "worlddump output not seen"
22+
else
23+
passed "worlddump output $OUT_FILE"
24+
25+
if [[ $(stat -c %s $OUT_DIR/*.txt) -gt 0 ]]; then
26+
passed "worlddump output is not zero sized"
27+
fi
28+
29+
# put more extensive examination here, if required.
30+
fi
31+
fi
32+
33+
rm -rf $OUT_DIR
34+
35+
report_results

0 commit comments

Comments
 (0)