rubyx
rubyx copied to clipboard
Dependency aware test_all
Currently the way to run all tests, ie test/test_all just runs all "test_*" files under test/
The problem with this approach comes when larger rework starts to break a lot of tests. Then one has to work in dependency order to restore the tests to green. In the current random order, one will just see noise and not know where to start. Or see errors that really are cause by other errors.
The way to do this is to run one directory at a time, and in the order that they depend on each other. A simple example, to actually generate an executable (ie run elf tests), everything else has to work. Or to run risc tests, slot_machine will have to work. To run interpreter tests risc will have to work, to run slot_machine tests, sol will have to work. For many (but not all) under slot, parfait will have to work.
So the task is to change the test_all in a way that still runs all tests, but does so in the order that respective source is is dependant on each other. Such dependency information may be obtained by reading code (especially require statements) or with tools. Either way, it is a very good way to get an idea of the codebase, and thus recommended for a newcomer.