summaryrefslogtreecommitdiffstats
path: root/test/QT
diff options
context:
space:
mode:
Diffstat (limited to 'test/QT')
-rw-r--r--test/QT/QTFLAGS.py6
-rw-r--r--test/QT/moc-from-header.py6
-rw-r--r--test/QT/warnings.py17
3 files changed, 21 insertions, 8 deletions
diff --git a/test/QT/QTFLAGS.py b/test/QT/QTFLAGS.py
index f9cb917..ba08739 100644
--- a/test/QT/QTFLAGS.py
+++ b/test/QT/QTFLAGS.py
@@ -31,7 +31,7 @@ Testing the configuration mechanisms of the 'qt' tool.
import TestSCons
import os.path
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -123,8 +123,8 @@ test.run(chdir=test.workpath('qt','lib'), arguments = '.',
QT = test.workpath('qt')
QT_LIB = 'myqt'
-QT_MOC = '%s %s' % (python, test.workpath('qt','bin','mymoc.py'))
-QT_UIC = '%s %s' % (python, test.workpath('qt','bin','myuic.py'))
+QT_MOC = '%s %s' % (_python_, test.workpath('qt','bin','mymoc.py'))
+QT_UIC = '%s %s' % (_python_, test.workpath('qt','bin','myuic.py'))
def createSConstruct(test,place,overrides):
test.write(place, """
diff --git a/test/QT/moc-from-header.py b/test/QT/moc-from-header.py
index 0bf6873..1dbcd0f 100644
--- a/test/QT/moc-from-header.py
+++ b/test/QT/moc-from-header.py
@@ -28,6 +28,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Create a moc file from a header file.
"""
+import os
+
import TestSCons
test = TestSCons.TestSCons()
@@ -38,6 +40,10 @@ env = Environment()
test.Qt_dummy_installation()
+# We'll run some test programs later that need to find our dummy
+# Qt library.
+os.environ['LD_LIBRARY_PATH'] = test.QT_LIB_DIR
+
##############################################################################
aaa_exe = 'aaa' + TestSCons._exe
diff --git a/test/QT/warnings.py b/test/QT/warnings.py
index 7b41360..0fd3f66 100644
--- a/test/QT/warnings.py
+++ b/test/QT/warnings.py
@@ -29,15 +29,18 @@ Test the Qt tool warnings.
"""
import os
+import re
import string
import TestSCons
test = TestSCons.TestSCons()
+SConstruct_path = test.workpath('SConstruct')
+
test.Qt_dummy_installation()
-test.Qt_create_SConstruct('SConstruct')
+test.Qt_create_SConstruct(SConstruct_path)
test.write('aaa.cpp', r"""
#include "my_qobject.h"
@@ -77,15 +80,19 @@ test.run(stderr=None, arguments='-n noqtdir=1')
moc = test.where_is('moc')
if moc:
import os.path
+ qtdir = os.path.dirname(os.path.dirname(moc))
+ qtdir = string.replace(qtdir, '\\', '\\\\' )
+
expect = """
scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\)
-File "SConstruct", line \d+, in \?
-""" % string.replace( os.path.dirname(os.path.dirname(moc)), '\\', '\\\\' )
+File "%s", line \d+, in \?
+""" % (qtdir, re.escape(SConstruct_path))
else:
+
expect = """
scons: warning: Could not detect qt, using empty QTDIR
-File "SConstruct", line \d+, in \?
-"""
+File "%s", line \d+, in \?
+""" % re.escape(SConstruct_path)
test.fail_test(not test.match_re(test.stderr(), expect))