From e61588a4fbb9ffb27d04b1215dc2558ee38612b9 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Sun, 10 Feb 2002 12:13:14 +0000 Subject: WIN32 portability in tests. --- etc/TestSCons.py | 2 +- src/CHANGES.txt | 2 ++ test/Scanner.py | 20 +++++++++----------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/etc/TestSCons.py b/etc/TestSCons.py index 14c2e0b..64f9279 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -97,7 +97,7 @@ class TestSCons(TestCmd.TestCmd): print "STDERR ============" print self.stderr() raise - if self.status>>8 != status: + if not self.status is None and self.status>>8 != status: print "%s returned %d" % (self.program, self.status >> 8) print "STDERR ============" print self.stderr() diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 4b4256f..bb2c7ad 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -48,6 +48,8 @@ RELEASE 0.05 - - Create all of the directories for a list of targets before trying to build any of the targets. + - WIN32 portability fixes in tests. + From Anthony Roach: - Make the scons script return an error code on failures. diff --git a/test/Scanner.py b/test/Scanner.py index b44e96a..1a02447 100644 --- a/test/Scanner.py +++ b/test/Scanner.py @@ -33,20 +33,18 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -try: - input = open(sys.argv[1], 'r') -except IndexError: - input = sys.stdin +input = open(sys.argv[1], 'rb') +output = open(sys.argv[2], 'wb') -def process(fp): - for line in fp.readlines(): +def process(infp, outfp): + for line in infp.readlines(): if line[:8] == 'include ': file = line[8:-1] - process(open(file, 'r')) + process(open(file, 'rb'), outfp) else: - sys.stdout.write(line) + outfp.write(line) -process(input) +process(input, output) sys.exit(0) """) @@ -75,10 +73,10 @@ kscan = Scanner(name = 'kfile', scanners = Environment().Dictionary('SCANNERS') env = Environment(SCANNERS = scanners + [kscan]) -env.Command('foo', 'foo.k', '%s build.py < $SOURCES > $TARGET') +env.Command('foo', 'foo.k', '%s build.py $SOURCES $TARGET') bar_in = File('bar.in') -env.Command('bar', bar_in, '%s build.py $SOURCES > $TARGET') +env.Command('bar', bar_in, '%s build.py $SOURCES $TARGET') bar_in.scanner_set(kscan) """ % (python, python)) -- cgit v0.12