Update tests for now discovering dependencies on quoted commands
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 20 Jan 2009 19:46:16 +0000 (19:46 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 20 Jan 2009 19:46:16 +0000 (19:46 +0000)
in command lines.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@3913 fdb21ef1-2011-0410-befe-b5e4ea1792b1

test/explain/basic.py
test/sconsign/script/SConsignFile.py
test/sconsign/script/Signatures.py
test/sconsign/script/no-SConsignFile.py

index b30e60436c7eeeccb215366bdf04d098010afd84..6e37dfac2fabeaded5e32d4ec88b14a77e0e48d9 100644 (file)
@@ -28,11 +28,12 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 Verify a lot of the basic operation of the --debug=explain option.
 """
 
-import os.path
+import os
 import string
 import sys
 import TestSCons
 
+python = TestSCons.python
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
@@ -316,8 +317,8 @@ env.Cat('file3', ['zzz', 'yyy', 'xxx'])
 
 expect = test.wrap_stdout("""\
 scons: rebuilding `file3' because the dependency order changed:
-               old: ['xxx', 'yyy', 'zzz']
-               new: ['zzz', 'yyy', 'xxx']
+               old: ['xxx', 'yyy', 'zzz', '%(python)s']
+               new: ['zzz', 'yyy', 'xxx', '%(python)s']
 %(_python_)s %(cat_py)s file3 zzz yyy xxx
 """ % locals())
 
index 54ecaaa202f2ba08eb998ab9e9e173961fc6cc46..9341062fc3740470c60000fc206f6ae21f16e879 100644 (file)
@@ -29,17 +29,26 @@ Verify that the sconsign script works with files generated when
 using the signatures in an SConsignFile().
 """
 
+import os
+import re
+
 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"""
-import os.path
+import os
 import re
 import string
 import sys
@@ -137,23 +146,29 @@ sig_re = r'[0-9a-fA-F]{32}'
 test.run_sconsign(arguments = ".sconsign",
          stdout = r"""=== .:
 SConstruct: None \d+ \d+
+=== %(python_dir_re)s:
+%(python_file_re)s: %(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+
         %(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+
         %(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+
         %(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+
         %(sig_re)s \[.*\]
 inc1.h: %(sig_re)s \d+ \d+
 inc2.h: %(sig_re)s \d+ \d+
@@ -162,23 +177,29 @@ 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}
 === 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}
         %(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}
         %(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}
         %(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}
         %(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}
@@ -189,6 +210,11 @@ SConstruct:
     csig: None
     timestamp: \d+
     size: \d+
+=== %(python_dir_re)s:
+%(python_file_re)s:
+    csig: %(sig_re)s
+    timestamp: \d+
+    size: \d+
 === sub1:
 hello.c:
     csig: %(sig_re)s
@@ -203,6 +229,10 @@ hello.exe:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
+        %(python_re)s:
+            csig: %(sig_re)s
+            timestamp: \d+
+            size: \d+
     action: %(sig_re)s \[.*\]
 hello.obj:
     csig: %(sig_re)s
@@ -213,6 +243,10 @@ hello.obj:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
+        %(python_re)s:
+            csig: %(sig_re)s
+            timestamp: \d+
+            size: \d+
     action: %(sig_re)s \[.*\]
 === sub2:
 hello.c:
@@ -228,6 +262,10 @@ hello.exe:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
+        %(python_re)s:
+            csig: %(sig_re)s
+            timestamp: \d+
+            size: \d+
     action: %(sig_re)s \[.*\]
 hello.obj:
     csig: %(sig_re)s
@@ -246,6 +284,10 @@ hello.obj:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
+        %(python_re)s:
+            csig: %(sig_re)s
+            timestamp: \d+
+            size: \d+
     action: %(sig_re)s \[.*\]
 inc1.h:
     csig: %(sig_re)s
@@ -263,6 +305,9 @@ test.run_sconsign(arguments = "-c -v .sconsign",
          stdout = r"""=== .:
 SConstruct:
     csig: None
+=== %(python_dir_re)s:
+%(python_file_re)s:
+    csig: %(sig_re)s
 === sub1:
 hello.c:
     csig: %(sig_re)s
@@ -287,6 +332,9 @@ test.run_sconsign(arguments = "-s -v .sconsign",
          stdout = r"""=== .:
 SConstruct:
     size: \d+
+=== %(python_dir_re)s:
+%(python_file_re)s:
+    size: \d+
 === sub1:
 hello.c:
     size: \d+
@@ -311,6 +359,9 @@ test.run_sconsign(arguments = "-t -v .sconsign",
          stdout = r"""=== .:
 SConstruct:
     timestamp: \d+
+=== %(python_dir_re)s:
+%(python_file_re)s:
+    timestamp: \d+
 === sub1:
 hello.c:
     timestamp: \d+
@@ -333,50 +384,64 @@ inc2.h:
 
 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+
         %(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+
         %(sig_re)s \[.*\]
 """ % locals(),
-         stderr = r"""sconsign: no entry `hello.obj' in `\.'
-""")
+         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+
         %(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+
         %(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+
         %(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+
         %(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+
         %(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+
         %(sig_re)s \[.*\]
 """ % locals(),
-        stderr = r"""sconsign: no entry `hello.obj' in `\.'
-sconsign: no entry `hello.exe' in `\.'
-sconsign: no entry `hello.obj' in `\.'
+        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",
index 269056137e5c39f05f103667b19cfb116833c176..823ef1df50ca5e2bbfc94e4141facae6dbfe4f7b 100644 (file)
@@ -36,6 +36,7 @@ SourceSignatures('timestamp') with TargetSignatures('content').
 import TestSCons
 import TestSConsign
 
+python = TestSCons.python
 _python_ = TestSCons._python_
 
 test = TestSConsign.TestSConsign(match = TestSConsign.match_re)
@@ -50,7 +51,7 @@ sub1_hello_obj  = 'sub1/hello.obj'
 test.subdir('sub1', 'sub2')
 
 test.write('fake_cc.py', r"""
-import os.path
+import os
 import re
 import string
 import sys
@@ -135,18 +136,22 @@ date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d'
 test.run_sconsign(arguments = "-e hello.exe -e hello.obj sub1/.sconsign",
          stdout = r"""hello.exe: %(sig_re)s \d+ \d+
         %(sub1_hello_obj)s: %(sig_re)s \d+ \d+
+        %(python)s: None \d+ \d+
         %(sig_re)s \[.*\]
 hello.obj: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: None \d+ \d+
+        %(python)s: None \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals())
 
 test.run_sconsign(arguments = "-e hello.exe -e hello.obj -r sub1/.sconsign",
          stdout = r"""hello.exe: %(sig_re)s '%(date_re)s' \d+
         %(sub1_hello_obj)s: %(sig_re)s '%(date_re)s' \d+
+        %(python)s: None '%(date_re)s' \d+
         %(sig_re)s \[.*\]
 hello.obj: %(sig_re)s '%(date_re)s' \d+
         %(sub1_hello_c)s: None '%(date_re)s' \d+
+        %(python)s: None '%(date_re)s' \d+
         %(sig_re)s \[.*\]
 """ % locals())
 
index 6aede19df578bbde062b31e9ac8fa1fc48240b83..16389cb4fc9be7d075fb483801db6ae6131ac626 100644 (file)
@@ -32,6 +32,7 @@ Verify that the sconsign script works when using an individual
 import TestSCons
 import TestSConsign
 
+python = TestSCons.python
 _python_ = TestSCons._python_
 
 test = TestSConsign.TestSConsign(match = TestSConsign.match_re)
@@ -39,7 +40,7 @@ test = TestSConsign.TestSConsign(match = TestSConsign.match_re)
 test.subdir('sub1', 'sub2')
 
 test.write('fake_cc.py', r"""
-import os.path
+import os
 import re
 import string
 import sys
@@ -131,9 +132,11 @@ sig_re = r'[0-9a-fA-F]{32}'
 expect = r"""hello.c: %(sig_re)s \d+ \d+
 hello.exe: %(sig_re)s \d+ \d+
         %(sub1_hello_obj)s: %(sig_re)s \d+ \d+
+        %(python)s: %(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)s: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals()
 
@@ -145,9 +148,11 @@ test.run_sconsign(arguments = "--raw sub1/.sconsign",
          stdout = r"""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)s: {'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)s: {'csig': '%(sig_re)s', 'timestamp': \d+, 'size': \d+L?, '_version_id': 1}
         %(sig_re)s \[.*\]
 """ % locals())
 
@@ -165,6 +170,10 @@ hello.exe:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
+        %(python)s:
+            csig: %(sig_re)s
+            timestamp: \d+
+            size: \d+
     action: %(sig_re)s \[.*\]
 hello.obj:
     csig: %(sig_re)s
@@ -175,6 +184,10 @@ hello.obj:
             csig: %(sig_re)s
             timestamp: \d+
             size: \d+
+        %(python)s:
+            csig: %(sig_re)s
+            timestamp: \d+
+            size: \d+
     action: %(sig_re)s \[.*\]
 """ % locals())
 
@@ -208,18 +221,22 @@ hello.obj:
 test.run_sconsign(arguments = "-e hello.obj sub1/.sconsign",
          stdout = r"""hello.obj: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: %(sig_re)s \d+ \d+
+        %(python)s: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals())
 
 test.run_sconsign(arguments = "-e hello.obj -e hello.exe -e hello.obj sub1/.sconsign",
          stdout = r"""hello.obj: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: %(sig_re)s \d+ \d+
+        %(python)s: %(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)s: %(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)s: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals())
 
@@ -227,11 +244,13 @@ test.run_sconsign(arguments = "sub2/.sconsign",
          stdout = r"""hello.c: %(sig_re)s \d+ \d+
 hello.exe: %(sig_re)s \d+ \d+
         %(sub2_hello_obj)s: %(sig_re)s \d+ \d+
+        %(python)s: %(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)s: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 inc1.h: %(sig_re)s \d+ \d+
 inc2.h: %(sig_re)s \d+ \d+
@@ -254,9 +273,11 @@ test.run_sconsign(arguments = "-e hello.obj sub2/.sconsign sub1/.sconsign",
         %(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)s: %(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)s: %(sig_re)s \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals())