about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2014-05-05 17:00:14 +0200
committerAlex Crichton <alex@alexcrichton.com>2014-05-15 13:50:42 -0700
commit3aad0e249cebaf2123cd875b737c088ae2c48728 (patch)
tree6341f0f2c17bac7f849afe0897dd121c669d22a6 /src/rustllvm/RustWrapper.cpp
parentaaf398f26a5eabbc89f28abcb79b4778be9e74a6 (diff)
downloadrust-3aad0e249cebaf2123cd875b737c088ae2c48728.tar.gz
rust-3aad0e249cebaf2123cd875b737c088ae2c48728.zip
Unit tests for flowgraph pretty printing.
Each test works by rendering the flowgraph for the last identified
block we see in expanded pretty-printed output, and comparing it (via
`diff`) against a checked in "foo.dot-expected.dot" file.

Each test post-processes the output to remove NodeIds ` (id=NUM)` so
that the expected output is somewhat stable (or at least independent
of how we assign NodeIds) and easier for a human to interpret when
looking at the expected output file itself.

----

Test writing style notes:

I usually tried to write the tests in a way that would avoid duplicate
labels in the output rendered flow graph, when possible.

The tests that have string literals "unreachable" in the program text
are deliberately written that way to remind the reader that the
unreachable nodes in the resulting graph are not an error in the
control flow computation, but rather a natural consequence of its
construction.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions