summaryrefslogtreecommitdiffstats
path: root/test/sconsign
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2021-04-02 13:43:49 (GMT)
committerMats Wichmann <mats@linux.com>2021-04-14 21:32:13 (GMT)
commitb6e861cc465680f4c1ae5ec3327504da9afd5730 (patch)
tree48ff81509abb6be7270e6c45cf2286338043ace8 /test/sconsign
parenta20701025fa9f7901396b7d148c5069e86e16944 (diff)
downloadSCons-b6e861cc465680f4c1ae5ec3327504da9afd5730.zip
SCons-b6e861cc465680f4c1ae5ec3327504da9afd5730.tar.gz
SCons-b6e861cc465680f4c1ae5ec3327504da9afd5730.tar.bz2
Test tweaks to help testing on mingw-only win32 systems
On a system where SCons is started from the mingw bash shell, and mingw Python is the interpreter, the secondary self-identification differs. Use that in a few tests which otherwise make the wrong decision. EnvironmentTests used an invalid value for CCFLAGS, and empty string is a better choice. Change a couple of cases where Python code was run directly so it's prefixed by the-Python-in-use, which fails if there is not a Windows-registered program for .py files - we didn't really want to use the Windows-native Python anyway. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/sconsign')
-rw-r--r--test/sconsign/script/SConsignFile.py24
-rw-r--r--test/sconsign/script/Signatures.py30
-rw-r--r--test/sconsign/script/no-SConsignFile.py27
3 files changed, 51 insertions, 30 deletions
diff --git a/test/sconsign/script/SConsignFile.py b/test/sconsign/script/SConsignFile.py
index 47fe94f..1d4cc1e 100644
--- a/test/sconsign/script/SConsignFile.py
+++ b/test/sconsign/script/SConsignFile.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# 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 sconsign script works with files generated when
@@ -99,15 +98,22 @@ sub2_inc2_h = 'sub2/inc2.h'
test.write(['SConstruct'], """\
SConsignFile()
-env1 = Environment(PROGSUFFIX = '.exe',
- OBJSUFFIX = '.obj',
- CCCOM = [[r'%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
- LINKCOM = [[r'%(fake_link_py)s', '$TARGET', '$SOURCE']])
+env1 = Environment(
+ PROGSUFFIX='.exe',
+ OBJSUFFIX='.obj',
+ CCCOM=[['%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+ LINKCOM=[['%(fake_link_py)s', '$TARGET', '$SOURCE']],
+)
env1.PrependENVPath('PATHEXT', '.PY')
env1.Program('sub1/hello.c')
-env2 = env1.Clone(CPPPATH = ['sub2'])
+env2 = env1.Clone(CPPPATH=['sub2'])
env2.Program('sub2/hello.c')
""" % locals())
+# TODO in the above, we would normally want to run a python program
+# using "our python" as in:
+# CCCOM=[['%(_python_)s', '%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+# LINKCOM=[['%(_python_)s', '%(fake_link_py)s', '$TARGET', '$SOURCE']],
+# however we're looking at dependencies with sconsign, so that breaks things
test.write(['sub1', 'hello.c'], r"""
sub1/hello.c
diff --git a/test/sconsign/script/Signatures.py b/test/sconsign/script/Signatures.py
index 9583cc6..b36292a 100644
--- a/test/sconsign/script/Signatures.py
+++ b/test/sconsign/script/Signatures.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# 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 sconsign script works when using a .sconsign file in
@@ -108,18 +107,25 @@ test.chmod(fake_link_py, 0o755)
test.write('SConstruct', """
SConsignFile(None)
Decider('timestamp-newer')
-env1 = Environment(PROGSUFFIX = '.exe',
- OBJSUFFIX = '.obj',
- # 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 = Environment(
+ PROGSUFFIX='.exe',
+ OBJSUFFIX='.obj',
+ # Specify the command lines with lists-of-lists so
+ # finding the implicit dependencies works even with
+ # spaces in the fake_*_py path names.
+ CCCOM=[['%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+ LINKCOM=[['%(fake_link_py)s', '$TARGET', '$SOURCE']],
+)
env1.PrependENVPath('PATHEXT', '.PY')
env1.Program('sub1/hello.c')
-env2 = env1.Clone(CPPPATH = ['sub2'])
+env2 = env1.Clone(CPPPATH=['sub2'])
env2.Program('sub2/hello.c')
""" % locals())
+# TODO in the above, we would normally want to run a python program
+# using "our python" as in:
+# CCCOM=[['%(_python_)s', '%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+# LINKCOM=[['%(_python_)s', '%(fake_link_py)s', '$TARGET', '$SOURCE']],
+# however we're looking at dependencies with sconsign, so that breaks things
test.write(['sub1', 'hello.c'], r"""\
sub1/hello.c
diff --git a/test/sconsign/script/no-SConsignFile.py b/test/sconsign/script/no-SConsignFile.py
index 3702c6c..d12d151 100644
--- a/test/sconsign/script/no-SConsignFile.py
+++ b/test/sconsign/script/no-SConsignFile.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -110,18 +112,25 @@ sub2_inc2_h = 'sub2/inc2.h'
test.write(['SConstruct'], """
SConsignFile(None)
-env1 = Environment(PROGSUFFIX = '.exe',
- OBJSUFFIX = '.obj',
- # 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 = Environment(
+ PROGSUFFIX='.exe',
+ OBJSUFFIX='.obj',
+ # Specify the command lines with lists-of-lists so
+ # finding the implicit dependencies works even with
+ # spaces in the fake_*_py path names.
+ CCCOM=[['%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+ LINKCOM=[['%(fake_link_py)s', '$TARGET', '$SOURCE']],
+)
env1.PrependENVPath('PATHEXT', '.PY')
env1.Program('sub1/hello.c')
-env2 = env1.Clone(CPPPATH = ['sub2'])
+env2 = env1.Clone(CPPPATH=['sub2'])
env2.Program('sub2/hello.c')
""" % locals())
+# TODO in the above, we would normally want to run a python program
+# using "our python" as in:
+# CCCOM=[['%(_python_)s', '%(fake_cc_py)s', 'sub2', '$TARGET', '$SOURCE']],
+# LINKCOM=[['%(_python_)s', '%(fake_link_py)s', '$TARGET', '$SOURCE']],
+# however we're looking at dependencies with sconsign, so that breaks things
test.write(['sub1', 'hello.c'], r"""\
sub1/hello.c