示例#1
0
def test_option_with_arg_valid(option):
    options = MSVCCompiler.parse_options(['/{}{}'.format(option, 'teststring')])
    assert len(options.option_names) == 1
    assert option in options.option_names
    assert len(options.option_values) == 1
    assert len(options.option_values[0]) == 1
    assert 'teststring' in options.option_values[0]
示例#2
0
def test_macro_defs(input, expected):
    options = MSVCCompiler.parse_options(input)
    assert set(options.defines()) == expected
示例#3
0
def test_input_files(input, expected):
    options = MSVCCompiler.parse_options(input)
    assert set(x[0] for x in options.source_files()) == expected
示例#4
0
def test_unrecognized_arg(option):
    options = MSVCCompiler.parse_options(['/{}{}'.format(option, 'teststring')])
    assert len(options.option_names) == 1
    # If not recognized it is considered an input file.
    assert '<input>' in options.option_names
示例#5
0
def test_standalone_option_valid(option):
    options = MSVCCompiler.parse_options(['/{}'.format(option)])
    assert len(options.option_names) == 1
    assert option in options.option_names
示例#6
0
def test_link_opts(input, expected):
    options = MSVCCompiler.parse_options(input)
    assert list(options.link_options()) == expected