⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 core_typecheck.py

📁 C++的一个好库。。。现在很流行
💻 PY
字号:
#!/usr/bin/python

# This tests the typechecking facilities.

import BoostBuild

t = BoostBuild.Tester(pass_toolset=0)

t.write("file.jam", """
module .typecheck 
{
    rule [path] ( x )
    {
        if ! [ MATCH "^(::)" : $(x) ] 
        {
            ECHO "Error: $(x) is not a path" ;
            return true ;
        }
    }
}

rule do ( [path] a )
{
}

do $(ARGUMENT) ;

actions dummy { } 
dummy all ;
""")

t.run_build_system("-ffile.jam -sARGUMENT=::a/b/c")
t.run_build_system("-ffile.jam -sARGUMENT=a/b/c", status=1,
                   stdout="""Error: a/b/c is not a path
file.jam:18: in module scope
*** argument error
* rule do ( [path] a )
* called with: ( a/b/c )
* true a
file.jam:16:see definition of rule 'do' being called
""")

t.cleanup()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -