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])
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)
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
def test_to_dot_generator(graph: pg.ProgramGraph): dots = list(pg.to_dot((graph for _ in range(10)), chunksize=3)) assert len(dots) == 10
def test_to_dot_simple_graph_single_input(graph: pg.ProgramGraph): dot = pg.to_dot(graph) assert_valid_graph(dot)
def test_to_dot_simple_graph(graph: pg.ProgramGraph): dots = list(pg.to_dot([graph])) assert len(dots) == 1 assert_valid_graph(dots[0])