diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-02-06 02:52:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 02:52:07 (GMT) |
commit | 6666adc9457f109ec25c9cd687f9eb0384392c73 (patch) | |
tree | 1c9244b2d34535adb5740ce331aaf58fb24d5b28 /test/M4/M4.py | |
parent | 2179db55c83c66d560ab3c19a7c73964d98f4e32 (diff) | |
parent | dc4b8ba81d9077c86aea6fce4cd0814111339037 (diff) | |
download | SCons-6666adc9457f109ec25c9cd687f9eb0384392c73.zip SCons-6666adc9457f109ec25c9cd687f9eb0384392c73.tar.gz SCons-6666adc9457f109ec25c9cd687f9eb0384392c73.tar.bz2 |
Merge pull request #3286 from dmoody256/make_m4_test_crossplatform
make M4 test cross platform
Diffstat (limited to 'test/M4/M4.py')
-rw-r--r-- | test/M4/M4.py | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/test/M4/M4.py b/test/M4/M4.py index 82c084c..1f5c679 100644 --- a/test/M4/M4.py +++ b/test/M4/M4.py @@ -36,8 +36,6 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() - - test.write('mym4.py', """ import sys contents = sys.stdin.read() @@ -60,23 +58,16 @@ line 3 test.run() -import sys - -if sys.platform == 'win32': - # Handle carriage returns. - test.must_match(test.workpath('aaa.x'), "line 1\r\nmym4.py\r\nline 3\r\n") -else: - test.must_match(test.workpath('aaa.x'), "line 1\nmym4.py\nline 3\n") - - +test.must_match(test.workpath('aaa.x'), os.linesep.join(["line 1", "mym4.py", "line 3", ""])) m4 = test.where_is('m4') -if m4: +if not m4: + test.skip_test('M4 not found found; skipping test.\n') - test.file_fixture('wrapper.py') +test.file_fixture('wrapper.py') - test.write('SConstruct', """ +test.write('SConstruct', """ DefaultEnvironment(tools=[]) foo = Environment(tools=['m4'], M4=r'%(m4)s', M4FLAGS='-DFFF=fff') @@ -87,23 +78,18 @@ foo.M4(target = 'foo.x', source = 'foo.x.m4') bar.M4(target = 'bar', source = 'bar.m4') """ % locals()) - test.write('foo.x.m4', "line 1\n" - "FFF\n" - "line 3\n") - - test.write('bar.m4', "line 1\n" - "BBB\n" - "line 3\n") +test.write('foo.x.m4', os.linesep.join(["line 1", "FFF", "line 3"])) - test.run(arguments = '.') +test.write('bar.m4', os.linesep.join(["line 1", "BBB", "line 3"])) - test.up_to_date(arguments = '.') +test.run(arguments = '.') +test.up_to_date(arguments = '.') - test.must_match('wrapper.out', "wrapper.py\n") +test.must_match('wrapper.out', "wrapper.py\n") - test.must_match('foo.x', "line 1\nfff\nline 3\n") +test.must_match('foo.x', os.linesep.join(["line 1", "fff", "line 3"])) - test.must_match('bar', "line 1\nbbb\nline 3\n") +test.must_match('bar', os.linesep.join(["line 1", "bbb", "line 3"])) test.pass_test() |