From: Thomas Fitzsimmons <fitzsim@redhat.com>
To: mauve-discuss@sources.redhat.com
Subject: Patch: GUI testing framework
Date: Mon, 03 Jan 2005 23:37:00 -0000 [thread overview]
Message-ID: <1104795399.6374.117.camel@tortoise.toronto.redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 665 bytes --]
Hi,
This patch adds support to batch_run for running GUI tests, either
within an Xvfb server (default) or directly on the tester's desktop. It
also introduces the GUI tag; all tests that require DISPLAY to be set
should be tagged as GUI tests.
I tested this with the java.awt.Robot tests I posted last week. The
tests run properly both within Xvfb and on my desktop.
I would like to rely on the metacity window manager, since it handles
inset sizing correctly.
Comments?
Tom
2005-01-03 Thomas Fitzsimmons <fitzsim@redhat.com>
* batch_run: Invoke Xvfb and metacity if GUI key is specified.
* choose: Handle GUI tag.
* README: Add section on GUI tests.
[-- Attachment #2: Type: text/x-patch, Size: 2859 bytes --]
Index: README
===================================================================
RCS file: /cvs/mauve/mauve/README,v
retrieving revision 1.18
diff -u -r1.18 README
--- README 12 Aug 2004 15:11:12 -0000 1.18
+++ README 3 Jan 2005 23:23:53 -0000
@@ -172,6 +172,15 @@
================================================================
+Graphical tests that display windows and accept input are marked with
+the GUI tag. GUI tests are not included in the default list of tags.
+If the GUI tag does appear in KEYS, batch_run will spawn an Xvfb
+process, set DISPLAY to that X server and run the
+graphical/interactive tests there. If you'd rather run the tests
+directly on your desktop, set SHOW_GUI_TESTS=1.
+
+================================================================
+
The test harness can also ignore known failures. Simply create a
file 'xfails' in the directory where the tests are being run which
contains 'FAIL:' entries from previous test runs. The order of the
Index: batch_run
===================================================================
RCS file: /cvs/mauve/mauve/batch_run,v
retrieving revision 1.5
diff -u -r1.5 batch_run
--- batch_run 19 Nov 2004 10:09:28 -0000 1.5
+++ batch_run 3 Jan 2005 23:23:53 -0000
@@ -63,6 +63,30 @@
# Generate test classes list
./choose-classes . "$KEYS"
+case $KEYS in
+ *GUI*)
+
+ XVFB=`which Xvfb`
+ METACITY=`which metacity`
+
+ if test -z "$SHOW_GUI_TESTS"; then
+ if test -z $XVFB; then
+ echo "warning: Xvfb not found on PATH. Showing GUI tests on main desktop..."
+ elif test -z $METACITY; then
+ echo "warning: metacity not found on PATH. Showing GUI tests on main desktop..."
+ else
+ export DISPLAY=:57
+ echo localhost > Xvfb.cfg
+ $XVFB :57 -auth Xvfb.cfg > /dev/null 2>&1 &
+ XVFB_PID=$!
+ $METACITY > /dev/null 2>&1 &
+ METACITY_PID=$!
+ rm -f Xvfb.cfg
+ fi
+ fi
+ ;;
+esac
+
# Compile and run all the tests
for testclass in `cat test_classes`; do
# Get all needed java sources
@@ -81,3 +105,13 @@
echo "FAIL: $testclass COMPILE FAILED"
fi
done
+
+case $KEYS in
+ *GUI*)
+
+ # killing Xvfb also kills the window manager process
+ if test ! -z "$XVFB_PID"; then
+ kill $XVFB_PID > /dev/null 2>&1
+ fi
+ ;;
+esac
Index: choose
===================================================================
RCS file: /cvs/mauve/mauve/choose,v
retrieving revision 1.25
diff -u -r1.25 choose
--- choose 14 Oct 2004 06:53:07 -0000 1.25
+++ choose 3 Jan 2005 23:23:53 -0000
@@ -69,6 +69,10 @@
# You can't specify this.
:
;;
+ GUI)
+ tags="$tags GUI $i"
+ test -z "$seen_dashdash" && spectags="$spectags $i"
+ ;;
JAVA2)
tags="$tags JDK1.0 JDK1.1 JDK1.2 $i"
test -z "$seen_dashdash" && spectags="$spectags $i"
next reply other threads:[~2005-01-03 23:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 23:37 Thomas Fitzsimmons [this message]
2005-01-04 8:31 ` Thomas Zander
2005-01-04 18:08 ` Thomas Fitzsimmons
2005-01-04 21:16 ` Thomas Fitzsimmons
2005-01-04 9:01 ` Michael Koch
2005-01-04 16:39 ` Thomas Fitzsimmons
2005-01-04 17:35 ` Michael Koch
2005-01-04 18:28 ` Thomas Fitzsimmons
2005-01-04 19:28 ` Tom Tromey
2005-01-04 21:08 ` Michael Koch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1104795399.6374.117.camel@tortoise.toronto.redhat.com \
--to=fitzsim@redhat.com \
--cc=mauve-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).