From: stevenknight Date: Sun, 10 Feb 2002 12:13:14 +0000 (+0000) Subject: WIN32 portability in tests. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=03bdfa8ce461d1e445ac0913876fe0992c96e697;p=scons.git WIN32 portability in tests. git-svn-id: http://scons.tigris.org/svn/scons/trunk@252 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/etc/TestSCons.py b/etc/TestSCons.py index 14c2e0b6..64f92791 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 4b4256f8..bb2c7adf 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 b44e96a7..1a02447a 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))