summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-03-04 02:44:26 (GMT)
committerSteven Knight <knight@baldmt.com>2005-03-04 02:44:26 (GMT)
commit3bf4475522d2a24910b147a607dcd9f0d980097f (patch)
treef84f598ecc6c449fd1784b76ca52b7330d88f230 /test
parent101ccb287767fbe9509726a4af66f46d4caf2ea9 (diff)
downloadSCons-3bf4475522d2a24910b147a607dcd9f0d980097f.zip
SCons-3bf4475522d2a24910b147a607dcd9f0d980097f.tar.gz
SCons-3bf4475522d2a24910b147a607dcd9f0d980097f.tar.bz2
Fix Fedora Core 3 test portability.
Diffstat (limited to 'test')
-rw-r--r--test/Builder-factories.py4
-rw-r--r--test/Java/JAR.py36
-rw-r--r--test/Java/JARFLAGS.py36
-rw-r--r--test/Java/JAVAC.py21
-rw-r--r--test/Java/JAVACFLAGS.py18
-rw-r--r--test/SWIG/SWIG.py8
-rw-r--r--test/TAR/TARFLAGS.py4
7 files changed, 58 insertions, 69 deletions
diff --git a/test/Builder-factories.py b/test/Builder-factories.py
index 8bdcd3a..41f83a2 100644
--- a/test/Builder-factories.py
+++ b/test/Builder-factories.py
@@ -48,7 +48,9 @@ MakeDirectory = Builder(action=mkdir, target_factory=Dir)
def collect(env, source, target):
out = open(str(target[0]), 'wb')
dir = str(source[0])
- for f in os.listdir(dir):
+ files = os.listdir(dir)
+ files.sort()
+ for f in files:
f = os.path.join(dir, f)
out.write(open(f, 'r').read())
out.close()
diff --git a/test/Java/JAR.py b/test/Java/JAR.py
index ea51213..42f2c5a 100644
--- a/test/Java/JAR.py
+++ b/test/Java/JAR.py
@@ -119,29 +119,23 @@ test.run(arguments='classes.jar')
test.must_match('classes.jar',
'cvfm classes.jar foo.mf -C testdir bar.class\n')
-if test.detect_tool('javac'):
- where_javac = test.detect('JAVAC', 'javac')
+ENV = test.java_ENV()
+
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
else:
- import SCons.Environment
- env = SCons.Environment.Environment()
- where_javac = env.WhereIs('javac', os.environ['PATH'])
- if not where_javac:
- where_javac = env.WhereIs('javac', '/usr/local/j2sdk1.3.1/bin')
- if not where_javac:
- print "Could not find Java javac, skipping test(s)."
- test.pass_test(1)
-
-if test.detect_tool('jar'):
- where_jar = test.detect('JAR', 'jar')
+ where_javac = test.where_is('javac')
+if not where_javac:
+ print "Could not find Java javac, skipping test(s)."
+ test.pass_test(1)
+
+if test.detect_tool('jar', ENV=ENV):
+ where_jar = test.detect('JAR', 'jar', ENV=ENV)
else:
- import SCons.Environment
- env = SCons.Environment.Environment()
- where_jar = env.WhereIs('jar', os.environ['PATH'])
- if not where_jar:
- where_jar = env.WhereIs('jar', '/usr/local/j2sdk1.3.1/bin')
- if not where_jar:
- print "Could not find Java jar, skipping test(s)."
- test.pass_test(1)
+ where_jar = test.where_is('jar')
+if not where_jar:
+ print "Could not find Java jar, skipping test(s)."
+ test.pass_test(1)
test.write("wrapper.py", """\
diff --git a/test/Java/JARFLAGS.py b/test/Java/JARFLAGS.py
index 7e3669d..9a846ec 100644
--- a/test/Java/JARFLAGS.py
+++ b/test/Java/JARFLAGS.py
@@ -32,29 +32,23 @@ test = TestSCons.TestSCons()
test.subdir('src')
-if test.detect_tool('javac'):
- where_javac = test.detect('JAVAC', 'javac')
+ENV = test.java_ENV()
+
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
else:
- import SCons.Environment
- env = SCons.Environment.Environment()
- where_javac = env.WhereIs('javac', os.environ['PATH'])
- if not where_javac:
- where_javac = env.WhereIs('javac', '/usr/local/j2sdk1.3.1/bin')
- if not where_javac:
- print "Could not find Java javac, skipping test(s)."
- test.pass_test(1)
-
-if test.detect_tool('jar'):
- where_jar = test.detect('JAR', 'jar')
+ where_javac = test.where_is('javac')
+if not where_javac:
+ print "Could not find Java javac, skipping test(s)."
+ test.pass_test(1)
+
+if test.detect_tool('jar', ENV=ENV):
+ where_jar = test.detect('JAR', 'jar', ENV=ENV)
else:
- import SCons.Environment
- env = SCons.Environment.Environment()
- where_jar = env.WhereIs('jar', os.environ['PATH'])
- if not where_jar:
- where_jar = env.WhereIs('jar', '/usr/local/j2sdk1.3.1/bin')
- if not where_jar:
- print "Could not find Java jar, skipping test(s)."
- test.pass_test(1)
+ where_javac = test.where_is('jar')
+if not where_jar:
+ print "Could not find Java jar, skipping test(s)."
+ test.pass_test(1)
test.write('SConstruct', """
env = Environment(tools = ['javac', 'jar'],
diff --git a/test/Java/JAVAC.py b/test/Java/JAVAC.py
index 779045f..a89ed52 100644
--- a/test/Java/JAVAC.py
+++ b/test/Java/JAVAC.py
@@ -91,18 +91,17 @@ line 3
test.must_match('test2.class', "test2.JAVA\nline 3\n")
-if test.detect_tool('javac'):
- where_javac = test.detect('JAVAC', 'javac')
+
+ENV = test.java_ENV()
+
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
else:
- import SCons.Environment
- env = SCons.Environment.Environment()
- where_javac = env.WhereIs('javac', os.environ['PATH'])
- if not where_javac:
- where_javac = env.WhereIs('javac', '/usr/local/j2sdk1.3.1/bin')
- if not where_javac:
- print "Could not find Java, skipping test(s)."
- test.pass_test(1)
-
+ where_javac = test.where_is('javac')
+if not where_javac:
+ print "Could not find Java javac, skipping test(s)."
+ test.pass_test(1)
+
test.write("wrapper.py", """\
diff --git a/test/Java/JAVACFLAGS.py b/test/Java/JAVACFLAGS.py
index ef084cd..d0ab847 100644
--- a/test/Java/JAVACFLAGS.py
+++ b/test/Java/JAVACFLAGS.py
@@ -30,17 +30,15 @@ import TestSCons
test = TestSCons.TestSCons()
-if test.detect_tool('javac'):
- where_javac = test.detect('JAVAC', 'javac')
+ENV = test.java_ENV()
+
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
else:
- import SCons.Environment
- env = SCons.Environment.Environment()
- where_javac = env.WhereIs('javac', os.environ['PATH'])
- if not where_javac:
- where_javac = env.WhereIs('javac', '/usr/local/j2sdk1.3.1/bin')
- if not where_javac:
- print "Could not find Java javac, skipping test(s)."
- test.pass_test(1)
+ where_javac = test.where_is('javac')
+if not where_javac:
+ print "Could not find Java javac, skipping test(s)."
+ test.pass_test(1)
test.subdir('src')
diff --git a/test/SWIG/SWIG.py b/test/SWIG/SWIG.py
index af76d6c..21a6a18 100644
--- a/test/SWIG/SWIG.py
+++ b/test/SWIG/SWIG.py
@@ -121,15 +121,15 @@ if swig:
version = sys.version[:3] # see also sys.prefix documentation
# handle testing on other platforms:
+ ldmodule_prefix = '_'
+
frameworks = ''
- ldmodule_prefix = ''
platform_sys_prefix = sys.prefix
if sys.platform == 'darwin':
# OS X has a built-in Python but no static libpython
# so you should link to it using apple's 'framework' scheme.
# (see top of file for further explanation)
frameworks = '-framework Python'
- ldmodule_prefix = '_'
platform_sys_prefix = '/System/Library/Frameworks/Python.framework/Versions/%s/' % version
test.write("wrapper.py",
@@ -191,7 +191,7 @@ extern char *bar_string();
test.run(arguments = ldmodule_prefix+'foo' + _dll)
- test.fail_test(os.path.exists(test.workpath('wrapper.out')))
+ test.must_not_exist(test.workpath('wrapper.out'))
test.run(program = python, stdin = """\
import foo
@@ -204,7 +204,7 @@ This is foo.c!
test.run(arguments = ldmodule_prefix+'bar' + _dll)
- test.fail_test(test.read('wrapper.out') != "wrapper.py\n")
+ test.must_match('wrapper.out', "wrapper.py\n")
test.run(program = python, stdin = """\
import foo
diff --git a/test/TAR/TARFLAGS.py b/test/TAR/TARFLAGS.py
index 5864241..fcf7394 100644
--- a/test/TAR/TARFLAGS.py
+++ b/test/TAR/TARFLAGS.py
@@ -49,7 +49,9 @@ for opt, arg in cmd_opts:
else: opt_string = opt_string + ' ' + opt
def process(outfile, name):
if os.path.isdir(name):
- for entry in os.listdir(name):
+ entries = os.listdir(name)
+ entries.sort()
+ for entry in entries:
process(outfile, os.path.join(name, entry))
else:
outfile.write(open(name, 'rb').read())