本文整理汇总了Python中mozbuild.preprocessor.Preprocessor.handleCommandLine方法的典型用法代码示例。如果您正苦于以下问题:Python Preprocessor.handleCommandLine方法的具体用法?Python Preprocessor.handleCommandLine怎么用?Python Preprocessor.handleCommandLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozbuild.preprocessor.Preprocessor
的用法示例。
在下文中一共展示了Preprocessor.handleCommandLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from mozbuild.preprocessor import Preprocessor [as 别名]
# 或者: from mozbuild.preprocessor.Preprocessor import handleCommandLine [as 别名]
def main(args):
pp = Preprocessor()
pp.handleCommandLine(args, True)
示例2: TestPreprocessor
# 需要导入模块: from mozbuild.preprocessor import Preprocessor [as 别名]
# 或者: from mozbuild.preprocessor.Preprocessor import handleCommandLine [as 别名]
#.........这里部分代码省略.........
'#else',
'FAIL',
'#endif',
])
def test_var_line(self):
self.do_include_pass([
'#ifdef LINE',
'PASS',
'#else',
'FAIL',
'#endif',
])
def test_filterDefine(self):
self.do_include_pass([
'#filter substitution',
'#define VAR AS',
'#define VAR2 [email protected]@',
'@[email protected]',
])
def test_number_value_equals(self):
self.do_include_pass([
'#define FOO 1000',
'#if FOO == 1000',
'PASS',
'#else',
'FAIL',
'#endif',
])
def test_default_defines(self):
self.pp.handleCommandLine(["-DFOO"])
self.do_include_pass([
'#if FOO == 1',
'PASS',
'#else',
'FAIL',
])
def test_number_value_equals_defines(self):
self.pp.handleCommandLine(["-DFOO=1000"])
self.do_include_pass([
'#if FOO == 1000',
'PASS',
'#else',
'FAIL',
])
def test_octal_value_equals(self):
self.do_include_pass([
'#define FOO 0100',
'#if FOO == 0100',
'PASS',
'#else',
'FAIL',
'#endif',
])
def test_octal_value_equals_defines(self):
self.pp.handleCommandLine(["-DFOO=0100"])
self.do_include_pass([
'#if FOO == 0100',
'PASS',
'#else',
示例3: generate
# 需要导入模块: from mozbuild.preprocessor import Preprocessor [as 别名]
# 或者: from mozbuild.preprocessor.Preprocessor import handleCommandLine [as 别名]
def generate(output, *args):
pp = Preprocessor()
pp.out = output
pp.handleCommandLine(list(args), True)
return set(pp.includes)