diff options
Diffstat (limited to 'debian/tests/rapper.sh')
-rw-r--r-- | debian/tests/rapper.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/debian/tests/rapper.sh b/debian/tests/rapper.sh new file mode 100644 index 0000000..b86157b --- /dev/null +++ b/debian/tests/rapper.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +# Start a web server to serve the file. +php --server localhost:10101 --docroot debian/tests/data & +SERVER_PID=$! + +# A graphviz source file can be created. +php debian/tests/rapper.php > sample.dot + +kill -9 $SERVER_PID + +# A valid dot can be used by graphviz. +dot -Tpng sample.dot > sample.png +MIME_TYPE=`file --mime-type --brief sample.png` +if [ "$MIME_TYPE" != 'image/png' ] +then + exit 1; +fi |