Commits

Russel Winder committed 047ef2a Merge

Merge mainline tip.

  • Participants
  • Parent commits c15ead0, 82f9185

Comments (0)

Files changed (37)

QMTest/TestCmdTests.py

                                       ['a\\n', 'c\\n', 'd\\n', 'e\\n', 'f2\\n'])
 result = list(result)
 expect = [
-    '***  \\n',
-    '---  \\n',
+    '*** \\n',
+    '--- \\n',
     '***************\\n',
     '*** 1,5 ****\\n',
     '  a\\n',
                                       ['a\\n', 'c\\n', 'd\\n', 'e\\n', 'f2\\n'])
 result = list(result)
 expect = [
-    '---  \\n',
-    '+++  \\n',
+    '--- \\n',
+    '+++ \\n',
     '@@ -1,5 +1,5 @@\\n',
     ' a\\n',
     '-b\\n',

QMTest/TestCommon.py

 import os
 import stat
 import sys
+import glob
 
 try:
     from collections import UserList
 def is_List(e):
     return isinstance(e, (list, UserList))
 
+def is_Tuple(e):
+    return isinstance(e, tuple)
+
+def is_Sequence(e):
+    return (not hasattr(e, "strip") and
+            hasattr(e, "__getitem__") or
+            hasattr(e, "__iter__"))
+
 def is_writable(f):
     mode = os.stat(f)[stat.ST_MODE]
     return mode & stat.S_IWUSR
             print "Missing files: `%s'" % "', `".join(missing)
             self.fail_test(missing)
 
+    def must_exist_one_of(self, files):
+        """Ensures that at least one of the specified file(s) exists.
+        The filenames can be given as a list, where each entry may be
+        a single path string, or a tuple of folder names and the final
+        filename that get concatenated.
+        Supports wildcard names like 'foo-1.2.3-*.rpm'.
+        Exits FAILED if none of the files exists.
+        """
+        missing = []
+        for x in files:
+            if is_List(x) or is_Tuple(x):
+                xpath = os.path.join(*x)
+            else:
+                xpath = is_Sequence(x) and os.path.join(x) or x
+            if glob.glob(xpath):
+                return
+            missing.append(xpath)
+        print "Missing one of: `%s'" % "', `".join(missing)
+        self.fail_test(missing)
+
     def must_match(self, file, expect, mode = 'rb'):
         """Matches the contents of the specified file (first argument)
         against the expected contents (second argument).  The expected
             print "Unexpected files exist: `%s'" % "', `".join(existing)
             self.fail_test(existing)
 
+    def must_not_exist_any_of(self, files):
+        """Ensures that none of the specified file(s) exists.
+        The filenames can be given as a list, where each entry may be
+        a single path string, or a tuple of folder names and the final
+        filename that get concatenated.
+        Supports wildcard names like 'foo-1.2.3-*.rpm'.
+        Exits FAILED if any of the files exists.
+        """
+        existing = []
+        for x in files:
+            if is_List(x) or is_Tuple(x):
+                xpath = os.path.join(*x)
+            else:
+                xpath = is_Sequence(x) and os.path.join(x) or x
+            if glob.glob(xpath):
+                existing.append(xpath)
+        if existing:
+            print "Unexpected files exist: `%s'" % "', `".join(existing)
+            self.fail_test(existing)
 
     def must_not_be_writable(self, *files):
         """Ensures that the specified file(s) exist and are not writable.

QMTest/TestCommonTests.py

         stderr = run_env.stderr()
         assert stderr == "PASSED\n", stderr
 
+class must_exist_one_of_TestCase(TestCommonTestCase):
+    def test_success(self):
+        """Test must_exist_one_of():  success"""
+        run_env = self.run_env
 
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.write('file1', "file1\\n")
+        tc.must_exist_one_of(['file1'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_failure(self):
+        """Test must_exist_one_of():  failure"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.must_exist_one_of(['file1'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "Missing one of: `file1'\n", stdout
+        stderr = run_env.stderr()
+        assert stderr.find("FAILED") != -1, stderr
+
+    def test_files_specified_as_list(self):
+        """Test must_exist_one_of():  files specified as list"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.write('file1', "file1\\n")
+        tc.must_exist_one_of(['file2', 'file1'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_files_specified_with_wildcards(self):
+        """Test must_exist_one_of():  files specified with wildcards"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.write('file7', "file7\\n")
+        tc.must_exist_one_of(['file?'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_file_given_as_list(self):
+        """Test must_exist_one_of():  file given as list"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.subdir('sub')
+        tc.write(['sub', 'file1'], "sub/file1\\n")
+        tc.must_exist_one_of(['file2',
+                              ['sub', 'file1']])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_file_given_as_sequence(self):
+        """Test must_exist_one_of():  file given as sequence"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.subdir('sub')
+        tc.write(['sub', 'file1'], "sub/file1\\n")
+        tc.must_exist_one_of(['file2',
+                              ('sub', 'file1')])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
 
 class must_match_TestCase(TestCommonTestCase):
     def test_success(self):
         stderr = run_env.stderr()
         assert stderr.find("FAILED") != -1, stderr
 
+class must_not_exist_any_of_TestCase(TestCommonTestCase):
+    def test_success(self):
+        """Test must_not_exist_any_of():  success"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.must_not_exist_any_of(['file1'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_failure(self):
+        """Test must_not_exist_any_of():  failure"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.write('file1', "file1\\n")
+        tc.must_not_exist_any_of(['file1'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "Unexpected files exist: `file1'\n", stdout
+        stderr = run_env.stderr()
+        assert stderr.find("FAILED") != -1, stderr
+
+    def test_files_specified_as_list(self):
+        """Test must_not_exist_any_of():  files specified as list"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.must_not_exist_any_of(['file2', 'file1'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_files_specified_with_wildcards(self):
+        """Test must_not_exist_any_of():  files specified with wildcards"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.write('file7', "file7\\n")
+        tc.must_not_exist_any_of(['files?'])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_file_given_as_list(self):
+        """Test must_not_exist_any_of():  file given as list"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.subdir('sub')
+        tc.write(['sub', 'file1'], "sub/file1\\n")
+        tc.must_not_exist_any_of(['file2',
+                              ['sub', 'files*']])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
+
+    def test_file_given_as_sequence(self):
+        """Test must_not_exist_any_of():  file given as sequence"""
+        run_env = self.run_env
+
+        script = lstrip("""\
+        from TestCommon import TestCommon
+        tc = TestCommon(workdir='')
+        tc.subdir('sub')
+        tc.write(['sub', 'file1'], "sub/file1\\n")
+        tc.must_not_exist_any_of(['file2',
+                              ('sub', 'files?')])
+        tc.pass_test()
+        """)
+        run_env.run(program=sys.executable, stdin=script)
+        stdout = run_env.stdout()
+        assert stdout == "", stdout
+        stderr = run_env.stderr()
+        assert stderr == "PASSED\n", stderr
 
 class run_TestCase(TestCommonTestCase):
     def test_argument_handling(self):
         must_contain_exactly_lines_TestCase,
         must_contain_lines_TestCase,
         must_exist_TestCase,
+        must_exist_one_of_TestCase,
         must_match_TestCase,
         must_not_be_writable_TestCase,
         must_not_contain_TestCase,
         must_not_contain_any_line_TestCase,
         must_not_contain_lines_TestCase,
         must_not_exist_TestCase,
+        must_not_exist_any_of_TestCase,
         run_TestCase,
         start_TestCase,
         skip_test_TestCase,

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
   From Gary Oberbrunner:
     - Fix MSVS solution generation for VS11, and fixed tests.
 
+  From Rob Managan:
+    - Updated the TeX builder to support the \newglossary command
+      in LaTeX's glossaries package and the files it creates.
+
 RELEASE 2.2.0 - Mon, 05 Aug 2012 15:37:48 +0000
 
   From dubcanada on Bitbucket:

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

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)

src/engine/SCons/Tool/tex.py

 makeglossaries_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE)
 makeacronyms_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE)
 beamer_re = re.compile(r"^[^%\n]*\\documentclass\{beamer\}", re.MULTILINE)
+regex = r'^[^%\n]*\\newglossary\s*\[([^\]]+)\]?\s*\{([^}]*)\}\s*\{([^}]*)\}\s*\{([^}]*)\}\s*\{([^}]*)\}'
+newglossary_re = re.compile(regex, re.MULTILINE)
+
+newglossary_suffix = []
 
 # search to find all files included by Latex
 include_re = re.compile(r'^[^%\n]*\\(?:include|input){([^}]*)}', re.MULTILINE)
 # An action to run MakeIndex (for acronyms) on a file.
 MakeAcronymsAction = None
 
+# An action to run MakeIndex (for newglossary commands) on a file.
+MakeNewGlossaryAction = None
+
 # Used as a return value of modify_env_var if the variable is not set.
 _null = SCons.Scanner.LaTeX._null
 
     saved_hashes = {}
     suffix_nodes = {}
 
-    for suffix in all_suffixes:
+
+    for suffix in all_suffixes+sum(newglossary_suffix, []):
         theNode = env.fs.File(targetbase + suffix)
         suffix_nodes[suffix] = theNode
         saved_hashes[suffix] = theNode.get_csig()
                                          'alg')
                 return result
 
+        # Now decide if latex will need to be run again due to newglossary command.
+        for ig in range(len(newglossary_suffix)):
+            if check_MD5(suffix_nodes[newglossary_suffix[ig][2]],newglossary_suffix[ig][2]) or (count == 1):
+                # We must run makeindex
+                if Verbose:
+                    print "Need to run makeindex for newglossary"
+                newglfile = suffix_nodes[newglossary_suffix[ig][2]]
+                MakeNewGlossaryAction = SCons.Action.Action("$MAKENEWGLOSSARY ${SOURCE.filebase}%s -s ${SOURCE.filebase}.ist -t ${SOURCE.filebase}%s -o ${SOURCE.filebase}%s" % (newglossary_suffix[ig][2],newglossary_suffix[ig][0],newglossary_suffix[ig][1]), "$MAKENEWGLOSSARYCOMSTR")
+
+                result = MakeNewGlossaryAction(newglfile, newglfile, env)
+                if result != 0:
+                    check_file_error_message('%s (newglossary)' % env['MAKENEWGLOSSARY'],
+                                             newglossary_suffix[ig][0])
+                    return result
+
         # Now decide if latex needs to be run yet again to resolve warnings.
         if warning_rerun_re.search(logContent):
             must_rerun_latex = True
 
     for i in range(len(file_tests_search)):
         if file_tests[i][0] is None:
+            if Verbose:
+                print "scan i ",i," files_tests[i] ",file_tests[i], file_tests[i][1]
             file_tests[i][0] = file_tests_search[i].search(content)
             if Verbose and file_tests[i][0]:
-                print "   found match for ",file_tests[i][-1][-1]
+                print "   found match for ",file_tests[i][1][-1]
+            # for newglossary insert the suffixes in file_tests[i]
+            if file_tests[i][0] and file_tests[i][1][-1] == 'newglossary':
+                findresult = file_tests_search[i].findall(content)
+                for l in range(len(findresult)) :
+                    (file_tests[i][1]).insert(0,'.'+findresult[l][3])
+                    (file_tests[i][1]).insert(0,'.'+findresult[l][2])
+                    (file_tests[i][1]).insert(0,'.'+findresult[l][0])
+                    suffix_list = ['.'+findresult[l][0],'.'+findresult[l][2],'.'+findresult[l][3] ]
+                    newglossary_suffix.append(suffix_list)
+                if Verbose:
+                    print " new suffixes for newglossary ",newglossary_suffix
+                
 
     incResult = includeOnly_re.search(content)
     if incResult:
                          makeglossary_re,
                          makeglossaries_re,
                          makeacronyms_re,
-                         beamer_re ]
+                         beamer_re,
+                         newglossary_re ]
     # set up list with the file suffixes that need emitting
     # when a feature is found
     file_tests_suff = [['.aux','aux_file'],
                   ['.glo', '.gls', '.glg','glossary'],
                   ['.glo', '.gls', '.glg','glossaries'],
                   ['.acn', '.acr', '.alg','acronyms'],
-                  ['.nav', '.snm', '.out', '.toc','beamer'] ]
+                  ['.nav', '.snm', '.out', '.toc','beamer'],
+                  ['newglossary',] ]
+    # for newglossary the suffixes are added as we find the command
     # build the list of lists
     file_tests = []
     for i in range(len(file_tests_search)):
     if Verbose:
         print "search path ",paths
 
+    # scan all sources for side effect files
     aux_files = []
     file_tests = ScanFiles(source[0], target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files)
 
     env['MAKENCLFLAGS'] = '-s ${MAKENCLSTYLE} -t ${SOURCE.filebase}.nlg'
     env['MAKENCLCOM']   = CDCOM + '${TARGET.dir} && $MAKENCL ${SOURCE.filebase}.nlo $MAKENCLFLAGS -o ${SOURCE.filebase}.nls'
 
+    env['MAKENEWGLOSSARY']      = 'makeindex'
+    env['MAKENEWGLOSSARYCOM']   = CDCOM + '${TARGET.dir} && $MAKENEWGLOSSARY '
+
 def exists(env):
     generate_darwin(env)
     return env.Detect('tex')
 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/TEX/newglossary.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__"
+
+"""
+Validate that use of \newglossary in TeX source files causes SCons to
+be aware of the necessary created glossary files.
+
+Test configuration contributed by Robert Managan.
+"""
+
+import os
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+latex = test.where_is('latex')
+
+if not latex:
+    test.skip_test("Could not find latex; skipping test(s).\n")
+
+gloss = os.system('kpsewhich glossaries.sty')
+if not gloss==0:
+    test.skip_test("glossaries.sty not installed; skipping test(s).\n")
+
+test.write('SConstruct', """\
+import os
+env = Environment()
+env.PDF('newglossary', 'newglossary.tex')
+""")
+
+test.write('newglossary.tex', r"""
+\documentclass{report}
+
+% for glossary
+\newlength{\symcol}
+\newlength{\symw}
+\newcommand{\symtab}[1]{\setlength{\symcol}{1.3cm}\settowidth{\symw}{\ensuremath{#1}}\advance\symcol by -\symw\hspace{\symcol}}
+\newcommand{\newsym}[5]{\newglossaryentry{#1}{name=\ensuremath{#2},description={\symtab{#2}{#4}},parent={#5},sort={#3}}}
+\newcommand{\newacronymf}[3]{\newglossaryentry{#1}{name={#2},description={#3},first={#2}}}
+
+\usepackage[acronym]{glossaries}
+\newglossary[symlog]{symbol}{symi}{symo}{Symbols}
+\newglossaryentry{nix}{
+  name={Nix},
+  description={Version 5}
+}
+\newglossary[deflog]{definition}{defi}{defo}{Definitions}
+\newglossaryentry{defPower}{name=Ddyn,type={definition},description={def of 1 dynamic power consumption},sort={DP}}
+
+\newacronym{gnu}{GNU}{GNU's Not UNIX}
+\makeglossaries
+\glstoctrue 
+%\loadglsentries[\acronymtype]{chapters/acronyms}
+\loadglsentries[symbol]{symbols}
+%\loadglsentries[definition]{defns}
+
+
+\begin{document}
+
+Here is a symbol: \gls{dynPower} and a glossary entry \gls{mel}
+
+Acronyms \gls{gnu} and glossary entries \gls{nix}.
+
+a definition \gls{defPower}
+
+\glossarystyle{index}
+\printglossary[type=symbol]
+\printglossary[type=acronym]
+\printglossary[type=main]
+\printglossary[type=definition]
+\glossarystyle{super}
+
+\end{document}""")
+
+
+test.write('symbols.tex', r"""
+\newglossaryentry{mel}{name={Microelectronic Fundamentals},description={\nopostdesc},sort=d}  
+\newsym{dynPower}{P_{dyn}}{P}{Dynamic power consumption}{mel}
+
+%\newcommand{\newsym}[5]{\newglossaryentry{#1}{name=\ensuremath{#2},description={\symtab{#2}{#4}},parent={#5},sort={#3}}}
+""")
+
+test.run(arguments = '.', stderr=None)
+
+test.must_exist(test.workpath('newglossary.acn'))
+test.must_exist(test.workpath('newglossary.acr'))
+test.must_exist(test.workpath('newglossary.alg'))
+test.must_exist(test.workpath('newglossary.aux'))
+test.must_exist(test.workpath('newglossary.defi'))
+test.must_exist(test.workpath('newglossary.deflog'))
+test.must_exist(test.workpath('newglossary.defo'))
+test.must_exist(test.workpath('newglossary.fls'))
+test.must_exist(test.workpath('newglossary.glg'))
+test.must_exist(test.workpath('newglossary.glo'))
+test.must_exist(test.workpath('newglossary.gls'))
+test.must_exist(test.workpath('newglossary.ist'))
+test.must_exist(test.workpath('newglossary.log'))
+test.must_exist(test.workpath('newglossary.pdf'))
+test.must_exist(test.workpath('newglossary.symi'))
+test.must_exist(test.workpath('newglossary.symlog'))
+test.must_exist(test.workpath('newglossary.symo'))
+
+test.run(arguments = '-c .')
+
+x = "Could not remove 'newglossary.aux': No such file or directory"
+test.must_not_contain_any_line(test.stdout(), [x])
+
+test.must_not_exist(test.workpath('newglossary.acn'))
+test.must_not_exist(test.workpath('newglossary.acr'))
+test.must_not_exist(test.workpath('newglossary.alg'))
+test.must_not_exist(test.workpath('newglossary.defi'))
+test.must_not_exist(test.workpath('newglossary.deflog'))
+test.must_not_exist(test.workpath('newglossary.defo'))
+test.must_not_exist(test.workpath('newglossary.aux'))
+test.must_not_exist(test.workpath('newglossary.fls'))
+test.must_not_exist(test.workpath('newglossary.glg'))
+test.must_not_exist(test.workpath('newglossary.glo'))
+test.must_not_exist(test.workpath('newglossary.gls'))
+test.must_not_exist(test.workpath('newglossary.ist'))
+test.must_not_exist(test.workpath('newglossary.log'))
+test.must_not_exist(test.workpath('newglossary.pdf'))
+test.must_not_exist(test.workpath('newglossary.symi'))
+test.must_not_exist(test.workpath('newglossary.symlog'))
+test.must_not_exist(test.workpath('newglossary.symo'))
+
+test.pass_test()
+
+
+
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:

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

 
 import TestSCons
 
-machine = TestSCons.machine
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
 """ % locals())
 
 src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.%s.rpm' % machine
+machine_rpm = 'foo-1.2.3-0.*.rpm'
 
 test.run(arguments='package PACKAGETYPE=rpm', stderr = None)
 
 test.must_exist( src_rpm )
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 test.must_not_exist( 'bin/main.c' )
 test.must_not_exist( '/bin/main.c' )
 
 
 test.run(arguments='package --package-type=rpm', stderr = None)
 test.must_exist( src_rpm )
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 test.must_not_exist( 'bin/main.c' )
 test.must_not_exist( '/bin/main.c' )
 

test/packaging/rpm/cleanup.py

 
 import TestSCons
 
-machine = TestSCons.machine
 _python_ = TestSCons._python_
-
 test = TestSCons.TestSCons()
 
 scons = test.program
 test.run( arguments='-c .' )
 
 src_rpm     = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.%s.rpm' % machine
+machine_rpm = 'foo-1.2.3-0.*.rpm'
 
-test.must_not_exist( machine_rpm )
+test.must_not_exist_any_of( [machine_rpm] )
 test.must_not_exist( src_rpm )
 test.must_not_exist( 'foo-1.2.3.tar.gz' )
 test.must_not_exist( 'foo-1.2.3.spec' )

test/packaging/rpm/internationalization.py

 """
 
 import os
+import glob
 
 import TestSCons
 
-machine = TestSCons.machine
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
 test.run(arguments='', stderr = None)
 
 src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.%s.rpm' % machine
+machine_rpm = 'foo-1.2.3-0.*.rpm'
 
 test.must_exist( src_rpm )
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 
 test.must_not_exist( 'bin/main' )
 
+machine_rpm_path = glob.glob(machine_rpm)[0].lstrip('./')
 cmd = 'rpm -qp --queryformat \'%%{GROUP}-%%{SUMMARY}-%%{DESCRIPTION}\' %s'
 
 os.environ['LANGUAGE'] = 'de'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Applikation/büro-hallo-das sollte wirklich lang sein' )
 
 os.environ['LANGUAGE'] = 'fr'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Application/bureau-bonjour-ceci devrait être vraiment long' )
 
 os.environ['LANGUAGE'] = 'en'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Application/office-hello-this should be really long' )
 
 os.environ['LC_ALL'] = 'ae'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Application/office-hello-this should be really long' )
 
 #
 test.run(arguments='--install-sandbox=blubb install', stderr = None)
 
 test.must_exist( src_rpm )
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 
 test.pass_test()
 

test/packaging/rpm/multipackage.py

 """
 
 import os
+import glob
 import TestSCons
 
-machine = TestSCons.machine
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
 test.run(arguments='', stderr = None)
 
 src_rpm      = 'foo-1.2.3-0.src.rpm'
-machine_rpm  = 'foo-1.2.3-0.%s.rpm' % machine
+machine_rpm  = 'foo-1.2.3-0.*.rpm'
 src_rpm2     = 'foo2-1.2.3-0.src.rpm'
-machine_rpm2 = 'foo2-1.2.3-0.%s.rpm' % machine
+machine_rpm2 = 'foo2-1.2.3-0.*.rpm'
 
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 test.must_exist( src_rpm )
 
-test.must_exist( machine_rpm2 )
+test.must_exist_one_of( [machine_rpm2] )
 test.must_exist( src_rpm2 )
 
 test.must_not_exist( 'bin/main' )
-test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
+test.fail_test( not os.popen('rpm -qpl %s' % glob.glob(machine_rpm)[0].lstrip('./')).read()=='/bin/main\n')
 test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
 
 test.pass_test()

test/packaging/rpm/package.py

 """
 
 import os
+import glob
 import TestSCons
 
-machine = TestSCons.machine
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
 test.run(arguments='', stderr = None)
 
 src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.%s.rpm' % machine
+machine_rpm = 'foo-1.2.3-0.*.rpm'
 
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 test.must_exist( src_rpm )
 test.must_not_exist( 'bin/main' )
-test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
+test.fail_test( not os.popen('rpm -qpl %s' % glob.glob(machine_rpm)[0].lstrip('./')).read()=='/bin/main\n')
 test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
 
 test.pass_test()

test/packaging/rpm/tagging.py

 """
 
 import os
+import glob
 
 import TestSCons
 
-machine = TestSCons.machine
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
 test.run(arguments='', stderr = None)
 
 src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.%s.rpm' % machine
+machine_rpm = 'foo-1.2.3-0.*.rpm'
 
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 test.must_exist( src_rpm )
-test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
+test.fail_test( not os.popen('rpm -qpl %s' % glob.glob(machine_rpm)[0].lstrip('./')).read()=='/bin/main\n')
 test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
 
 expect = '(0755, root, users) /bin/main'

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:

test/scons-time/func/funcglob.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__"
+
+"""
+Verify that the func subcommands globs for files.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time(match = TestSCons_time.match_re)
+
+try:
+    import pstats
+except ImportError:
+    test.skip_test('No pstats module, skipping test.\n')
+
+input = """\
+def _main():
+    pass
+"""
+
+expect = []
+for i in range(9):
+    test.subdir(str(i))
+    test.profile_data('foo-%s.prof' % i, '%s/prof.py' % i, '_main', input)
+    expect.append((r'\d.\d\d\d %s/prof\.py:1\(_main\)' + '\n') % i)
+
+expect = ''.join(expect)
+
+test.run(arguments = 'func foo-*.prof', stdout = expect)
+
+test.run(arguments = 'func foo-?.prof', stdout = expect)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:

