summaryrefslogtreecommitdiffstats
path: root/test/RANLIB
diff options
context:
space:
mode:
Diffstat (limited to 'test/RANLIB')
-rw-r--r--test/RANLIB/RANLIB.py10
-rw-r--r--test/RANLIB/RANLIBCOM.py8
-rw-r--r--test/RANLIB/RANLIBCOMSTR.py16
-rw-r--r--test/RANLIB/RANLIBFLAGS.py13
4 files changed, 30 insertions, 17 deletions
diff --git a/test/RANLIB/RANLIB.py b/test/RANLIB/RANLIB.py
index 5002b20..75e860a 100644
--- a/test/RANLIB/RANLIB.py
+++ b/test/RANLIB/RANLIB.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
@@ -53,7 +53,7 @@ test.write('SConstruct', """
foo = Environment(LIBS = ['foo'], LIBPATH = ['.'])
ranlib = foo.Dictionary('RANLIB')
bar = Environment(LIBS = ['bar'], LIBPATH = ['.'],
- RANLIB = r'%s wrapper.py ' + ranlib)
+ RANLIB = r'%(_python_)s wrapper.py ' + ranlib)
foo.Library(target = 'foo', source = 'foo.c')
bar.Library(target = 'bar', source = 'bar.c')
@@ -61,9 +61,10 @@ main = foo.Object('main', 'main.c')
foo.Program(target = 'f', source = main)
bar.Program(target = 'b', source = main)
-""" % python)
+""" % locals())
test.write('foo.c', r"""
+#include <stdio.h>
void
library_function(void)
{
@@ -72,6 +73,8 @@ library_function(void)
""")
test.write('bar.c', r"""
+#include <stdio.h>
+
void
library_function(void)
{
@@ -80,6 +83,7 @@ library_function(void)
""")
test.write('main.c', r"""
+#include <stdlib.h>
int
main(int argc, char *argv[])
{
diff --git a/test/RANLIB/RANLIBCOM.py b/test/RANLIB/RANLIBCOM.py
index d60a14e..312216b 100644
--- a/test/RANLIB/RANLIBCOM.py
+++ b/test/RANLIB/RANLIBCOM.py
@@ -30,7 +30,7 @@ Test the ability to configure the $RANLIBCOM construction variable.
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -62,12 +62,12 @@ sys.exit(0)
test.write('SConstruct', """
env = Environment(tools=['default', 'ar'],
- ARCOM = r'%s myar.py $TARGET $SOURCES',
- RANLIBCOM = r'%s myranlib.py $TARGET',
+ ARCOM = r'%(_python_)s myar.py $TARGET $SOURCES',
+ RANLIBCOM = r'%(_python_)s myranlib.py $TARGET',
LIBPREFIX = '',
LIBSUFFIX = '.lib')
env.Library(target = 'output', source = ['file.1', 'file.2'])
-""" % (python, python))
+""" % locals())
test.write('file.1', "file.1\n/*ar*/\n/*ranlib*/\n")
test.write('file.2', "file.2\n/*ar*/\n/*ranlib*/\n")
diff --git a/test/RANLIB/RANLIBCOMSTR.py b/test/RANLIB/RANLIBCOMSTR.py
index 4e03675..6929ac6 100644
--- a/test/RANLIB/RANLIBCOMSTR.py
+++ b/test/RANLIB/RANLIBCOMSTR.py
@@ -31,7 +31,7 @@ customize the displayed archive indexer string.
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -63,21 +63,23 @@ sys.exit(0)
test.write('SConstruct', """
env = Environment(tools=['default', 'ar'],
- ARCOM = r'%s myar.py $TARGET $SOURCES',
- RANLIBCOM = r'%s myranlib.py $TARGET',
+ ARCOM = r'%(_python_)s myar.py $TARGET $SOURCES',
+ RANLIBCOM = r'%(_python_)s myranlib.py $TARGET',
RANLIBCOMSTR = 'Indexing $TARGET',
LIBPREFIX = '',
LIBSUFFIX = '.lib')
env.Library(target = 'output', source = ['file.1', 'file.2'])
-""" % (python, python))
+""" % locals())
test.write('file.1', "file.1\n/*ar*/\n/*ranlib*/\n")
test.write('file.2', "file.2\n/*ar*/\n/*ranlib*/\n")
-test.run(stdout = test.wrap_stdout("""\
-%s myar.py output.lib file.1 file.2
+expect = test.wrap_stdout("""\
+%(_python_)s myar.py output.lib file.1 file.2
Indexing output.lib
-""" % python))
+""" % locals())
+
+test.run(stdout = expect)
test.must_match('output.lib', "file.1\nfile.2\n")
diff --git a/test/RANLIB/RANLIBFLAGS.py b/test/RANLIB/RANLIBFLAGS.py
index 80618ba..08ee967 100644
--- a/test/RANLIB/RANLIBFLAGS.py
+++ b/test/RANLIB/RANLIBFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -50,7 +50,7 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(LIBS = ['foo'], LIBPATH = ['.'])
bar = Environment(LIBS = ['bar'], LIBPATH = ['.'], RANLIB = '',
- RANLIBFLAGS = foo.subst(r'%s wrapper.py $RANLIB $RANLIBFLAGS'))
+ RANLIBFLAGS = foo.subst(r'%(_python_)s wrapper.py $RANLIB $RANLIBFLAGS'))
foo.Library(target = 'foo', source = 'foo.c')
bar.Library(target = 'bar', source = 'bar.c')
@@ -58,9 +58,12 @@ main = foo.Object('main', 'main.c')
foo.Program(target = 'f', source = main)
bar.Program(target = 'b', source = main)
-""" % python)
+""" % locals())
test.write('foo.c', r"""
+#include <stdlib.h>
+#include <stdio.h>
+
void
library_function(void)
{
@@ -69,6 +72,8 @@ library_function(void)
""")
test.write('bar.c', r"""
+#include <stdlib.h>
+#include <stdio.h>
void
library_function(void)
{
@@ -77,6 +82,8 @@ library_function(void)
""")
test.write('main.c', r"""
+#include <stdlib.h>
+
int
main(int argc, char *argv[])
{