dirkbaechle avatar dirkbaechle committed e407cf5

- first swoop of changes for getting all Buildbot slaves to run successfully again

Comments (0)

Files changed (23)

QMTest/TestSCons.py

         import sys
         if not version:
             version=''
-            frame = '/System/Library/Frameworks/JavaVM.framework/Headers/jni.h'
+            jni_dirs = ['/System/Library/Frameworks/JavaVM.framework/Headers/jni.h',
+                        '/usr/lib/jvm/default-java/include/jni.h']
         else:
-            frame = '/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/jni.h'%version
-        jni_dirs = ['/usr/lib/jvm/java-*-sun-%s*/include/jni.h'%version,
-                    '/usr/java/jdk%s*/include/jni.h'%version,
-		    frame,
-                    ]
+            jni_dirs = ['/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/jni.h'%version]
+        jni_dirs.extend(['/usr/lib/jvm/java-*-sun-%s*/include/jni.h'%version,
+                         '/usr/lib/jvm/java-%s*-openjdk/include/jni.h'%version,
+                         '/usr/java/jdk%s*/include/jni.h'%version])
         dirs = self.paths(jni_dirs)
         if not dirs:
             return None

src/engine/SCons/SubstTests.py

                 "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:

src/engine/SCons/Tool/JavaCommon.py

         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)

src/engine/SCons/Tool/gettext.py

   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
 #############################################################################

src/engine/SCons/Tool/javacTests.py

                             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'])
 

src/engine/SCons/Tool/msvsTests.py

         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)
 args = sys.argv[1:]
 while args:
     a = args[0]
-    if a[0] != '/':
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
+    if not a[0] in '/-':
         break
     args = args[1:]
     if a[:5].lower() == '/out:': out = a[5:]
 inf = None
 while args:
     a = args[0]
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
     args = args[1:]
     if not a[0] in "/-":
         if not inf:
             inf = a
         continue
     if a[:3] == '/Fo': out = a[3:]
-    if a == '-o':
-        out = args[0]
-        args = args[1:]
 infile = open(inf, 'rb')
 outfile = open(out, 'wb')
 for l in infile.readlines():

test/AS/ASFLAGS.py

 args = sys.argv[1:]
 while args:
     a = args[0]
-    if a[0] != '/':
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
+    if not a[0] in '/-':
         break
     args = args[1:]
     if a[:5].lower() == '/out:': out = a[5:]
 optstring = ''
 while args:
     a = args[0]
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
     args = args[1:]
     if not a[0] in '/-':
         if not inf:
 args = sys.argv[1:]
 while args:
     a = args[0]
-    if a[0] != '/':
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
+    if not a[0] in '/-':
         break
     args = args[1:]
     if a[:5].lower() == '/out:': out = a[5:]
 inf = None
 while args:
     a = args[0]
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
     args = args[1:]
     if not a[0] in "/-":
         if not inf:
             inf = a
         continue
     if a[:3] == '/Fo': out = a[3:]
-    if a == '-o':
-        out = args[0]
-        args = args[1:]
 infile = open(inf, 'rb')
 outfile = open(out, 'wb')
 for l in infile.readlines():

test/AS/ASPPFLAGS.py

 args = sys.argv[1:]
 while args:
     a = args[0]
-    if a[0] != '/':
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
+    if not a[0] in '/-':
         break
     args = args[1:]
     if a[:5].lower() == '/out:': out = a[5:]
 optstring = ''
 while args:
     a = args[0]
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
     args = args[1:]
     if not a[0] in '/-':
         if not inf:
 args = sys.argv[1:]
 while args:
     a = args[0]
-    if a[0] != '/':
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
+    if not a[0] in '/-':
         break
     args = args[1:]
     if a[:5].lower() == '/out:': out = a[5:]
 inf = None
 while args:
     a = args[0]
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
     args = args[1:]
     if a[0] != '/':
         if not inf:
 args = sys.argv[1:]
 while args:
     a = args[0]
-    if a[0] != '/':
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
+    if not a[0] in '/-':
         break
     args = args[1:]
     if a[:5].lower() == '/out:': out = a[5:]
 inf = None
 while args:
     a = args[0]
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
     args = args[1:]
-    if a[0] != '/':
+    if not a[0] in '/-':
         if not inf:
             inf = a
         continue

