diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
commit | 22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch) | |
tree | 0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/QT | |
parent | 75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff) | |
download | SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2 |
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible;
the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'test/QT')
-rw-r--r-- | test/QT/QTFLAGS.py | 3 | ||||
-rw-r--r-- | test/QT/Tool.py | 8 | ||||
-rw-r--r-- | test/QT/copied-env.py | 8 | ||||
-rw-r--r-- | test/QT/generated-ui.py | 2 | ||||
-rw-r--r-- | test/QT/installed.py | 9 | ||||
-rw-r--r-- | test/QT/manual.py | 2 | ||||
-rw-r--r-- | test/QT/source-from-ui.py | 3 | ||||
-rw-r--r-- | test/QT/up-to-date.py | 3 | ||||
-rw-r--r-- | test/QT/warnings.py | 3 |
9 files changed, 16 insertions, 25 deletions
diff --git a/test/QT/QTFLAGS.py b/test/QT/QTFLAGS.py index 62155fd..008397a 100644 --- a/test/QT/QTFLAGS.py +++ b/test/QT/QTFLAGS.py @@ -147,9 +147,8 @@ test.must_exist(['work1', 'mmmmocFromH.cxx'], ['work1', 'mmmanother_ui_file.cxx']) def _flagTest(test,fileToContentsStart): - import string for f,c in fileToContentsStart.items(): - if string.find(test.read(test.workpath('work1', f)), c) != 0: + if test.read(test.workpath('work1', f)).find(c) != 0: return 1 return 0 diff --git a/test/QT/Tool.py b/test/QT/Tool.py index 86eb4ca..63fb113 100644 --- a/test/QT/Tool.py +++ b/test/QT/Tool.py @@ -90,7 +90,7 @@ def CheckForQt(context): "/usr/pkg/qt3" # pkgsrc (NetBSD) ] - if os.environ.has_key('QTDIR'): + if 'QTDIR' in os.environ: potential_qt_dirs.insert(0, os.environ[ 'QTDIR' ]) if env[ 'qt_directory' ] != "/": @@ -125,10 +125,8 @@ def CheckForQt(context): return 0 def AttemptLinkWithVariables(context, variables, code, extension, prefix): - return DoWithVariables(variables, - prefix, - lambda c=context, code=code, e=extension: - c.TryLink(code, e)) + return DoWithVariables(variables, prefix, + lambda: context.TryLink(code, extension)) env = Environment(CPPPATH=['.'], LIBPATH=['.'], LIBS=[]) diff --git a/test/QT/copied-env.py b/test/QT/copied-env.py index f68e1db..63083da 100644 --- a/test/QT/copied-env.py +++ b/test/QT/copied-env.py @@ -21,6 +21,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -28,8 +29,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test Qt with a copied construction environment. """ -import string - import TestSCons test = TestSCons.TestSCons() @@ -68,10 +67,9 @@ void aaa(void) test.run() -moc_MyForm = filter(lambda x: string.find(x, 'moc_MyForm') != -1, - string.split(test.stdout(), '\n')) +moc_MyForm = [x for x in test.stdout().split('\n') if x.find('moc_MyForm') != -1] -MYLIB_IMPL = filter(lambda x: string.find(x, 'MYLIB_IMPL') != -1, moc_MyForm) +MYLIB_IMPL = [x for x in moc_MyForm if x.find('MYLIB_IMPL') != -1] if not MYLIB_IMPL: print "Did not find MYLIB_IMPL on moc_MyForm compilation line:" diff --git a/test/QT/generated-ui.py b/test/QT/generated-ui.py index e01a633..e4632b1 100644 --- a/test/QT/generated-ui.py +++ b/test/QT/generated-ui.py @@ -47,7 +47,7 @@ import os aa=os.getcwd() env=Environment(tools=['default','expheaders','qt'],toolpath=[aa]) -if os.environ.has_key('HOME'): +if 'HOME' in os.environ: env['ENV']['HOME'] = os.environ['HOME'] env["EXP_HEADER_ABS"]=os.path.join(os.getcwd(),'include') if not os.access(env["EXP_HEADER_ABS"],os.F_OK): diff --git a/test/QT/installed.py b/test/QT/installed.py index c79f958..2661377 100644 --- a/test/QT/installed.py +++ b/test/QT/installed.py @@ -29,7 +29,6 @@ Look if qt is installed, and try out all builders. """ import os -import string import sys import TestSCons @@ -51,7 +50,7 @@ dummy_env = Environment() ENV = dummy_env['ENV'] try: PATH=ARGUMENTS['PATH'] - if ENV.has_key('PATH'): + if 'PATH' in ENV: ENV_PATH = PATH + os.pathsep + ENV['PATH'] else: Exit(0) # this is certainly a weird system :-) @@ -191,7 +190,7 @@ if test.stdout() != "Hello World\n" or test.stderr() != '' or test.status: # an indication that it built correctly) but don't fail the test. expect = 'cannot connect to X server' test.fail_test(test.stdout()) - test.fail_test(string.find(test.stderr(), expect) == -1) + test.fail_test(test.stderr().find(expect) == -1) if test.status != 1 and (test.status>>8) != 1: sys.stdout.write('test_realqt returned status %s\n' % test.status) test.fail_test() @@ -206,8 +205,8 @@ test.run(stderr=None, arguments="-c bld/test_realqt" + TestSCons._exe) expect1 = "scons: warning: Could not detect qt, using empty QTDIR" 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.fail_test(test.stderr().find(expect1) == -1 and + test.stderr().find(expect2) == -1) test.pass_test() diff --git a/test/QT/manual.py b/test/QT/manual.py index dcab3aa..ff38f32 100644 --- a/test/QT/manual.py +++ b/test/QT/manual.py @@ -56,7 +56,7 @@ env.Moc('moc_eee.cpp', 'eee.cpp') sources.extend(env.Uic(['include/uic_fff.hpp', 'fff.cpp', 'fff.moc.cpp'], 'ui/fff.ui')[1:]) -print map(str,sources) +print list(map(str,sources)) env.Program(target='aaa', source=sources, CPPPATH=['$CPPPATH', './include'], diff --git a/test/QT/source-from-ui.py b/test/QT/source-from-ui.py index 6cffecc..38cc8c8 100644 --- a/test/QT/source-from-ui.py +++ b/test/QT/source-from-ui.py @@ -29,7 +29,6 @@ Create .cpp, .h, moc_....cpp from a .ui file. """ import os.path -import string import TestSCons @@ -126,7 +125,7 @@ test.must_not_exist(test.workpath(cpp)) test.must_not_exist(test.workpath(h)) cppContents = test.read(test.workpath('build', cpp)) -test.fail_test(string.find(cppContents, '#include "aaa.ui.h"') == -1) +test.fail_test(cppContents.find('#include "aaa.ui.h"') == -1) test.run(arguments = "variant_dir=1 chdir=1 " + test.workpath('build', aaa_dll) ) diff --git a/test/QT/up-to-date.py b/test/QT/up-to-date.py index fbbcac0..21c758e 100644 --- a/test/QT/up-to-date.py +++ b/test/QT/up-to-date.py @@ -34,7 +34,6 @@ ca. September 2005.) """ import os -import string import TestSCons @@ -133,7 +132,7 @@ my_obj = 'layer/aclock/qt_bug/my'+_obj test.run(arguments = my_obj, stderr=None) -expect = string.replace( my_obj, '/', os.sep ) +expect = my_obj.replace( '/', os.sep ) test.up_to_date(options = '--debug=explain', arguments = (expect), stderr=None) diff --git a/test/QT/warnings.py b/test/QT/warnings.py index 975091b..a861b24 100644 --- a/test/QT/warnings.py +++ b/test/QT/warnings.py @@ -30,7 +30,6 @@ Test the Qt tool warnings. import os import re -import string import TestSCons @@ -82,7 +81,7 @@ moc = test.where_is('moc') if moc: import os.path qtdir = os.path.dirname(os.path.dirname(moc)) - qtdir = string.replace(qtdir, '\\', '\\\\' ) + qtdir = qtdir.replace('\\', '\\\\' ) expect = """ scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\) |