当前位置: 首页>>代码示例>>Python>>正文


Python TestSCons.case_sensitive_suffixes方法代码示例

本文整理汇总了Python中TestSCons.case_sensitive_suffixes方法的典型用法代码示例。如果您正苦于以下问题:Python TestSCons.case_sensitive_suffixes方法的具体用法?Python TestSCons.case_sensitive_suffixes怎么用?Python TestSCons.case_sensitive_suffixes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestSCons的用法示例。


在下文中一共展示了TestSCons.case_sensitive_suffixes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: open

# 需要导入模块: import TestSCons [as 别名]
# 或者: from TestSCons import case_sensitive_suffixes [as 别名]
test = TestSCons.TestSCons()



test.write('myfc.py', r"""
import sys
fline = '#'+sys.argv[1]+'\n'
outfile = open(sys.argv[2], 'wb')
infile = open(sys.argv[3], 'rb')
for l in [l for l in infile.readlines() if l != fline]:
    outfile.write(l)
sys.exit(0)
""")

if not TestSCons.case_sensitive_suffixes('.f','.F'):
    f90pp = 'f90'
else:
    f90pp = 'f90pp'

test.write('SConstruct', """
env = Environment(F90COM = r'%(_python_)s myfc.py f90 $TARGET $SOURCES',
                  F90COMSTR = 'Building f90 $TARGET from $SOURCES',
                  F90PPCOM = r'%(_python_)s myfc.py f90pp $TARGET $SOURCES',
                  F90PPCOMSTR = 'Building f90pp $TARGET from $SOURCES',
                  OBJSUFFIX='.obj')
env.Object(source = 'test01.f90')
env.Object(source = 'test02.F90')
""" % locals())

test.write('test01.f90',        "A .f90 file.\n#f90\n")
开发者ID:Distrotech,项目名称:scons,代码行数:32,代码来源:F90COMSTR.py

示例2: Environment

# 需要导入模块: import TestSCons [as 别名]
# 或者: from TestSCons import case_sensitive_suffixes [as 别名]
#c++
#link
""")

test.write('test3.F', r"""test3.F
#g77
#link
""")

test.run(arguments = '.', stderr=None)

test.must_match('test1.obj', "test1.c\n#link\n")
test.must_match('test2.obj', "test2.cpp\n#link\n")
test.must_match('test3.obj', "test3.F\n#link\n")
test.must_match('foo.exe',   "test1.c\ntest2.cpp\ntest3.F\n")
if TestSCons.case_sensitive_suffixes('.F', '.f'):
    test.must_match('mygcc.out', "cc\nc++\ng77\n")
else:
    test.must_match('mygcc.out', "cc\nc++\n")   

test.write('SConstruct', """
env = Environment(CPPFLAGS = '-x',
                  SHLINK = r'%(_python_)s mylink.py',
                  SHLINKFLAGS = [],
                  CC = r'%(_python_)s mygcc.py cc',
                  CXX = r'%(_python_)s mygcc.py c++',
                  CXXFLAGS = [],
                  FORTRAN = r'%(_python_)s mygcc.py g77',
                  OBJSUFFIX = '.obj',
                  SHOBJPREFIX = '',
                  SHOBJSUFFIX = '.shobj',
开发者ID:Distrotech,项目名称:scons,代码行数:33,代码来源:CPPFLAGS.py

示例3:

# 需要导入模块: import TestSCons [as 别名]
# 或者: from TestSCons import case_sensitive_suffixes [as 别名]
#link
""")

test.write('test5.spp', r"""This is a .spp file.
#as
#link
""")

test.write('test6.SPP', r"""This is a .SPP file.
#as
#link
""")

test.run(arguments = '.', stderr = None)

if TestSCons.case_sensitive_suffixes('.s', '.S'):
    o_css = o_c
else:
    o_css = o

test.must_match('test1' + _exe, "%s\nThis is a .s file.\n" % o)
test.must_match('test2' + _exe, "%s\nThis is a .S file.\n" % o_css)
test.must_match('test3' + _exe, "%s\nThis is a .asm file.\n" % o)
test.must_match('test4' + _exe, "%s\nThis is a .ASM file.\n" % o)
test.must_match('test5' + _exe, "%s\nThis is a .spp file.\n" % o_c)
test.must_match('test6' + _exe, "%s\nThis is a .SPP file.\n" % o_c)

test.pass_test()

# Local Variables:
# tab-width:4
开发者ID:NexMirror,项目名称:SCons,代码行数:33,代码来源:ASFLAGS.py

示例4: Environment

# 需要导入模块: import TestSCons [as 别名]
# 或者: from TestSCons import case_sensitive_suffixes [as 别名]
/*link*/
""")

test.run(arguments = '.', stderr = None)

test.must_match('test1' + _exe, "This is a .cc file.\n")

test.must_match('test2' + _exe, "This is a .cpp file.\n")

test.must_match('test3' + _exe, "This is a .cxx file.\n")

test.must_match('test4' + _exe, "This is a .c++ file.\n")

test.must_match('test5' + _exe, "This is a .C++ file.\n")

if TestSCons.case_sensitive_suffixes('.c', '.C'):

    test.write('SConstruct', """
env = Environment(LINK = r'%(_python_)s mylink.py',
                  LINKFLAGS = [],
                  CXX = r'%(_python_)s myc++.py',
                  CXXFLAGS = [])
env.Program(target = 'test6', source = 'test6.C')
""" % locals())

    test.write('test6.C', r"""This is a .C file.
/*c++*/
/*link*/
""")

    test.run(arguments = '.', stderr = None)
开发者ID:azatoth,项目名称:scons,代码行数:33,代码来源:CXX.py

示例5: open

# 需要导入模块: import TestSCons [as 别名]
# 或者: from TestSCons import case_sensitive_suffixes [as 别名]

test.write(
    "myfc.py",
    r"""
import sys
fline = '#'+sys.argv[1]+'\n'
outfile = open(sys.argv[2], 'wb')
infile = open(sys.argv[3], 'rb')
for l in [l for l in infile.readlines() if l != fline]:
    outfile.write(l)
sys.exit(0)
""",
)

if not TestSCons.case_sensitive_suffixes(".f", ".F"):
    fortranpp = "fortran"
else:
    fortranpp = "fortranpp"


test.write(
    "SConstruct",
    """
env = Environment(SHFORTRANCOM = r'%(_python_)s myfc.py fortran $TARGET $SOURCES',
                  SHFORTRANCOMSTR = 'Building fortran $TARGET from $SOURCES',
                  SHFORTRANPPCOM = r'%(_python_)s myfc.py fortranpp $TARGET $SOURCES',
                  SHFORTRANPPCOMSTR = 'Building fortranpp $TARGET from $SOURCES',
                  SHOBJPREFIX='', SHOBJSUFFIX='.shobj')
env.SharedObject(source = 'test01.f')
env.SharedObject(source = 'test02.F')
开发者ID:bdbaddog,项目名称:scons-gh-migrate,代码行数:32,代码来源:SHFORTRANCOMSTR.py


注:本文中的TestSCons.case_sensitive_suffixes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。