diff options
author | Steven Knight <knight@baldmt.com> | 2006-02-15 05:14:30 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2006-02-15 05:14:30 (GMT) |
commit | 2708dc3927775a374fc94a6996ebe09e70705e60 (patch) | |
tree | e58962d58516f26ff0babcdb67a58435a4019f07 /test | |
parent | e7190df6b6aa89dac0370dc01ae45ff39254c221 (diff) | |
download | SCons-2708dc3927775a374fc94a6996ebe09e70705e60.zip SCons-2708dc3927775a374fc94a6996ebe09e70705e60.tar.gz SCons-2708dc3927775a374fc94a6996ebe09e70705e60.tar.bz2 |
More test portability fixes. (Baptiste Lepilleur and SK)
Diffstat (limited to 'test')
-rw-r--r-- | test/Case.py | 2 | ||||
-rw-r--r-- | test/QT/generated-ui.py | 3 | ||||
-rw-r--r-- | test/QT/installed.py | 3 | ||||
-rw-r--r-- | test/QT/up-to-date.py | 8 | ||||
-rw-r--r-- | test/QT/warnings.py | 3 | ||||
-rw-r--r-- | test/ZIP/ZIP.py | 8 | ||||
-rw-r--r-- | test/bad-drive.py | 8 | ||||
-rw-r--r-- | test/option/debug-stree.py | 55 |
8 files changed, 56 insertions, 34 deletions
diff --git a/test/Case.py b/test/Case.py index dd782ab..18fb60a 100644 --- a/test/Case.py +++ b/test/Case.py @@ -36,7 +36,7 @@ test.write('SConstruct', """\ Program('main', [ 'main.c', Object('foo.o', 'foo.c'), - Object('FOO.O', 'bar.c')]) + Object('FOO.o', 'bar.c')]) """) test.write('main.c', """\ diff --git a/test/QT/generated-ui.py b/test/QT/generated-ui.py index 7125dd9..991047d 100644 --- a/test/QT/generated-ui.py +++ b/test/QT/generated-ui.py @@ -47,7 +47,8 @@ import os aa=os.getcwd() env=Environment(tools=['default','expheaders','qt'],toolpath=[aa]) -env['ENV']['HOME'] = os.environ['HOME'] +if os.environ.has_key('HOME'): + 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): os.mkdir (env["EXP_HEADER_ABS"]) diff --git a/test/QT/installed.py b/test/QT/installed.py index 6b06d37..8cb9ab1 100644 --- a/test/QT/installed.py +++ b/test/QT/installed.py @@ -62,7 +62,8 @@ except KeyError: env = Environment(tools=['default','qt'], ENV={'PATH':ENV_PATH, 'PATHEXT':os.environ.get('PATHEXT'), - 'HOME':os.getcwd()}, + 'HOME':os.getcwd(), + 'SYSTEMROOT':ENV.get('SYSTEMROOT')}, # moc / uic want to write stuff in ~/.qt CXXFILESUFFIX=".cpp") diff --git a/test/QT/up-to-date.py b/test/QT/up-to-date.py index 46b9db8..b6ebfdf 100644 --- a/test/QT/up-to-date.py +++ b/test/QT/up-to-date.py @@ -34,6 +34,7 @@ ca. September 2005.) """ import os +import string import TestSCons @@ -129,10 +130,13 @@ test.write(['layer', 'aclock', 'qt_bug', 'my.cc'], """\ #include <main.h> """) -test.run(arguments = 'layer/aclock/qt_bug/my'+_obj, stderr=None) +my_obj = 'layer/aclock/qt_bug/my'+_obj +test.run(arguments = my_obj, stderr=None) + +expect = string.replace( my_obj, '/', os.sep ) test.up_to_date(options = '--debug=explain', - arguments = 'layer/aclock/qt_bug/my'+_obj, + arguments = (expect), stderr=None) test.pass_test() diff --git a/test/QT/warnings.py b/test/QT/warnings.py index 3741079..7b41360 100644 --- a/test/QT/warnings.py +++ b/test/QT/warnings.py @@ -29,6 +29,7 @@ Test the Qt tool warnings. """ import os +import string import TestSCons @@ -79,7 +80,7 @@ if moc: expect = """ scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\) File "SConstruct", line \d+, in \? -""" % os.path.dirname(os.path.dirname(moc)) +""" % string.replace( os.path.dirname(os.path.dirname(moc)), '\\', '\\\\' ) else: expect = """ scons: warning: Could not detect qt, using empty QTDIR diff --git a/test/ZIP/ZIP.py b/test/ZIP/ZIP.py index d92c0be..33c54dd 100644 --- a/test/ZIP/ZIP.py +++ b/test/ZIP/ZIP.py @@ -35,6 +35,14 @@ python = TestSCons.python test = TestSCons.TestSCons() +try: + import zipfile +except ImportError: + zip = test.where_is('zip') + if not zip: + x = "Python version has no 'ziplib' module nor 'zip' utility; skipping tests.\n" + test.skip_test(x) + test.subdir('sub1') test.write('myzip.py', r"""\ diff --git a/test/bad-drive.py b/test/bad-drive.py index 4c081a5..a642a7c 100644 --- a/test/bad-drive.py +++ b/test/bad-drive.py @@ -86,8 +86,14 @@ test.run(arguments = 'aaa.out') test.fail_test(test.read('aaa.out') != "aaa.in\n") +# This next test used to provide a slightly different error message: +# "scons: *** Do not know how to make target `%snot_mentioned'. Stop.\n" +# Right now, it doesn't seem important enough to track down exactly +# why this changed and fix it, but we'll preserve it here in case it +# becomes an issue or some refactoring restores the old behavior. + test.run(arguments = bad_drive + 'not_mentioned', - stderr = "scons: *** Do not know how to make target `%snot_mentioned'. Stop.\n" % (bad_drive,), + stderr = "scons: *** No drive `%s' for target `%snot_mentioned'. Stop.\n" % (bad_drive, bad_drive), status = 2) test.run(arguments = bad_drive + 'no_target_1', diff --git a/test/option/debug-stree.py b/test/option/debug-stree.py index 4132927..69aab06 100644 --- a/test/option/debug-stree.py +++ b/test/option/debug-stree.py @@ -71,39 +71,40 @@ test.write('bar.h', """ """) stree = """ -[E B C]+-foo.xxx -[E B C] +-foo.ooo -[E ] | +-foo.c -[E ] | +-foo.h -[E ] | +-bar.h -[E B C] +-bar.ooo -[E ] +-bar.c -[E ] +-bar.h -[E ] +-foo.h +[E B C ]+-foo.xxx +[E B C ] +-foo.ooo +[E ] | +-foo.c +[E ] | +-foo.h +[E ] | +-bar.h +[E B C ] +-bar.ooo +[E ] +-bar.c +[E ] +-bar.h +[E ] +-foo.h """ test.run(arguments = "--debug=stree foo.xxx") test.fail_test(string.find(test.stdout(), stree) == -1) stree2 = """ - E = exists - R = exists in repository only - b = implicit builder - B = explicit builder - S = side effect - P = precious - A = always build - C = current - -[ B ]+-foo.xxx -[ B ] +-foo.ooo -[E ] | +-foo.c -[E ] | +-foo.h -[E ] | +-bar.h -[ B ] +-bar.ooo -[E ] +-bar.c -[E ] +-bar.h -[E ] +-foo.h + E = exists + R = exists in repository only + b = implicit builder + B = explicit builder + S = side effect + P = precious + A = always build + C = current + N = no clean + +[ B ]+-foo.xxx +[ B ] +-foo.ooo +[E ] | +-foo.c +[E ] | +-foo.h +[E ] | +-bar.h +[ B ] +-bar.ooo +[E ] +-bar.c +[E ] +-bar.h +[E ] +-foo.h """ test.run(arguments = '-c foo.xxx') |