diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-09-16 16:24:21 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-09-16 16:24:21 (GMT) |
commit | caabe8248c727925f4158aa074ac472e033361fc (patch) | |
tree | e1de5248d67927e1980bc5ad91b693bb6af12da7 /src | |
parent | 71e49a9594f1ece94cc9011647ba81018338259e (diff) | |
parent | 299a549ae875c18748f395aca51068e27ac0d489 (diff) | |
download | SCons-caabe8248c727925f4158aa074ac472e033361fc.zip SCons-caabe8248c727925f4158aa074ac472e033361fc.tar.gz SCons-caabe8248c727925f4158aa074ac472e033361fc.tar.bz2 |
Merged in dirkbaechle/scons (pull request #36): test cleanups and fixes.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/SubstTests.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/JavaCommon.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gettext.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Tool/javacTests.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvsTests.py | 11 |
5 files changed, 18 insertions, 12 deletions
diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py index 4568528..420fd73 100644 --- a/src/engine/SCons/SubstTests.py +++ b/src/engine/SCons/SubstTests.py @@ -554,6 +554,8 @@ class scons_subst_TestCase(SubstTestCase): "TypeError `'NoneType' object is unsubscriptable' trying to evaluate `${NONE[2]}'", # Python 2.7 and later "TypeError `'NoneType' object is not subscriptable' trying to evaluate `${NONE[2]}'", + # Python 2.7 and later under Fedora + "TypeError `'NoneType' object has no attribute '__getitem__'' trying to evaluate `${NONE[2]}'", ] assert str(e) in expect, e else: diff --git a/src/engine/SCons/Tool/JavaCommon.py b/src/engine/SCons/Tool/JavaCommon.py index c64d254..156ef97 100644 --- a/src/engine/SCons/Tool/JavaCommon.py +++ b/src/engine/SCons/Tool/JavaCommon.py @@ -64,7 +64,7 @@ if java_parsing: interfaces, and anonymous inner classes.""" def __init__(self, version=default_java_version): - if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', + if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', '1.7', '5', '6'): msg = "Java version %s not supported" % version raise NotImplementedError(msg) @@ -171,7 +171,7 @@ if java_parsing: if self.version in ('1.1', '1.2', '1.3', '1.4'): clazz = self.listClasses[0] self.listOutputs.append('%s$%d' % (clazz, self.nextAnon)) - elif self.version in ('1.5', '1.6', '5', '6'): + elif self.version in ('1.5', '1.6', '1.7', '5', '6'): self.stackAnonClassBrackets.append(self.brackets) className = [] className.extend(self.listClasses) diff --git a/src/engine/SCons/Tool/gettext.py b/src/engine/SCons/Tool/gettext.py index dd336b6..6031e49 100644 --- a/src/engine/SCons/Tool/gettext.py +++ b/src/engine/SCons/Tool/gettext.py @@ -40,6 +40,9 @@ def exists(env): from SCons.Tool.GettextCommon \ import _xgettext_exists, _msginit_exists, \ _msgmerge_exists, _msgfmt_exists - return _xgettext_exists(env) and _msginit_exists(env) \ - and _msgmerge_exists(env) and _msgfmt_exists(env) + try: + return _xgettext_exists(env) and _msginit_exists(env) \ + and _msgmerge_exists(env) and _msgfmt_exists(env) + except: + return False ############################################################################# diff --git a/src/engine/SCons/Tool/javacTests.py b/src/engine/SCons/Tool/javacTests.py index fc7f271..4631c8a 100644 --- a/src/engine/SCons/Tool/javacTests.py +++ b/src/engine/SCons/Tool/javacTests.py @@ -73,18 +73,18 @@ class pathoptTestCase(unittest.TestCase): DummyNode('/foo')) def test_list_node(self): - self.assert_pathopt(['-foopath', '/foo:/bar'], + self.assert_pathopt(['-foopath', os.pathsep.join(['/foo','/bar'])], ['/foo', DummyNode('/bar')]) def test_default_str(self): self.assert_pathopt_default( - ['-foopath', '/foo:/bar:/baz'], + ['-foopath', os.pathsep.join(['/foo','/bar','/baz'])], ['/foo', '/bar'], '/baz') def test_default_list(self): self.assert_pathopt_default( - ['-foopath', '/foo:/bar:/baz'], + ['-foopath', os.pathsep.join(['/foo','/bar','/baz'])], ['/foo', '/bar'], ['/baz']) diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py index 495fc24..232963c 100644 --- a/src/engine/SCons/Tool/msvsTests.py +++ b/src/engine/SCons/Tool/msvsTests.py @@ -551,11 +551,12 @@ class msvsTestCase(unittest.TestCase): debug("Testing for default version %s"%self.default_version) env = DummyEnv() v1 = get_default_version(env) - assert env['MSVS_VERSION'] == self.default_version, \ - ("env['MSVS_VERSION'] != self.default_version",self.default_version, env['MSVS_VERSION']) - assert env['MSVS']['VERSION'] == self.default_version, \ - ("env['MSVS']['VERSION'] != self.default_version",self.default_version, env['MSVS']['VERSION']) - assert v1 == self.default_version, (self.default_version, v1) + if v1: + assert env['MSVS_VERSION'] == self.default_version, \ + ("env['MSVS_VERSION'] != self.default_version",self.default_version, env['MSVS_VERSION']) + assert env['MSVS']['VERSION'] == self.default_version, \ + ("env['MSVS']['VERSION'] != self.default_version",self.default_version, env['MSVS']['VERSION']) + assert v1 == self.default_version, (self.default_version, v1) env = DummyEnv({'MSVS_VERSION':'7.0'}) v2 = get_default_version(env) |