summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-04-18 14:03:36 (GMT)
committerSteven Knight <knight@baldmt.com>2010-04-18 14:03:36 (GMT)
commitae1e7c742dcd1ed0b521640455794172fe275c65 (patch)
tree15f668e70035c926caa062d91f2fd806b7b65528 /test
parente254cdf344ed0a466661b319dc019f2400ad12f3 (diff)
downloadSCons-ae1e7c742dcd1ed0b521640455794172fe275c65.zip
SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.tar.gz
SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.tar.bz2
Replace remaining os.path.walk() calls with os.walk().
Diffstat (limited to 'test')
-rw-r--r--test/Java/Java-1.4.py12
-rw-r--r--test/Java/Java-1.5.py12
-rw-r--r--test/Java/Java-1.6.py12
-rw-r--r--test/Parallel/duplicate-target.py20
4 files changed, 15 insertions, 41 deletions
diff --git a/test/Java/Java-1.4.py b/test/Java/Java-1.4.py
index 9cc1d96..c84a2f0 100644
--- a/test/Java/Java-1.4.py
+++ b/test/Java/Java-1.4.py
@@ -334,19 +334,9 @@ expect_6 = [
failed = None
-def get_class_files(dir):
- def find_class_files(arg, dirname, fnames):
- for fname in fnames:
- if fname[-6:] == '.class':
- arg.append(os.path.join(dirname, fname))
- result = []
- os.path.walk(dir, find_class_files, result)
- result.sort()
- return result
-
def classes_must_match(dir, expect):
global failed
- got = get_class_files(test.workpath(dir))
+ got = test.java_get_class_files(test.workpath(dir))
if expect != got:
missing = set(expect) - set(got)
if missing:
diff --git a/test/Java/Java-1.5.py b/test/Java/Java-1.5.py
index ca9cbce..6c4ea46 100644
--- a/test/Java/Java-1.5.py
+++ b/test/Java/Java-1.5.py
@@ -334,19 +334,9 @@ expect_6 = [
failed = None
-def get_class_files(dir):
- def find_class_files(arg, dirname, fnames):
- for fname in fnames:
- if fname[-6:] == '.class':
- arg.append(os.path.join(dirname, fname))
- result = []
- os.path.walk(dir, find_class_files, result)
- result.sort()
- return result
-
def classes_must_match(dir, expect):
global failed
- got = get_class_files(test.workpath(dir))
+ got = test.java_get_class_files(test.workpath(dir))
if expect != got:
sys.stderr.write("Expected the following class files in '%s':\n" % dir)
for c in expect:
diff --git a/test/Java/Java-1.6.py b/test/Java/Java-1.6.py
index ec6df54..d34fcca 100644
--- a/test/Java/Java-1.6.py
+++ b/test/Java/Java-1.6.py
@@ -334,19 +334,9 @@ expect_6 = [
failed = None
-def get_class_files(dir):
- def find_class_files(arg, dirname, fnames):
- for fname in fnames:
- if fname[-6:] == '.class':
- arg.append(os.path.join(dirname, fname))
- result = []
- os.path.walk(dir, find_class_files, result)
- result.sort()
- return result
-
def classes_must_match(dir, expect):
global failed
- got = get_class_files(test.workpath(dir))
+ got = test.java_get_class_files(test.workpath(dir))
if expect != got:
sys.stderr.write("Expected the following class files in '%s':\n" % dir)
for c in expect:
diff --git a/test/Parallel/duplicate-target.py b/test/Parallel/duplicate-target.py
index a9d511e..efe20d9 100644
--- a/test/Parallel/duplicate-target.py
+++ b/test/Parallel/duplicate-target.py
@@ -56,16 +56,20 @@ test.write(['work', 'mytar.py'], """\
import sys
import os.path
-def visit(arg, dirname, fnames):
- fnames.sort()
- for fn in fnames:
- p = os.path.join(dirname, fn)
- if os.path.isfile(p):
- arg.write(open(p, 'rb').read())
-
fp = open(sys.argv[1], 'wb')
+
+def visit(dirname):
+ names = os.listdir(dirname)
+ names.sort()
+ for n in names:
+ p = os.path.join(dirname, n)
+ if os.path.isdir(p):
+ visit(p)
+ elif os.path.isfile(p):
+ fp.write(open(p, 'rb').read())
+
for s in sys.argv[2:]:
- os.path.walk(s, visit, fp)
+ visit(s)
""")
test.write(['work', 'SConstruct'], """\