diff options
author | Daniel Moody <dmoody256@gmail.com> | 2018-04-09 20:34:24 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2018-05-25 19:42:45 (GMT) |
commit | 35ac5267d91db9379129fc33d49d6699350347e5 (patch) | |
tree | baf612668f3e6751c2397b6d509770370a75da8c /test | |
parent | 7ad7a9bc0a802096e2a5beadcca8f6a10822ef95 (diff) | |
download | SCons-35ac5267d91db9379129fc33d49d6699350347e5.zip SCons-35ac5267d91db9379129fc33d49d6699350347e5.tar.gz SCons-35ac5267d91db9379129fc33d49d6699350347e5.tar.bz2 |
updated yacc tool to add default paths, updated to test to use the tool specifically and know when to skip on windows.
Diffstat (limited to 'test')
-rw-r--r-- | test/YACC/YACC.py | 8 | ||||
-rw-r--r-- | test/YACC/live-check-output-cleaned.py | 2 | ||||
-rw-r--r-- | test/YACC/live.py | 12 |
3 files changed, 14 insertions, 8 deletions
diff --git a/test/YACC/YACC.py b/test/YACC/YACC.py index 3fc1f7c..b27c2a7 100644 --- a/test/YACC/YACC.py +++ b/test/YACC/YACC.py @@ -53,10 +53,10 @@ env.CFile(target = 'ddd', source = 'ddd.ym') test.run(arguments = '.', stderr = None) -test.must_match('aaa.c', "aaa.y\nmyyacc.py\n") -test.must_match('bbb.c', "bbb.yacc\nmyyacc.py\n") -test.must_match('ccc.cc', "ccc.yacc\nmyyacc.py\n") -test.must_match('ddd.m', "ddd.yacc\nmyyacc.py\n") +test.must_match('aaa.c', "aaa.y" + os.linesep + "myyacc.py" + os.linesep) +test.must_match('bbb.c', "bbb.yacc" + os.linesep + "myyacc.py" + os.linesep) +test.must_match('ccc.cc', "ccc.yacc" + os.linesep + "myyacc.py" + os.linesep) +test.must_match('ddd.m', "ddd.yacc" + os.linesep + "myyacc.py" + os.linesep) diff --git a/test/YACC/live-check-output-cleaned.py b/test/YACC/live-check-output-cleaned.py index a6240c9..8329b94 100644 --- a/test/YACC/live-check-output-cleaned.py +++ b/test/YACC/live-check-output-cleaned.py @@ -40,7 +40,7 @@ if not yacc: test.skip_test('No yacc or bison found; skipping test.\n') test.write('SConstruct', """ -foo = Environment(YACCFLAGS='-v -d') +foo = Environment(YACCFLAGS='-v -d', tools = ['default', 'yacc']) foo.CFile(source = 'foo.y') """ % locals()) diff --git a/test/YACC/live.py b/test/YACC/live.py index 6dd08f7..35f6c37 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -29,6 +29,8 @@ Test YACC and YACCFLAGS with a live yacc compiler. """ import TestSCons +import sys +import os _exe = TestSCons._exe _python_ = TestSCons._python_ @@ -40,12 +42,16 @@ yacc = test.where_is('yacc') or test.where_is('bison') if not yacc: test.skip_test('No yacc or bison found; skipping test.\n') +if sys.platform == 'win32': + if not test.where_is('gcc'): + test.skip_test('No gcc found on windows; skipping test.\n') + test.file_fixture('wrapper.py') test.write('SConstruct', """ -foo = Environment(YACCFLAGS='-d') +foo = Environment(YACCFLAGS='-d', tools = ['default', 'yacc']) yacc = foo.Dictionary('YACC') -bar = Environment(YACC = r'%(_python_)s wrapper.py ' + yacc) +bar = Environment(YACC = r'%(_python_)s wrapper.py ' + yacc, tools = ['default', 'yacc']) foo.Program(target = 'foo', source = 'foo.y') bar.Program(target = 'bar', source = 'bar.y') foo.Program(target = 'hello', source = ['hello.cpp']) @@ -152,7 +158,7 @@ test.run(arguments = 'bar' + _exe) test.up_to_date(arguments = 'bar' + _exe) -test.must_match(test.workpath('wrapper.out'), "wrapper.py\n") +test.must_match(test.workpath('wrapper.out'), "wrapper.py" + os.linesep) test.run(program = test.workpath('bar'), stdin = "b\n", stdout = "bar.y\n") |