test/scons-time/func/glob.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__"
-
-"""
-Verify that the func subcommands globs for files.
-"""
-
-import TestSCons_time
-
-test = TestSCons_time.TestSCons_time(match = TestSCons_time.match_re)
-
-try:
-    import pstats
-except ImportError:
-    test.skip_test('No pstats module, skipping test.\n')
-
-input = """\
-def _main():
-    pass
-"""
-
-expect = []
-for i in range(9):
-    test.subdir(str(i))
-    test.profile_data('foo-%s.prof' % i, '%s/prof.py' % i, '_main', input)
-    expect.append((r'\d.\d\d\d %s/prof\.py:1\(_main\)' + '\n') % i)
-
-expect = ''.join(expect)
-
-test.run(arguments = 'func foo-*.prof', stdout = expect)
-
-test.run(arguments = 'func foo-?.prof', stdout = expect)
-
-test.pass_test()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:

test/scons-time/mem/glob.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__"
-
-"""
-Verify that the mem subommand globs for files.
-"""
-
-import TestSCons_time
-
-test = TestSCons_time.TestSCons_time()
-
-lines = [
-    '    pre-read    post-read    pre-build   post-build\n'
-]
-
-line_fmt = '        1000         2000         3000         4000    %s\n'
-
-for i in range(9):
-    logfile_name = 'foo-%s.log' % i
-    test.fake_logfile(logfile_name)
-    lines.append(line_fmt % logfile_name)
-
-expect = ''.join(lines)
-
-test.run(arguments = 'mem foo-*.log', stdout = expect)
-
-test.run(arguments = 'mem foo-?.log', stdout = expect)
-
-test.pass_test()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:

test/scons-time/mem/memglob.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__"
+
+"""
+Verify that the mem subommand globs for files.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+lines = [
+    '    pre-read    post-read    pre-build   post-build\n'
+]
+
+line_fmt = '        1000         2000         3000         4000    %s\n'
+
+for i in range(9):
+    logfile_name = 'foo-%s.log' % i
+    test.fake_logfile(logfile_name)
+    lines.append(line_fmt % logfile_name)
+
+expect = ''.join(lines)
+
+test.run(arguments = 'mem foo-*.log', stdout = expect)
+
+test.run(arguments = 'mem foo-?.log', stdout = expect)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:

test/scons-time/obj/glob.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__"
-
-"""
-Verify that the obj subcommand globs for files.
-"""
-
-import TestSCons_time
-
-test = TestSCons_time.TestSCons_time()
-
-lines = [
-    '    pre-read    post-read    pre-build   post-build\n'
-]
-
-line_fmt = '        601%(i)s         602%(i)s         603%(i)s         604%(i)s    %(logfile_name)s\n'
-
-for i in range(9):
-    logfile_name = 'foo-%s.log' % i
-    test.fake_logfile(logfile_name, i)
-    lines.append(line_fmt % locals())
-
-expect = ''.join(lines)
-
-test.run(arguments = 'obj Builder.BuilderBase foo-*.log', stdout = expect)
-
-test.run(arguments = 'obj Builder.BuilderBase foo-?.log', stdout = expect)
-
-test.pass_test()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:

test/scons-time/obj/objglob.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__"
+
+"""
+Verify that the obj subcommand globs for files.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+lines = [
+    '    pre-read    post-read    pre-build   post-build\n'
+]
+
+line_fmt = '        601%(i)s         602%(i)s         603%(i)s         604%(i)s    %(logfile_name)s\n'
+
+for i in range(9):
+    logfile_name = 'foo-%s.log' % i
+    test.fake_logfile(logfile_name, i)
+    lines.append(line_fmt % locals())
+
+expect = ''.join(lines)
+
+test.run(arguments = 'obj Builder.BuilderBase foo-*.log', stdout = expect)
+
+test.run(arguments = 'obj Builder.BuilderBase foo-?.log', stdout = expect)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:

test/scons-time/time/glob.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__"
-
-"""
-Verify that the time subcommand globs for files.
-"""
-
-import TestSCons_time
-
-test = TestSCons_time.TestSCons_time()
-
-lines = [
-    '       Total  SConscripts        SCons     commands\n'
-]
-
-line_fmt = '   11.123456    22.234567    33.345678    44.456789    %s\n'
-
-for i in range(9):
-    logfile_name = 'foo-%s.log' % i
-    test.fake_logfile(logfile_name)
-    lines.append(line_fmt % logfile_name)
-
-expect = ''.join(lines)
-
-test.run(arguments = 'time foo-*.log', stdout = expect)
-
-test.run(arguments = 'time foo-?.log', stdout = expect)
-
-test.pass_test()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:

test/scons-time/time/timeglob.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__"
+
+"""
+Verify that the time subcommand globs for files.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+lines = [
+    '       Total  SConscripts        SCons     commands\n'
+]
+
+line_fmt = '   11.123456    22.234567    33.345678    44.456789    %s\n'
+
+for i in range(9):
+    logfile_name = 'foo-%s.log' % i
+    test.fake_logfile(logfile_name)
+    lines.append(line_fmt % logfile_name)
+
+expect = ''.join(lines)
+
+test.run(arguments = 'time foo-*.log', stdout = expect)
+
+test.run(arguments = 'time foo-?.log', stdout = expect)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: