예제 #1
0
def test_to_dot_two_inputs(graph: pg.ProgramGraph):
    dots = list(pg.to_dot([graph, graph]))
    assert len(dots) == 2
    # NOTE graph2dot output is not stable so we can't do an equivalent check as
    # things like parameter orders can change from one run to the next.
    assert_valid_graph(dots[0])
    assert_valid_graph(dots[1])
예제 #2
0
def test_to_dot_smoke_test(llvm_program_graph: pg.ProgramGraph):
    dots = list(pg.to_dot([llvm_program_graph]))
    assert len(dots) == 1
    assert isinstance(dots[0], str)
예제 #3
0
def test_to_dot_generator_parallel_executor(graph: pg.ProgramGraph):
    with ThreadPoolExecutor() as executor:
        dots = list(
            pg.to_dot((graph for _ in range(10)), chunksize=3, executor=executor)
        )
    assert len(dots) == 10
예제 #4
0
def test_to_dot_generator(graph: pg.ProgramGraph):
    dots = list(pg.to_dot((graph for _ in range(10)), chunksize=3))
    assert len(dots) == 10
예제 #5
0
def test_to_dot_simple_graph_single_input(graph: pg.ProgramGraph):
    dot = pg.to_dot(graph)
    assert_valid_graph(dot)
예제 #6
0
def test_to_dot_simple_graph(graph: pg.ProgramGraph):
    dots = list(pg.to_dot([graph]))
    assert len(dots) == 1
    assert_valid_graph(dots[0])