File: rapper.sh

package info (click to toggle)
php-easyrdf 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 740 kB
  • sloc: php: 7,831; sh: 30; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

set -e

# Start a web server to serve the file.
php --server localhost:10101 --docroot debian/tests/data &
SERVER_PID=$!

set +e
curl --fail --silent --output /dev/null http://localhost:10101/foaf.rdf
if [ $? -ne 0 ]
then
    # Likely 22, the server may not be ready, give it a bit of time.
    sleep 2
fi
set -e

# 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