I started to test a slither SSA example with Rattle, but the created CFG is wrong.
See graph below, both edges from BB 0x5d go directly to BB 0x6d without any representation of the if/else bodies.
Any fix attempt (not in this PR) needs regression testing.
Changes
Idea is to add regression testing with the existing input examples while preserving the current state of rattle as much as possible.
The regression tests capture the SSA output from rattle's stdout and compare it with the expected outputs in .../tests/expected directory. The initial version of the expected output is rattle's current output (right or wrong).
adds new command line option to redirect stdout to a file
rattle main() is moved out of rattle-cli.py to make it importable
regression tests call rattle main() with stdout redirection and compare the output
rattle's ssa output generation is in various places sorted to make the output stable
Add regression testing
Background
I started to test a slither SSA example with Rattle, but the created CFG is wrong. See graph below, both edges from BB 0x5d go directly to BB 0x6d without any representation of the if/else bodies.
Any fix attempt (not in this PR) needs regression testing.
Changes
Idea is to add regression testing with the existing input examples while preserving the current state of rattle as much as possible.
The regression tests capture the SSA output from rattle's stdout and compare it with the expected outputs in .../tests/expected directory. The initial version of the expected output is rattle's current output (right or wrong).