From b2b4fd50ec394366317ab457858b197a4f57a081 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sat, 31 Jul 2004 02:18:51 +0000 Subject: [PATCH] Portability fixes for test/QT.py. (Chad Austin) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1019 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- test/QT.py | 31 ++++++++++++++++++------------- test/README | 2 ++ test/option-v.py | 4 ++-- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/test/QT.py b/test/QT.py index 48794323..0f9e2baa 100644 --- a/test/QT.py +++ b/test/QT.py @@ -462,18 +462,15 @@ ENV = dummy_env['ENV'] try: PATH=ARGUMENTS['PATH'] if ENV.has_key('PATH'): - ENV_PATH = PATH + ':' + ENV['PATH'] + ENV_PATH = PATH + os.pathsep + ENV['PATH'] else: Exit(0) # this is certainly a weird system :-) except KeyError: - if ENV.has_key('PATH'): - ENV_PATH=dummy_env['ENV']['PATH'] - else: - ENV_PATH='' - pass + ENV_PATH=ENV.get('PATH', '') env = Environment(tools=['default','qt'], ENV={'PATH':ENV_PATH, + 'PATHEXT':os.environ.get('PATHEXT'), 'HOME':os.getcwd()}, # moc / uic want to write stuff in ~/.qt CXXFILESUFFIX=".cpp") @@ -564,19 +561,22 @@ int main() { QTDIR=os.environ['QTDIR'] del os.environ['QTDIR'] + PATH=os.environ['PATH'] + os.environ['PATH']='.' test.run(chdir='work7', stderr=None, arguments="-c test_realqt" + _exe) test.fail_test(not test.match_re(test.stderr(), r""" scons: warning: Could not detect qt, using empty QTDIR -File "SConstruct", line \d+, in .+ +File "[^\"]*", line \d+, in .+ """)) + os.environ['PATH'] = PATH + test.run(chdir='work7', stderr=None, - arguments="PATH=%s/bin test_realqt%s"%(QTDIR,_exe)) - + arguments="PATH=%s%sbin test_realqt%s"%(QTDIR,os.sep,_exe)) test.fail_test(not test.match_re(test.stderr(), r""" scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\) -File "SConstruct", line \d+, in .+ +File "[^\"]*", line \d+, in .+ """ % (re.escape(QTDIR)))) @@ -826,10 +826,15 @@ env.StaticLibrary('aaa.cpp') """) test.run(chdir='work12', stderr=None) -test.fail_test(not test.match_re(test.stderr(), r""" + +match12 = r""" scons: warning: Generated moc file 'aaa.moc' is not included by 'aaa.cpp' File .+ -""")) +""" + +# In case 'ar' gives a warning about creating a library. +test.fail_test(not test.match_re(test.stderr(), match12) and \ + not test.match_re(test.stderr(), match12 + ".+\n")) os.environ['QTDIR'] = QT test.run(chdir='work12', arguments='-n noqtdir=1') @@ -845,7 +850,7 @@ os.environ['QTDIR'] = '' test.run(chdir='work12', stderr=None, arguments='-n noqtdir=1') test.fail_test(not test.match_re(test.stderr(), r""" scons: warning: Could not detect qt, using empty QTDIR -File "SConstruct", line \d+, in .+ +File "[^\"]*", line \d+, in .+ """)) test.pass_test() diff --git a/test/README b/test/README index 1fa43b90..cc27ffe1 100644 --- a/test/README +++ b/test/README @@ -1,3 +1,5 @@ +__COPYRIGHT__ + This directory contains our end-to-end SCons tests. They are all meant to be run essentially standalone, with the exception diff --git a/test/option-v.py b/test/option-v.py index d1078c0e..6a0aaf72 100644 --- a/test/option-v.py +++ b/test/option-v.py @@ -37,13 +37,13 @@ test.write('SConstruct', "") # depending on whether it's invoked through scons.py or scons.bat. expect1 = r"""SCons by Steven Knight et al.: \tengine: v\S+, [^,]*, by \S+ on \S+ -(__COPYRIGHT__|Copyright \(c\) 2001, 2002, 2003, 2004 Steven Knight) +(__COPYRIGHT__|Copyright \(c\) 2001, 2002, 2003, 2004 The SCons Foundation) """ expect2 = r"""SCons by Steven Knight et al.: \tscript: v\S+, [^,]*, by \S+ on \S+ \tengine: v\S+, [^,]*, by \S+ on \S+ -(__COPYRIGHT__|Copyright \(c\) 2001, 2002, 2003, 2004 Steven Knight) +(__COPYRIGHT__|Copyright \(c\) 2001, 2002, 2003, 2004 The SCons Foundation) """ test.run(arguments = '-v') -- 2.26.2