Skip to content

Instantly share code, notes, and snippets.

@relekang
Created February 7, 2015 20:52
Show Gist options
  • Save relekang/3949e548fbf44989cb1e to your computer and use it in GitHub Desktop.
Save relekang/3949e548fbf44989cb1e to your computer and use it in GitHub Desktop.
A test script for running `apm test` on a linux box
#!/bin/sh
PID_PATH=/var/run/xvfb_99/`date +%s`.pid
start-stop-daemon --start --pidfile $PID_PATH --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +extension RANDR +render -noreset > /dev/null || exit 1
sleep 3 > /dev/null
export DISPLAY=:99 > /dev/null
apm test
EXIT_CODE=$?
start-stop-daemon --stop --pidfile $PID_PATH > /dev/null
exit $EXIT_CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment