Exemplo n.º 1
0
def test_async_analysis():
    cmf = CMakeFile('command-def.cmake')
    analyzer = FileAnalyzer()

    assert not analyzer.running
    f = analyzer.analyze_async(cmf)
    assert analyzer.running
    cmake_file = f.result()
    assert not analyzer.running

    assert len(cmake_file.command_definitions) == 4
    assert cmake_file.command_definitions[0].name == 'macro1'
    assert cmake_file.command_definitions[1].name == 'macro2'
    assert cmake_file.command_definitions[2].name == 'function1'
    assert cmake_file.command_definitions[3].name == 'function2'
Exemplo n.º 2
0
def test_cp1252_decoding():
    cmf = CMakeFile('CP1252Module.cmake')
    analyzer = FileAnalyzer()
    f = analyzer.analyze_async(cmf)
    cmake_file = f.result()
    assert cmake_file