test/Errors/execute-a-directory.py

 scons: *** [%s] Error %s
 """
 
+Is_a_directory = """\
+%s: Is a directory
+scons: *** [%s] Error %s
+"""
+
 test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
 if os.name == 'nt':
     errs = [
     errs = [
         cannot_execute % (not_executable, 'f3', 126),
         is_a_directory % (test.workdir, 'f3', 126),
-        Permission_denied % (test.workdir, 'f3', 126),
+        Is_a_directory % (test.workdir, 'f3', 126),
         Permission_denied % (test.workdir, 'f3', 126),
     ]
     test.must_contain_any_line(test.stderr(), errs)

test/FindSourceFiles.py

 
 test = TestSCons.TestSCons()
 
+package_format = "src_tarbz2"
+if not test.where_is('tar'):
+    if not test.where_is('zip'):
+        test.skip_test("neither 'tar' nor 'zip' found; skipping test\n")
+    package_format = "src_zip"
+
 # Quite complex, but real-life test.
 # 0. Setup VariantDir, "var", without duplication. The "src" is source dir.
 # 1. Generate souce file var/foo.c from src/foo.c.in. Define program foo.
 # 2. Gather all sources necessary to create '.' node and create source
-#    tarball. We expect 'src/foo.c.in' file within tarbal, and no content
+#    tarball. We expect 'src/foo.c.in' file within tarball, and no content
 #    under 'var' directory.
 test.subdir('src')
 
 env = Environment(tools = ['default','textfile','packaging'])
 SConscript(['var/SConscript'], exports = 'env')
 sources = env.FindSourceFiles('.')
-pkg = env.Package( NAME = 'foo', VERSION = '1.0', PACKAGETYPE = 'src_tarbz2',
+pkg = env.Package( NAME = 'foo', VERSION = '1.0', PACKAGETYPE = '%s',
                    source = sources )
 Ignore( '.', pkg )
-""")
+""" % package_format)
 
 test.write('src/SConscript', """
 Import('env')

test/Fortran/common.py

 args = sys.argv[1:]
 while args:
     a = args[0]
-    if a[0] != '/':
+    if a == '-o':
+        out = args[1]
+        args = args[2:]
+        continue
+    if not a[0] in '/-':
         break
     args = args[1:]
     if a[:5].lower() == '/out:': out = a[5:]

test/TEX/biblatex.py

 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 """
-Test creation of a Tex document that uses the multibib oackage
+Test creation of a Tex document that uses the multibib package
 
 Test courtesy Rob Managan.
 """
     'biblatextest.aux',
     'biblatextest.bbl',
     'biblatextest.blg',
-    'biblatextest-blx.bib',
     'biblatextest.fls',
     'biblatextest.log',
     'biblatextest.pdf',

test/packaging/option--package-type.py

 import TestSCons
 
 machine = TestSCons.machine
+try:
+    # Try to get the actual machine type (like i586), since
+    # TestSCons maps all ix86 types to a i386 machine internally.
+    import os
+    machine = os.uname()[4]
+except AttributeError:
+    pass
+    
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()

test/packaging/rpm/cleanup.py

 import TestSCons
 
 machine = TestSCons.machine
+try:
+    # Try to get the actual machine type (like i586), since
+    # TestSCons maps all ix86 types to a i386 machine internally.
+    import os
+    machine = os.uname()[4]
+except AttributeError:
+    pass
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()

test/packaging/rpm/internationalization.py

 import TestSCons
 
 machine = TestSCons.machine
+try:
+    # Try to get the actual machine type (like i586), since
+    # TestSCons maps all ix86 types to a i386 machine internally.
+    import os
+    machine = os.uname()[4]
+except AttributeError:
+    pass
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()

test/packaging/rpm/multipackage.py

 import TestSCons
 
 machine = TestSCons.machine
+try:
+    # Try to get the actual machine type (like i586), since
+    # TestSCons maps all ix86 types to a i386 machine internally.
+    import os
+    machine = os.uname()[4]
+except AttributeError:
+    pass
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()

test/packaging/rpm/package.py

 import TestSCons
 
 machine = TestSCons.machine
+try:
+    # Try to get the actual machine type (like i586), since
+    # TestSCons maps all ix86 types to a i386 machine internally.
+    import os
+    machine = os.uname()[4]
+except AttributeError:
+    pass
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()

test/packaging/rpm/tagging.py

 import TestSCons
 
 machine = TestSCons.machine
+try:
+    # Try to get the actual machine type (like i586), since
+    # TestSCons maps all ix86 types to a i386 machine internally.
+    import os
+    machine = os.uname()[4]
+except AttributeError:
+    pass
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()

test/runtest/aegis/batch-output.py

-#!/usr/bin/env python
-#
-# __COPYRIGHT__
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-
-"""
-Test writing Aegis batch output to a file.
-"""
-
-import os
-
-import TestRuntest
-
-test_fail_py = os.path.join('test', 'fail.py')
-test_no_result_py = os.path.join('test', 'no_result.py')
-test_pass_py = os.path.join('test', 'pass.py')
-
-test = TestRuntest.TestRuntest()
-
-test.subdir('test')
-
-test.write_failing_test(['test', 'fail.py'])
-
-test.write_no_result_test(['test', 'no_result.py'])
-
-test.write_passing_test(['test', 'pass.py'])
-
-expect_stderr = """\
-FAILING TEST STDERR
-NO RESULT TEST STDERR
-PASSING TEST STDERR
-"""
-
-test.run(arguments = '-k -o aegis.out --aegis test', stderr=expect_stderr)
-
-expect = """\
-test_result = [
-    { file_name = "%(test_fail_py)s";
-      exit_status = 1; },
-    { file_name = "%(test_no_result_py)s";
-      exit_status = 2; },
-    { file_name = "%(test_pass_py)s";
-      exit_status = 0; },
-];
-""" % locals()
-
-# The mode is 'r' (not default 'rb') because QMTest opens the file
-# description on which we write as non-binary.
-test.must_match('aegis.out', expect, mode='r')
-
-test.pass_test()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.