#!/bin/bash
#This script updates LyX, runs LyX, starts spamming it with hundreds of
-#keypresses, and logs all output, including backtraces to LT/out/GDB
-#Use report.sh to generated the more useful bug reports in LT/out/{or}*
+#keypresses, and logs all output, including backtraces to development/keystest/out/GDB .
+#Use report.sh to generated the more useful bug reports in development/keystest/out/{or}*
-#LYXDIR=LT/lyx-1.6.x-test
-cd ~/lyx-1.6.x-test
-mkdir -p LT/out
+LT=development/keystest
+
+if ! [ -d $LT ]; then
+ echo lyx_make.sh is supposed to be in the root of the lyx svn tree, eg. development/keystest/lyx_make.sh.
+fi
+
+mkdir -p $LT/out
if which wmctrl xvkbd bash xterm python
then
- #cd "$LYXDIR" || echo CANNOT FIND LT/lyx-1.6.x-test
- #cd "$LYXDIR" || exit
- svn up Makefile.am autogen.sh boost/ config/ configure.ac lib/ lyx.1in m4/ rename.sh src/
- export CFLAGS="-g"
- export CXXFLAGS="$CFLAGS"
- ./autogen.sh && ./configure && nice -18 make && (bash LT/autolyx & sleep 9 ; xterm -e python LT/test.py)
+ svn up
+ ./autogen.sh && ./configure --enable-debug -- && nice -18 make && (bash $LT/autolyx & sleep 9 ; xterm -e python $LT/test.py)
else
echo NEEDS the following packages:
echo wmctrl xvkbd bash xterm python
#!/bin/bash
-# echo 'grep "#1 " LT/out/GDB | sed 's/0x[^ )]*[ )]/.*/g' | sort | uniq' >> report.sh
+LT=development/keystest
+
+# echo 'grep "#1 " $LT/out/GDB | sed 's/0x[^ )]*[ )]/.*/g' | sort | uniq' >> report.sh
UNIQUE_LINE=1
-while [ ! -e LT/out/GDB ]
+while [ ! -e $LT/out/GDB ]
do
cd ..
if [ `pwd` = '/' ]
fi
done
-strings LT/out/GDB > LT/out/GDBs
-grep "#$UNIQUE_LINE " LT/out/GDBs > LT/out/list
-#cat LT/out/list | grep -o ' in [[:alnum:]:]* ' | sort | uniq| tee LT/out/listuniq
-#cat LT/out/list | grep -o ' in [[:alnum:]:]* ' | sort | uniq| tee LT/out/listuniq
-cat LT/out/list | sed 's/0x[^ )]*[ )]/.*/g' | sort | uniq | tee LT/out/listuniq
+strings $LT/out/GDB > $LT/out/GDBs
+grep "#$UNIQUE_LINE " $LT/out/GDBs > $LT/out/list
+#cat $LT/out/list | grep -o ' in [[:alnum:]:]* ' | sort | uniq| tee $LT/out/listuniq
+#cat $LT/out/list | grep -o ' in [[:alnum:]:]* ' | sort | uniq| tee $LT/out/listuniq
+cat $LT/out/list | sed 's/0x[^ )]*[ )]/.*/g' | sort | uniq | tee $LT/out/listuniq
-NUM_REPORTS=`wc -l < LT/out/list`
+NUM_REPORTS=`wc -l < $LT/out/list`
echo NUM_REPORTS $NUM_REPORTS
-echo > LT/out/overview
+echo > $LT/out/overview
-cat LT/out/listuniq | while read l
+cat $LT/out/listuniq | while read l
do
#name=`echo $l | sed s/in// | sed 's/ //g'`
- grep "$l" -B $UNIQUE_LINE -A 100 LT/out/GDBs | head -n 100 | grep '#[0-9]' >LT/out/tmp
- name=`cat LT/out/tmp | ( grep -o ' in lyx::[[:alnum:]:]*' || cat LT/out/tmp | grep -o ' [ai][nt] [[:alnum:]:]*' ) | head -n1 | sed s/in// | sed 's/ //g'`
+ grep "$l" -B $UNIQUE_LINE -A 100 $LT/out/GDBs | head -n 100 | grep '#[0-9]' >$LT/out/tmp
+ name=`cat $LT/out/tmp | ( grep -o ' in lyx::[[:alnum:]:]*' || cat $LT/out/tmp | grep -o ' [ai][nt] [[:alnum:]:]*' ) | head -n1 | sed s/in// | sed 's/ //g'`
echo NAME: $name
echo L: $l
#out/list | grep -o ' in [[:alnum:]:]* ' | sort | uniq| tee out/listuniq
uname -r ; cat /etc/lsb-release| grep -i DISTRIB_DESCRIPTION
(cd src && svn info | grep Rev:)
echo
- NUM_OCCURANCES=`grep "$l" LT/out/list | wc -l`
+ NUM_OCCURANCES=`grep "$l" $LT/out/list | wc -l`
echo number_of_occurances: $NUM_OCCURANCES/$NUM_REPORTS
- echo -e $NUM_OCCURANCES "\t" $name >> LT/out/overview
- #echo grep "$l" LT/out/list
- #grep $l LT/out/GDB
+ echo -e $NUM_OCCURANCES "\t" $name >> $LT/out/overview
+ #echo grep "$l" $LT/out/list
+ #grep $l $LT/out/GDB
echo '{{{'
- grep "$l" -B $UNIQUE_LINE -A 100 LT/out/GDBs | head -n 100 | grep '#[0-9]'
+ grep "$l" -B $UNIQUE_LINE -A 100 $LT/out/GDBs | head -n 100 | grep '#[0-9]'
echo '}}}'
- ) | tee LT/out/report_$name
+ ) | tee $LT/out/report_$name
done
-cat LT/out/overview | sort -rn | tee LT/out/overview_sort
-#cp LT/out/r* LT/share/
-#cp LT/out/o* LT/share/
+cat $LT/out/overview | sort -rn | tee LT/out/overview_sort
+#cp $LT/out/r* $LT/share/
+#cp $LT/out/o* $LT/share/
#This script generated hundreds of random keypresses per second,
# and sends them to the lyx window
#It requires xvkbd and wmctrl
-#It generates a log of the KEYCODES it sends as LT/out/KEYCODES
+#It generates a log of the KEYCODES it sends as development/keystest/out/KEYCODES
import random
import os
for k in range(1,80):
keystr=keystr+keycode[random.randint(1,len(keycode))-1]
os.system("wmctrl -R LyX && xvkbd -xsendevent -text '"+keystr+"';sleep 1")
- #os.system("echo KEYCODES: '"+keystr+"' >> LT/out/GDB")
- os.system("echo `date +%s`: '"+keystr+"' >> LT/out/KEYCODES")
+ #os.system("echo KEYCODES: '"+keystr+"' >> development/keystest/out/GDB")
+ os.system("echo `date +%s`: '"+keystr+"' >> development/keystest/out/KEYCODES")