Graphviz:test suite - chunhualiao/public-docs GitHub Wiki

graphviz

If you are only modifying the dot layout algorithm (i.e., the code in lib/dotgen/ and related to the dot program), you should focus your testing on the following parts of the GraphViz test suite:


1. Dot-Specific Tests

  • All tests that exercise the dot layout engine.
  • These are typically found in:
    • tests/dot/
    • tests/graphs/directed/
    • tests/graphs/cluster/
    • Any test scripts or reference outputs that invoke dot (e.g., dot -Tsvg, dot -Tpng).

2. Image-Diff and Output Consistency Tests

  • Any test that compares the output of dot to a reference image or dot file.
  • These are critical for catching layout regressions, visual artifacts, or crashes.

3. Integration Tests Involving Dot

  • Any integration or pipeline test that uses dot as part of a larger workflow (e.g., dot + gvpr, dot + gvpack).
  • Focus on those where the layout is the primary concern.

4. Exclude Tests for Other Layout Engines

  • You do NOT need to run tests for unrelated layout engines (e.g., neato, fdp, sfdp, twopi, circo, osage) unless your changes affect shared code.
  • You can skip tests in tests/graphs/undirected/ and those that only use other engines.

5. Exclude Language Bindings and Plugin Tests

  • You do NOT need to run tests for language bindings (Python, Perl, Ruby, etc.) or unrelated plugins unless you change their code.

How to Run Only Dot-Related Tests:

  • If using make check, you can run only the relevant test targets (e.g., make check-dot if available).
  • If using ctest, filter with ctest -R dot or similar.
  • Or, manually run the test scripts in tests/dot/ and tests/graphs/directed/.

Summary:
Focus on all tests and image-diffs that use the dot engine and its output. This will efficiently validate correctness and catch regressions in the layout algorithm without running unrelated parts of the suite.