summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-19 18:43:24 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-19 18:43:24 (GMT)
commit5029529e1907f7340b3e9be9eee4c997ad74516c (patch)
treed332b36b059664d03c55d53e12c04a5445a032c1 /test
parenta37f0a9a2946c17f08d74cf5b4f4015903c22da0 (diff)
downloadSCons-5029529e1907f7340b3e9be9eee4c997ad74516c.zip
SCons-5029529e1907f7340b3e9be9eee4c997ad74516c.tar.gz
SCons-5029529e1907f7340b3e9be9eee4c997ad74516c.tar.bz2
Allow whitespace after include file name in regex. This resolves issue running with py3 on win32 (which was adding carriage returns. Remove replacing new line with cr/lf in test.must_match, this was an incorrect path to fix the test failing on win32 py3
Diffstat (limited to 'test')
-rw-r--r--test/Scanner/Scanner.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/Scanner/Scanner.py b/test/Scanner/Scanner.py
index bc868e0..e5516bd 100644
--- a/test/Scanner/Scanner.py
+++ b/test/Scanner/Scanner.py
@@ -63,12 +63,11 @@ SConscript('SConscript')
test.write('SConscript', """
import re
-include_re = re.compile(r'^include\s+(\S+)$', re.M)
+include_re = re.compile(r'^include\s+(\S+)\s*$', re.M)
def kfile_scan(node, env, scanpaths, arg):
contents = node.get_text_contents()
includes = include_re.findall(contents)
- print("TEXT:%%s Include:%%s"%%(contents,includes))
return includes
kscan = Scanner(name = 'kfile',
@@ -204,7 +203,7 @@ test.run(arguments = '.', stdout=expect)
test.must_match('foo', "foo.k 1 line 1\nxxx 2\nyyy 1\nfoo.k 1 line 4\n", mode='r')
test.must_match('bar', "yyy 1\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n", mode='r')
test.must_match('junk', "yyy 1\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n", mode='r')
-test.must_match('moo.third', "xxx 2\nmoo.first 1 line 2\nyyy 1\nmoo.first 1 line 4\ninclude zzz\n".replace('\n',os.linesep), mode='r')
+test.must_match('moo.third', "xxx 2\nmoo.first 1 line 2\nyyy 1\nmoo.first 1 line 4\ninclude zzz\n", mode='r')
test.write('yyy', "yyy 2\n",mode='w')
@@ -221,7 +220,7 @@ test.run(arguments = '.', stdout=expect)
test.must_match('foo', "foo.k 1 line 1\nxxx 2\nyyy 2\nfoo.k 1 line 4\n", mode='r')
test.must_match('bar', "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n", mode='r')
test.must_match('junk', "yyy 2\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n", mode='r')
-test.must_match('moo.third', "xxx 2\nmoo.first 1 line 2\nyyy 2\nmoo.first 1 line 4\ninclude zzz\n".replace('\n',os.linesep), mode='r')
+test.must_match('moo.third', "xxx 2\nmoo.first 1 line 2\nyyy 2\nmoo.first 1 line 4\ninclude zzz\n", mode='r')
test.write('zzz', "zzz 2\n")
@@ -235,7 +234,7 @@ test.run(arguments = '.', stdout=expect)
test.must_match('foo', "foo.k 1 line 1\nxxx 2\nyyy 2\nfoo.k 1 line 4\n", mode='r')
test.must_match('bar', "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 2\n", mode='r')
test.must_match('junk', "yyy 2\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 2\n", mode='r')
-test.must_match('moo.third', "xxx 2\nmoo.first 1 line 2\nyyy 2\nmoo.first 1 line 4\ninclude zzz\n".replace('\n',os.linesep), mode='r')
+test.must_match('moo.third', "xxx 2\nmoo.first 1 line 2\nyyy 2\nmoo.first 1 line 4\ninclude zzz\n", mode='r')
test.up_to_date(arguments = 'foo')