]> git.lyx.org Git - features.git/blob - development/keystest/autolyx
Next patch from John McCabe-Dansted.
[features.git] / development / keystest / autolyx
1 #!/bin/bash
2 # This script starts LyX, and restarts LyX if it is closed
3 # it logs all output, including backtraces to development/keystest/out/GDB
4
5 #Setting the following may give better screen shots
6 #gconftool-2 /apps/metacity/general/compositing_manager -s -t bool true
7
8 DIRNAME0=`dirname "$0"`
9 OUTDIR="$DIRNAME0/out"
10
11 #rename other windows to avoid confusion.
12 wmctrl -N __renamed__ -r lyx
13 wmctrl -N __renamed__ -r lyx
14 wmctrl -N __renamed__ -r lyx
15 wmctrl -N __renamed__ -r lyx
16
17 (
18 while true
19 do
20   SEC=`date +%s`
21   GDB=$OUTDIR/$SEC.GDB
22   KEYCODE=$OUTDIR/$SEC.KEYCODE
23   ( sleep 20 && python $DIRNAME0/test.py | tee $KEYCODE) &
24   CHILD_PID="$!"
25   ls src/lyx ; sleep 1
26    pwd
27   #sleep 10
28   
29   #You may want to use the following to simulate SIGFPE
30   #(sleep 90 && killall -8 lyx) &
31
32   (echo "
33   shell svn info src/
34   run
35   bt
36   shell kill $CHILD_PID
37   shell import -window root '$GDB.png'
38   shell wmctrl -l
39   shell sleep 1
40   shell kill -9 $CHILD_PID
41   shell wmctrl -r __renamed__ -b add,shaded
42   shell wmctrl -r term -b add,shaded
43   shell wmctrl -r term -b add,shaded
44   shell wmctrl -R lyx 
45   shell import -window root '$GDB..png'
46  " ; yes q) | gdb src/lyx 2>&1 | strings|  tee $GDB
47   kill $CHILD_PID
48   #sleep 2 kill -9 $CHILD_PID
49   grep " signal " $GDB || (
50     rm $OUTDIR/*GDB*.bak
51     rm $OUTDIR/*KEYCODE*.bak
52     mv $KEYCODE $KEYCODE.bak
53     mv $GDB $GDB.bak
54     mv $GDB.png $GDB.png.bak
55     mv $GDB..png $GDB..png.bak
56     #rm $OUTDIR/KEYCODE.$SEC
57     #rm $OUTDIR/GDB.$SEC
58   )
59 done
60 ) 2>&1 |tee $OUTDIR/log