summaryrefslogtreecommitdiffstats
path: root/test/option
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2015-12-24 16:32:14 (GMT)
committerRussel Winder <russel@winder.org.uk>2015-12-24 16:32:14 (GMT)
commit2a270c8f314e959c78e9deda29c8f250bb934dd6 (patch)
tree7008e644357036404f0861c8ba1bbbf43b2b4123 /test/option
parenta7d764ed831fa3243aa0bd3307f641e1e1f9f8a8 (diff)
parent9d558dd65deacc958edc1f0da2dab1ec56ff4e4e (diff)
downloadSCons-2a270c8f314e959c78e9deda29c8f250bb934dd6.zip
SCons-2a270c8f314e959c78e9deda29c8f250bb934dd6.tar.gz
SCons-2a270c8f314e959c78e9deda29c8f250bb934dd6.tar.bz2
Post merge commit for safety. Building Fortran code works, but tests fail.
Diffstat (limited to 'test/option')
-rw-r--r--test/option/debug-count.py13
-rw-r--r--test/option/md5-chunksize.py4
-rw-r--r--test/option/profile.py21
-rw-r--r--test/option/tree-lib.py2
4 files changed, 19 insertions, 21 deletions
diff --git a/test/option/debug-count.py b/test/option/debug-count.py
index ce79086..b82a434 100644
--- a/test/option/debug-count.py
+++ b/test/option/debug-count.py
@@ -29,6 +29,7 @@ Test that the --debug=count option works.
"""
import re
+import sys
import TestSCons
@@ -86,11 +87,13 @@ scons: warning: --debug=count is not supported when running SCons
\twith the python -O option or optimized \\(.pyo\\) modules.
""" + TestSCons.file_expr
-test.run(arguments = '--debug=count -h',
- interpreter = ['python', '-O'],
- stderr = expect_warning,
- match = TestSCons.match_re)
-
+test.run(
+ arguments = '--debug=count -h',
+ # Test against current interpreter vs default path option.
+ interpreter = [ sys.executable, '-O' ],
+ stderr = expect_warning,
+ match = TestSCons.match_re
+)
test.pass_test()
diff --git a/test/option/md5-chunksize.py b/test/option/md5-chunksize.py
index 375208d..dbb2615 100644
--- a/test/option/md5-chunksize.py
+++ b/test/option/md5-chunksize.py
@@ -104,8 +104,8 @@ get_stat(["test.stat"], ["test.big"])
test2.write('SConstruct', """
import os
def get_stat(target, source, env):
- stat = os.stat(source[0].abspath)
- dest = open(target[0].abspath,'w')
+ stat = os.stat(source[0].get_abspath())
+ dest = open(target[0].get_abspath(),'w')
dest.write(str(stat))
dest.close()
env = Environment()
diff --git a/test/option/profile.py b/test/option/profile.py
index f408136..93dad91 100644
--- a/test/option/profile.py
+++ b/test/option/profile.py
@@ -26,19 +26,14 @@ from SCons.compat.six import u
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
-try:
- import io
- _StringIO = io.StringIO
-except (ImportError, AttributeError):
- # Pre-2.6 Python has no "io" module.
- exec('from cStringIO import StringIO')
-else:
- # TODO(2.6): In 2.6 and beyond, the io.StringIO.write() method
- # requires unicode strings. This subclass can probably be removed
- # when we drop support for Python 2.6.
- class StringIO(_StringIO):
- def write(self, s):
- _StringIO.write(self, u(s))
+import io
+_StringIO = io.StringIO
+# TODO(2.6): In 2.6 and beyond, the io.StringIO.write() method
+# requires unicode strings. This subclass can probably be removed
+# when we drop support for Python 2.6.
+class StringIO(_StringIO):
+ def write(self, s):
+ _StringIO.write(self, unicode(s))
import TestSCons
diff --git a/test/option/tree-lib.py b/test/option/tree-lib.py
index 2721344..2dc5fb0 100644
--- a/test/option/tree-lib.py
+++ b/test/option/tree-lib.py
@@ -52,7 +52,7 @@ test.write('main.c', """\
#include <stdlib.h>
#include <stdio.h>
int
-main(int argc, char *argv)
+main(int argc, char **argv)
{
printf("#define FOO_H \\"foo.h\\"\\n");
return (0);