drym-org / qi

An embeddable flow-oriented language.
58 stars 12 forks source link

Explore logging as a way to get more precise compiler tests #170

Open countvajhula opened 4 months ago

countvajhula commented 4 months ago

(I thought we already had an issue for this but I don't see it.)

Currently, we have assertions in the compiler tests to check whether an expression was deforested. These assertions are based on crude string matching on the produced syntax. This means our deforestation tests aren't as tractable as we'd like. It could be better to have each optimization log when it is applied, so we can instead just verify in the tests that the log is present, and present the expected number of times, by capturing logs from an appropriate port during execution of the test.

This was suggested by @stamourv on Discourse, and is employed in Typed Racket.