aboutsummaryrefslogtreecommitdiff
path: root/scripts/load_every_help.sh
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-02-08 03:48:20 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-02-08 03:48:20 +0000
commitb87715a28fab55ae2d94f4a7f290a9f5e14b15c6 (patch)
treece51dee96fcfbd7cec94bfcedb8e2579b13659b1 /scripts/load_every_help.sh
parentdae608a5e8f3ec9f0447be489a39b37763189174 (diff)
a simple start to start automating the testing of Pd builds. It just opens then closes every help file it finds and logs the results. This is a super simple script to contribute to Matju's Pure Unity effort
svn path=/trunk/; revision=4567
Diffstat (limited to 'scripts/load_every_help.sh')
-rwxr-xr-xscripts/load_every_help.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/load_every_help.sh b/scripts/load_every_help.sh
new file mode 100755
index 00000000..c2e3d6e4
--- /dev/null
+++ b/scripts/load_every_help.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+PD_ROOT=$1
+NETRECEIVE_PATCH=/tmp/.____pd_netreceive____.pd
+PORT_NUMBER=55556
+LOG_FILE=/tmp/load_every_help-log-`date +20%y-%m-%d_%H.%M.%S`.txt
+
+helpdir=${PD_ROOT}/doc
+bindir=${PD_ROOT}/bin
+
+function make_netreceive_patch ()
+{
+ rm $1
+ touch $1
+ echo '#N canvas 222 130 454 304 10;' >> $1
+ echo "#X obj 111 83 netreceive $PORT_NUMBER 0 old;" >> $1
+}
+
+function open_patch ()
+{
+ echo "OPENING: $1 $2" >> $LOG_FILE
+ echo "; pd open $1 $2;" | ${bindir}/pdsend $PORT_NUMBER localhost tcp
+}
+
+function close_patch ()
+{
+ echo "CLOSING: $1" >> $LOG_FILE
+ echo "; pd-$1 menuclose;" | ${bindir}/pdsend $PORT_NUMBER localhost tcp
+}
+
+
+
+make_netreceive_patch $NETRECEIVE_PATCH
+
+touch $LOG_FILE
+${bindir}/pd -nogui -stderr -open $NETRECEIVE_PATCH >> $LOG_FILE 2>&1 &
+
+#wait for pd to start
+sleep 30
+
+for file in `find $helpdir -name '*.pd'`; do
+ filename=`echo $file|sed 's|.*/\(.*\.pd\)$|\1|'`
+ dir=`echo $file|sed 's|\(.*\)/.*\.pd$|\1|'`
+ open_patch $filename $dir
+ sleep 1
+ close_patch $filename
+done