Permalink
Browse files

Added test.sh

  • Loading branch information...
1 parent 63d9fea commit c00d9f719b3042de2f4cc247daac2f25be0c70c3 @duckinator committed Nov 14, 2011
Showing with 36 additions and 0 deletions.
  1. +36 −0 test.sh
View
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+TEST_DISPLAY=:1
+
+VERBOSE=false
+
+if [ "$1" == "-v" ]; then
+ VERBOSE=true
+fi
+
+function run() {
+ sleep 1
+ echo "Starting $1..."
+ if $VERBOSE; then
+ DISPLAY="$TEST_DISPLAY" $@
+ else
+ DISPLAY="$TEST_DISPLAY" $@ &>/dev/null
+ fi
+}
+
+echo "Starting X server..."
+if $VERBOSE; then
+ X $TEST_DISPLAY &
+else
+ X $TEST_DISPLAY &>/dev/null &
+fi
+X_PID=$!
+
+run ./possum &
+run xterm
+
+echo "Killing X server..."
+kill $X_PID
+
+echo
+

0 comments on commit c00d9f7

Please sign in to comment.