Willie Walker wrote:
Here's
something that uses trace2html (forgot to attach this in last night's
e-mail).
Hi Will,
I applied the patch and ran runall.sh on the entire keystrokes
directory. trace2html generated a very nice presentation. We still
need to get more detailed information, and I'll look into that. One
thing that a bit off, is that the code coverage is about 10% overly
optimistic about the coverage. For example, the graph shows that the
where_am_I module has 10% coverage, but all the where_am_I.py code is
highlighted, except for the method declarations. Another thing that
makes me suspect that trace2html is overly optimistic, is that
coverage.py indicated that 30% of the StarOffice module was covered,
but trace2html says that the coverage is 40%. I'll look into this.
Lynn
Will
Index: test/harness/runone.sh
===================================================================
--- test/harness/runone.sh (revision 2067)
+++ test/harness/runone.sh (working copy)
@@ -7,24 +7,6 @@
debugFile=`basename $1 .keys`
-# Set up our local user settings file for the output format we want.
-#
-# If a <testfilename>.settings file exists, should use that instead of
-# the default user-settings.py.in.
-# We still need to run sed on it, to adjust the debug filename and
-# create a user-settings.py file in the tmp directory.
-#
-# (Orca will look in our local directory first for user-settings.py
-# before looking in ~/.orca)
-#
-SETTINGS_FILE=`dirname $1`/$debugFile.settings
-if [ ! -f $SETTINGS_FILE ]
-then
- SETTINGS_FILE=`dirname $0`/user-settings.py.in
-fi
-echo "Using settings file:" $SETTINGS_FILE
-sed "s^%debug%^$debugFile.orca^g" $SETTINGS_FILE > user-settings.py
-
# Run the event listener...
#
# python `dirname $0`/event_listener.py > $debugFile.events &
@@ -32,17 +14,40 @@
# Run orca and let it settle in.
#
-orca &
-sleep 5
-
-# Run the app (or gnome-terminal if no app was given) and let it settle in.
-#
-if [ -n "$2" ]
-then
- APP_NAME=$2
+if [ -n "$3" ]
+then
+ APP_NAME=$2
+ coverageMode=$3
else
APP_NAME=gnome-terminal
+ coverageMode=$2
fi
+
+echo "coverageMode=" $coverageMode
+
+if [ "$coverageMode" -eq 0 ]
+then
+ # Set up our local user settings file for the output format we want.
+ #
+ # If a <testfilename>.settings file exists, should use that instead of
+ # the default user-settings.py.in.
+ # We still need to run sed on it, to adjust the debug filename and
+ # create a user-settings.py file in the tmp directory.
+ #
+ # (Orca will look in our local directory first for user-settings.py
+ # before looking in ~/.orca)
+ #
+ SETTINGS_FILE=`dirname $1`/$debugFile.settings
+ if [ ! -f $SETTINGS_FILE ]
+ then
+ SETTINGS_FILE=`dirname $0`/user-settings.py.in
+ fi
+ echo "Using settings file:" $SETTINGS_FILE
+ sed "s^%debug%^$debugFile.orca^g" $SETTINGS_FILE > user-settings.py
+ orca &
+ sleep 5
+fi
+
$APP_NAME &
APP_PID=$!
sleep 5
@@ -53,8 +58,14 @@
# Terminate the running application and Orca
#
-orca --quit > /dev/null 2>&1
+if [ "$coverageMode" -eq 0 ]
+then
+ orca --quit > /dev/null 2>&1
+fi
kill -9 $APP_PID > /dev/null 2>&1
-rm user-settings.py*
+if [ "$coverageMode" -eq 0 ]
+then
+ rm user-settings.py*
+fi
Index: test/harness/runorca.py
===================================================================
--- test/harness/runorca.py (revision 0)
+++ test/harness/runorca.py (revision 0)
@@ -0,0 +1,2 @@
+import orca.orca
+orca.orca.main()
Index: test/harness/runall.sh
===================================================================
--- test/harness/runall.sh (revision 2067)
+++ test/harness/runall.sh (working copy)
@@ -13,9 +13,14 @@
keystrokesDir=$harnessDir/../keystrokes
resultsDir=$harnessDir/../results
+coverageMode=0
+
process_cl () {
while [ $# != 0 ]; do
case "$1" in
+ -c )
+ coverageMode=1
+ ;;
-k )
shift
if [ $# == 0 ]; then
@@ -38,6 +43,7 @@
-h|--help)
echo "Usage: $0 [options]"
echo "options:"
+ echo " -c perform code coverage analysis"
echo " -h, --help print this usage message"
echo " -k keystrokeDir specify an alternate keystrokes directory"
echo " -r resultsDir specify an alternate results directory"
@@ -57,6 +63,14 @@
#
process_cl "${ }"
+if [ "$coverageMode" -eq 1 ]
+then
+ sed "s^%debug%^$debugFile.orca^g" user-settings.py.in > user-settings.py
+ trace2html.py -w orca -r runorca.py &
+ trace_pid=$!
+ sleep 5
+fi
+
# Look in the keystrokes directory for directories.
# The name of each directory under the keystrokes directory
# is expected to be the name of an application to run. For
@@ -109,7 +123,7 @@
echo Running $testFile
if [ "$found" -gt 0 ]
then
- $harnessDir/runone.sh $testFile $application
+ $harnessDir/runone.sh $testFile $application $coverageMode
else
osType=`uname`
for os in $OPERATING_SYSTEMS; do
@@ -118,13 +132,13 @@
found=1
if [ $osType == $os ]
then
- $harnessDir/runone.sh $testFile
+ $harnessDir/runone.sh $testFile $coverageMode
fi
fi
done
if [ "$found" -eq 0 ]
then
- $harnessDir/runone.sh $testFile
+ $harnessDir/runone.sh $testFile $coverageMode
fi
fi
sleep 5
|