diff options
Diffstat (limited to 'test/LEX/LEXFLAGS.py')
-rw-r--r-- | test/LEX/LEXFLAGS.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/LEX/LEXFLAGS.py b/test/LEX/LEXFLAGS.py index 2cebca7..efcf9c4 100644 --- a/test/LEX/LEXFLAGS.py +++ b/test/LEX/LEXFLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,9 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import sys +import sysconfig import TestSCons @@ -59,10 +59,12 @@ sys.exit(0) """) test.write('SConstruct', """ -env = Environment(LEX = r'%(_python_)s mylex.py', - LEXFLAGS = '-x -I${TARGET.dir} -I${SOURCE.dir}', - tools=['default', 'lex']) -env.CFile(target = 'out/aaa', source = 'in/aaa.l') +env = Environment( + LEX=r'%(_python_)s mylex.py', + LEXFLAGS='-x -I${TARGET.dir} -I${SOURCE.dir}', + tools=['default', 'lex'], +) +env.CFile(target='out/aaa', source='in/aaa.l') """ % locals()) test.write(['in', 'aaa.l'], "aaa.l\nLEXFLAGS\nI_ARGS\n") @@ -70,7 +72,7 @@ test.write(['in', 'aaa.l'], "aaa.l\nLEXFLAGS\nI_ARGS\n") test.run('.', stderr = None) lexflags = ' -x -t' -if sys.platform == 'win32': +if sys.platform == 'win32' and not sysconfig.get_platform() in ("mingw",): lexflags = ' --nounistd' + lexflags # Read in with mode='r' because mylex.py implicitley wrote to stdout # with mode='w'. |