Commits

Anonymous committed 94d5554

Handle executing tests in a directory whose path contains spaces,
or with a Python in a path that contains spaces, by refactoring
(again) how we execute the internal scripts.

  • Participants
  • Parent commits c349e13

Comments (0)

Files changed (4)

test/explain/basic.py

 import os
 import string
 import sys
+
 import TestSCons
 
-python = TestSCons.python
-_python_ = TestSCons._python_
-
 test = TestSCons.TestSCons()
 
 test.subdir(['src'], ['src', 'subdir'])
 
 
 
-test.write(cat_py, r"""
+test.write(cat_py, r"""#!/usr/bin/env python
 import sys
 
 def process(outfp, infp):
 sys.exit(0)
 """)
 
+test.chmod(cat_py, 0755)
+
+
 SConstruct_contents = """\
 import re
 
                 argument = None,
                 skeys = ['.k'])
 
-cat = Builder(action = r'%(_python_)s %(cat_py)s $TARGET $SOURCES')
-one_cat = Builder( action = r'%(_python_)s %(cat_py)s $TARGET ${SOURCES[0]}')
+cat = Builder(action = [[r'%(cat_py)s', '$TARGET', '$SOURCES']])
+one_cat = Builder( action = [[r'%(cat_py)s', '$TARGET', '${SOURCES[0]}']])
 
 env = Environment()
 env.Append(BUILDERS = {'Cat':cat, 'OneCat':one_cat},
            SCANNERS = kscan)
+env.PrependENVPath('PATHEXT', '.PY')
 
 Export("env")
 SConscript('SConscript')
 env.Cat('file2', 'file2.k')
 env.Cat('file3', ['xxx', 'yyy', 'zzz'])
 env.Command('file4', 'file4.in',
-             r'%(_python_)s %(cat_py)s $TARGET $FILE4FLAG $SOURCES',
+             r'%(cat_py)s $TARGET $FILE4FLAG $SOURCES',
              FILE4FLAG='-')
 env.Cat('file5', 'file5.k')
 file6 = env.Cat('file6', 'file6.in')
 
 expect = test.wrap_stdout("""\
 scons: building `file1' because it doesn't exist
-%(_python_)s %(cat_py)s file1 file1.in
+%(cat_py)s file1 file1.in
 scons: building `file2' because it doesn't exist
-%(_python_)s %(cat_py)s file2 file2.k
+%(cat_py)s file2 file2.k
 scons: building `file3' because it doesn't exist
-%(_python_)s %(cat_py)s file3 xxx yyy zzz
+%(cat_py)s file3 xxx yyy zzz
 scons: building `file4' because it doesn't exist
-%(_python_)s %(cat_py)s file4 - file4.in
+%(cat_py)s file4 - file4.in
 scons: building `%(inc_aaa)s' because it doesn't exist
 Install file: "aaa" as "%(inc_aaa)s"
 scons: building `%(inc_ddd)s' because it doesn't exist
 scons: building `%(inc_bbb_k)s' because it doesn't exist
 Install file: "bbb.k" as "%(inc_bbb_k)s"
 scons: building `file5' because it doesn't exist
-%(_python_)s %(cat_py)s file5 file5.k
+%(cat_py)s file5 file5.k
 scons: building `file6' because it doesn't exist
-%(_python_)s %(cat_py)s file6 file6.in
+%(cat_py)s file6 file6.in
 scons: building `%(subdir_file7)s' because it doesn't exist
-%(_python_)s %(cat_py)s %(subdir_file7)s %(subdir_file7_in)s
+%(cat_py)s %(subdir_file7)s %(subdir_file7_in)s
 scons: building `%(subdir_file8)s' because it doesn't exist
-%(_python_)s %(cat_py)s %(subdir_file8)s %(subdir_file7_in)s
+%(cat_py)s %(subdir_file8)s %(subdir_file7_in)s
 scons: building `%(subdir_file9)s' because it doesn't exist
-%(_python_)s %(cat_py)s %(subdir_file9)s %(subdir_file7_in)s
+%(cat_py)s %(subdir_file9)s %(subdir_file7_in)s
 """ % locals())
 
 test.run(chdir='src', arguments=args, stdout=expect)
 
 expect = test.wrap_stdout("""\
 scons: rebuilding `file1' because `file1.in' changed
-%(_python_)s %(cat_py)s file1 file1.in
+%(cat_py)s file1 file1.in
 scons: rebuilding `file2' because `yyy' changed
-%(_python_)s %(cat_py)s file2 file2.k
+%(cat_py)s file2 file2.k
 scons: rebuilding `file3' because:
            `yyy' changed
            `zzz' changed
-%(_python_)s %(cat_py)s file3 xxx yyy zzz
+%(cat_py)s file3 xxx yyy zzz
 scons: rebuilding `%(inc_bbb_k)s' because:
            `%(inc_ddd)s' is no longer a dependency
            `%(inc_eee)s' is no longer a dependency
            `bbb.k' changed
 Install file: "bbb.k" as "%(inc_bbb_k)s"
 scons: rebuilding `file5' because `%(inc_bbb_k)s' changed
-%(_python_)s %(cat_py)s file5 file5.k
+%(cat_py)s file5 file5.k
 scons: rebuilding `file6' because AlwaysBuild() is specified
-%(_python_)s %(cat_py)s file6 file6.in
+%(cat_py)s file6 file6.in
 scons: rebuilding `%(subdir_file8)s' because:
            `first' is no longer a dependency
            `second' is a new dependency
-%(_python_)s %(cat_py)s %(subdir_file8)s %(subdir_file7_in)s
+%(cat_py)s %(subdir_file8)s %(subdir_file7_in)s
 """ % locals())
 
 test.run(chdir='src', arguments=args, stdout=expect)
 
 expect = test.wrap_stdout("""\
 scons: rebuilding `file3' because `zzz' is no longer a dependency
-%(_python_)s %(cat_py)s file3 xxx yyy
+%(cat_py)s file3 xxx yyy
 """ % locals())
 
 test.run(chdir='src', arguments=args, stdout=expect)
 
 expect = test.wrap_stdout("""\
 scons: rebuilding `file3' because `zzz' is a new dependency
-%(_python_)s %(cat_py)s file3 xxx yyy zzz
+%(cat_py)s file3 xxx yyy zzz
 """ % locals())
 
 test.run(chdir='src', arguments=args, stdout=expect)
 env.Cat('file3', ['zzz', 'yyy', 'xxx'])
 """)
 
+cat_py_sep = string.replace(cat_py, '\\', '\\\\')
+
 expect = test.wrap_stdout("""\
 scons: rebuilding `file3' because the dependency order changed:
-               old: ['xxx', 'yyy', 'zzz', '%(python)s']
-               new: ['zzz', 'yyy', 'xxx', '%(python)s']
-%(_python_)s %(cat_py)s file3 zzz yyy xxx
+               old: ['xxx', 'yyy', 'zzz', '%(cat_py_sep)s']
+               new: ['zzz', 'yyy', 'xxx', '%(cat_py_sep)s']
+%(cat_py)s file3 zzz yyy xxx
 """ % locals())
 
 test.run(chdir='src', arguments=args, stdout=expect)
 Import("env")
 f3 = File('file3')
 env.Cat(f3, ['zzz', 'yyy', 'xxx'])
-env.AddPostAction(f3, r'%(_python_)s %(cat_py)s ${TARGET}.yyy $SOURCES yyy')
-env.AddPreAction(f3, r'%(_python_)s %(cat_py)s ${TARGET}.alt $SOURCES')
+env.AddPostAction(f3, r'%(cat_py)s ${TARGET}.yyy $SOURCES yyy')
+env.AddPreAction(f3, r'%(cat_py)s ${TARGET}.alt $SOURCES')
 """ % locals())
 
 expect = test.wrap_stdout("""\
 scons: rebuilding `file3' because the build action changed:
-               old: %(_python_)s %(cat_py)s $TARGET $SOURCES
-               new: %(_python_)s %(cat_py)s ${TARGET}.alt $SOURCES
-                    %(_python_)s %(cat_py)s $TARGET $SOURCES
-                    %(_python_)s %(cat_py)s ${TARGET}.yyy $SOURCES yyy
-%(_python_)s %(cat_py)s file3.alt zzz yyy xxx
-%(_python_)s %(cat_py)s file3 zzz yyy xxx
-%(_python_)s %(cat_py)s file3.yyy zzz yyy xxx yyy
+               old: %(cat_py)s $TARGET $SOURCES
+               new: %(cat_py)s ${TARGET}.alt $SOURCES
+                    %(cat_py)s $TARGET $SOURCES
+                    %(cat_py)s ${TARGET}.yyy $SOURCES yyy
+%(cat_py)s file3.alt zzz yyy xxx
+%(cat_py)s file3 zzz yyy xxx
+%(cat_py)s file3.yyy zzz yyy xxx yyy
 """ % locals())
 
 test.run(chdir='src', arguments=args, stdout=expect)
 Import("env")
 f3 = File('file3')
 env.Cat(f3, ['zzz', 'yyy', 'xxx'])
-env.AddPostAction(f3, r'%(_python_)s %(cat_py)s ${TARGET}.yyy $SOURCES xxx')
-env.AddPreAction(f3, r'%(_python_)s %(cat_py)s ${TARGET}.alt $SOURCES')
+env.AddPostAction(f3, r'%(cat_py)s ${TARGET}.yyy $SOURCES xxx')
+env.AddPreAction(f3, r'%(cat_py)s ${TARGET}.alt $SOURCES')
 """ % locals())
 
 expect = test.wrap_stdout("""\
 scons: rebuilding `file3' because the build action changed:
-               old: %(_python_)s %(cat_py)s ${TARGET}.alt $SOURCES
-                    %(_python_)s %(cat_py)s $TARGET $SOURCES
-                    %(_python_)s %(cat_py)s ${TARGET}.yyy $SOURCES yyy
-               new: %(_python_)s %(cat_py)s ${TARGET}.alt $SOURCES
-                    %(_python_)s %(cat_py)s $TARGET $SOURCES
-                    %(_python_)s %(cat_py)s ${TARGET}.yyy $SOURCES xxx
-%(_python_)s %(cat_py)s file3.alt zzz yyy xxx
-%(_python_)s %(cat_py)s file3 zzz yyy xxx
-%(_python_)s %(cat_py)s file3.yyy zzz yyy xxx xxx
+               old: %(cat_py)s ${TARGET}.alt $SOURCES
+                    %(cat_py)s $TARGET $SOURCES
+                    %(cat_py)s ${TARGET}.yyy $SOURCES yyy
+               new: %(cat_py)s ${TARGET}.alt $SOURCES
+                    %(cat_py)s $TARGET $SOURCES
+                    %(cat_py)s ${TARGET}.yyy $SOURCES xxx
+%(cat_py)s file3.alt zzz yyy xxx
+%(cat_py)s file3 zzz yyy xxx
+%(cat_py)s file3.yyy zzz yyy xxx xxx
 """ % locals())
 
 test.run(chdir='src', arguments=args, stdout=expect)
 test.write(['src', 'SConscript'], """\
 Import("env")
 env.Command('file4', 'file4.in',
-            r'%(_python_)s %(cat_py)s $TARGET $FILE4FLAG $SOURCES',
+            r'%(cat_py)s $TARGET $FILE4FLAG $SOURCES',
             FILE4FLAG='')
 """ % locals())
 
 expect = test.wrap_stdout("""\
 scons: rebuilding `file4' because the contents of the build action changed
-               action: %(_python_)s %(cat_py)s $TARGET $FILE4FLAG $SOURCES
-%(_python_)s %(cat_py)s file4 file4.in
+               action: %(cat_py)s $TARGET $FILE4FLAG $SOURCES
+%(cat_py)s file4 file4.in
 """ % locals())
 
 test.run(chdir='src',arguments=args, stdout=expect)

test/sconsign/script/SConsignFile.py

 import TestSCons
 import TestSConsign
 
-python = TestSCons.python
-python_dir, python_file = os.path.split(python)
-_python_ = TestSCons._python_
-
-python_re = re.escape(python)
-python_dir_re = re.escape(python_dir)
-python_file_re = re.escape(python_file)
-
 test = TestSConsign.TestSConsign(match = TestSConsign.match_re)
 
 test.subdir('sub1', 'sub2')
 
-test.write('fake_cc.py', r"""
+fake_cc_py = test.workpath('fake_cc.py')
+fake_link_py = test.workpath('fake_link.py')
+
+test.write(fake_cc_py, r"""#!/usr/bin/env python
 import os
 import re
 import string
 sys.exit(0)
 """)
 
-test.write('fake_link.py', r"""
+test.write(fake_link_py, r"""#!/usr/bin/env python
 import sys
 
 output = open(sys.argv[1], 'wb')
 sys.exit(0)
 """)
 
+test.chmod(fake_cc_py, 0755)
+test.chmod(fake_link_py, 0755)
+
 # Note:  We don't use os.path.join() representations of the file names
 # in the expected output because paths in the .sconsign files are
 # canonicalized to use / as the separator.
 SConsignFile()
 env1 = Environment(PROGSUFFIX = '.exe',
                    OBJSUFFIX = '.obj',
-                   CCCOM = r'%(_python_)s fake_cc.py sub2 $TARGET $SOURCE',
-                   LINKCOM = r'%(_python_)s fake_link.py $TARGET $SOURCE')
+                   CCCOM = [[r'%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+                   LINKCOM = [[r'%(fake_link_py)s', '$TARGET', '$SOURCE']])
 env1.PrependENVPath('PATHEXT', '.PY')
 env1.Program('sub1/hello.c')
 env2 = env1.Clone(CPPPATH = ['sub2'])
 test.run_sconsign(arguments = ".sconsign",
          stdout = r"""=== .:
 SConstruct: None \d+ \d+
-=== %(python_dir_re)s:
-%(python_file_re)s: %(sig_re)s \d+ \d+
+fake_cc\.py: %(sig_re)s \d+ \d+
+fake_link\.py: %(sig_re)s \d+ \d+
 === sub1:
 hello.c: %(sig_re)s \d+ \d+
 hello.exe: %(sig_re)s \d+ \d+
         %(sub1_hello_obj)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_link\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 hello.obj: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 === sub2:
 hello.c: %(sig_re)s \d+ \d+
 hello.exe: %(sig_re)s \d+ \d+
         %(sub2_hello_obj)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_link\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 hello.obj: %(sig_re)s \d+ \d+
         %(sub2_hello_c)s: %(sig_re)s \d+ \d+
         %(sub2_inc1_h)s: %(sig_re)s \d+ \d+
         %(sub2_inc2_h)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 inc1.h: %(sig_re)s \d+ \d+
 inc2.h: %(sig_re)s \d+ \d+
 test.run_sconsign(arguments = "--raw .sconsign",
          stdout = r"""=== .:
 SConstruct: {'csig': None, 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
-=== %(python_dir_re)s:
-%(python_file_re)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
+fake_cc\.py: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
+fake_link\.py: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
 === sub1:
 hello.c: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
 hello.exe: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sub1_hello_obj)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
-        %(python_re)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
+        fake_link\.py: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sig_re)s \[.*\]
 hello.obj: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sub1_hello_c)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
-        %(python_re)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
+        fake_cc\.py: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sig_re)s \[.*\]
 === sub2:
 hello.c: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
 hello.exe: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sub2_hello_obj)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
-        %(python_re)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
+        fake_link\.py: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sig_re)s \[.*\]
 hello.obj: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sub2_hello_c)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sub2_inc1_h)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sub2_inc2_h)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
-        %(python_re)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
+        fake_cc\.py: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sig_re)s \[.*\]
 inc1.h: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
 inc2.h: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
     csig: None
     timestamp: \d+
     size: \d+
-=== %(python_dir_re)s:
-%(python_file_re)s:
+fake_cc\.py:
+    csig: %(sig_re)s
+    timestamp: \d+
+    size: \d+
+fake_link\.py:
     csig: %(sig_re)s
     timestamp: \d+
     size: \d+
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
-        %(python_re)s:
+        fake_link\.py:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
-        %(python_re)s:
+        fake_cc\.py:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
-        %(python_re)s:
+        fake_link\.py:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
-        %(python_re)s:
+        fake_cc\.py:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
          stdout = r"""=== .:
 SConstruct:
     csig: None
-=== %(python_dir_re)s:
-%(python_file_re)s:
+fake_cc\.py:
+    csig: %(sig_re)s
+fake_link\.py:
     csig: %(sig_re)s
 === sub1:
 hello.c:
          stdout = r"""=== .:
 SConstruct:
     size: \d+
-=== %(python_dir_re)s:
-%(python_file_re)s:
+fake_cc\.py:
+    size: \d+
+fake_link\.py:
     size: \d+
 === sub1:
 hello.c:
          stdout = r"""=== .:
 SConstruct:
     timestamp: \d+
-=== %(python_dir_re)s:
-%(python_file_re)s:
+fake_cc\.py:
+    timestamp: \d+
+fake_link\.py:
     timestamp: \d+
 === sub1:
 hello.c:
 
 test.run_sconsign(arguments = "-e hello.obj .sconsign",
          stdout = r"""=== .:
-=== %(python_dir_re)s:
 === sub1:
 hello.obj: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 === sub2:
 hello.obj: %(sig_re)s \d+ \d+
         %(sub2_hello_c)s: %(sig_re)s \d+ \d+
         %(sub2_inc1_h)s: %(sig_re)s \d+ \d+
         %(sub2_inc2_h)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals(),
          stderr = r"""sconsign: no entry `hello\.obj' in `\.'
-sconsign: no entry `hello\.obj' in `%(python_dir_re)s'
 """ % locals())
 
 test.run_sconsign(arguments = "-e hello.obj -e hello.exe -e hello.obj .sconsign",
          stdout = r"""=== .:
-=== %(python_dir_re)s:
 === sub1:
 hello.obj: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 hello.exe: %(sig_re)s \d+ \d+
         %(sub1_hello_obj)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_link\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 hello.obj: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 === sub2:
 hello.obj: %(sig_re)s \d+ \d+
         %(sub2_hello_c)s: %(sig_re)s \d+ \d+
         %(sub2_inc1_h)s: %(sig_re)s \d+ \d+
         %(sub2_inc2_h)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 hello.exe: %(sig_re)s \d+ \d+
         %(sub2_hello_obj)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_link\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 hello.obj: %(sig_re)s \d+ \d+
         %(sub2_hello_c)s: %(sig_re)s \d+ \d+
         %(sub2_inc1_h)s: %(sig_re)s \d+ \d+
         %(sub2_inc2_h)s: %(sig_re)s \d+ \d+
-        %(python_re)s: %(sig_re)s \d+ \d+
+        fake_cc\.py: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals(),
         stderr = r"""sconsign: no entry `hello\.obj' in `\.'
 sconsign: no entry `hello\.exe' in `\.'
 sconsign: no entry `hello\.obj' in `\.'
-sconsign: no entry `hello\.obj' in `%(python_dir_re)s'
-sconsign: no entry `hello\.exe' in `%(python_dir_re)s'
-sconsign: no entry `hello\.obj' in `%(python_dir_re)s'
 """ % locals())
 
 #test.run_sconsign(arguments = "-i -v .sconsign",

test/sconsign/script/Signatures.py

 Decider('timestamp-newer')
 env1 = Environment(PROGSUFFIX = '.exe',
                    OBJSUFFIX = '.obj',
-                   CCCOM = r'%(fake_cc_py)s sub2 $TARGET $SOURCE',
-                   LINKCOM = r'%(fake_link_py)s $TARGET $SOURCE')
+                   # Specify the command lines with lists-of-lists so
+                   # finding the implicit dependencies works even with
+                   # spaces in the fake_*_py path names.
+                   CCCOM = [[r'%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+                   LINKCOM = [[r'%(fake_link_py)s', '$TARGET', '$SOURCE']])
+env1.PrependENVPath('PATHEXT', '.PY')
 env1.Program('sub1/hello.c')
 env2 = env1.Clone(CPPPATH = ['sub2'])
 env2.Program('sub2/hello.c')

test/sconsign/script/no-SConsignFile.py

 SConsignFile(None)
 env1 = Environment(PROGSUFFIX = '.exe',
                    OBJSUFFIX = '.obj',
-                   CCCOM = r'%(fake_cc_py)s sub2 $TARGET $SOURCE',
-                   LINKCOM = r'%(fake_link_py)s $TARGET $SOURCE')
+                   # Specify the command lines with lists-of-lists so
+                   # finding the implicit dependencies works even with
+                   # spaces in the fake_*_py path names.
+                   CCCOM = [[r'%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+                   LINKCOM = [[r'%(fake_link_py)s', '$TARGET', '$SOURCE']])
 env1.PrependENVPath('PATHEXT', '.PY')
 env1.Program('sub1/hello.c')
 env2 = env1.Clone(CPPPATH = ['sub2'])
 """ % locals()
 
 test.run_sconsign(arguments = "sub1/.sconsign", stdout=expect)
-#test.run_sconsign(arguments = "sub1/.sconsign")
-#print test.stdout()
 
 test.run_sconsign(arguments = "--raw sub1/.sconsign",
          stdout = r"""hello.c: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}