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]
def test_macro_defs(input, expected): options = MSVCCompiler.parse_options(input) assert set(options.defines()) == expected
def test_input_files(input, expected): options = MSVCCompiler.parse_options(input) assert set(x[0] for x in options.source_files()) == expected
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
def test_standalone_option_valid(option): options = MSVCCompiler.parse_options(['/{}'.format(option)]) assert len(options.option_names) == 1 assert option in options.option_names
def test_link_opts(input, expected): options = MSVCCompiler.parse_options(input) assert list(options.link_options()) == expected