summaryrefslogtreecommitdiff
path: root/test/QT
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-08-14 06:00:06 +0000
committerSteven Knight <knight@baldmt.com>2005-08-14 06:00:06 +0000
commit1923dc337f9f98c3e08b95654dea4b34084c6302 (patch)
tree359dd0ea59c350586d639773ea945ad98dd0ce7d /test/QT
parenta941b68612df943f6addacc59cd1ff3aa47b5907 (diff)
downloadscons-1923dc337f9f98c3e08b95654dea4b34084c6302.tar.gz
Update more tests to use the new skip_test() method. Replace a CHANGES.txt comment inadvertently deleted.
Diffstat (limited to 'test/QT')
-rw-r--r--test/QT/installed.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/test/QT/installed.py b/test/QT/installed.py
index 14aad260..6b06d376 100644
--- a/test/QT/installed.py
+++ b/test/QT/installed.py
@@ -31,14 +31,15 @@ Look if qt is installed, and try out all builders.
import os
import re
import string
+import sys
import TestSCons
test = TestSCons.TestSCons()
if not os.environ.get('QTDIR', None):
- print "Could not find QT, skipping test(s)."
- test.no_result(1)
+ x ="External environment variable $QTDIR not set; skipping test(s).\n"
+ test.skip_test(x)
test.Qt_dummy_installation()
@@ -175,8 +176,24 @@ int main(int argc, char **argv) {
test.run(arguments="bld/test_realqt" + TestSCons._exe)
+
test.run(program=test.workpath("bld", "test_realqt"),
- stdout="Hello World\n")
+ stdout=None,
+ status=None,
+ stderr=None)
+
+if test.stdout() != "Hello World\n" or test.stderr() != '' or test.status:
+ sys.stdout.write(test.stdout())
+ sys.stderr.write(test.stderr())
+ # The test might be run on a system that doesn't have an X server
+ # running, or may be run by an ID that can't connect to the server.
+ # If so, then print whatever it showed us (which is in and of itself
+ # an indication that it built correctly) but don't fail the test.
+ expect = 'cannot connect to X server'
+ test.fail_test(test.stdout() != '' or
+ string.find(test.stderr(), expect) == -1 or \
+ (test.status>>8) != 1)
+
QTDIR = os.environ['QTDIR']
PATH = os.environ['PATH']
@@ -191,4 +208,5 @@ expect2 = "scons: warning: Could not detect qt, using moc executable as a hint"
test.fail_test(string.find(test.stderr(), expect1) == -1 and
string.find(test.stderr(), expect2) == -1)
+
test.pass_test()