axellang / axel

Haskell + Lisp

Home Page:https://axellang.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verify that the golden tests are actually valid Haskell

jgrosso opened this issue · comments

Motivation

From #79:

I realized that issues have crept in because I never actually ran the Haskell golden test files through GHC. I only ever visually confirmed that the files looked like valid Haskell, which meant e.g. I couldn't easily tell when inappropriate whitespace like \t snuck in.

From #81:

For example, test/Axel/Test/Transpilation/macros/golden_ExpandIntoInterdependentMacros.axel relies on Axel.Sourcemap to have been imported, but it's not currently part of the autogenerated imports. I didn't notice this myself because the bootstrapped portion of the compiler happens to always import qualified Axel.Sourcemap as SM anyways.

Fix

To prevent this kind of issue from happening again, I need to:

  • Rewrite the golden tests to output executable Haskell (e.g. replace metavariables with actual functions).
  • Set up infrastructure to test the Haskell files, ensuring they can compile and run (and we should also test the outputs themselves). This should probably be done in a sandboxed environment to expose any implicit dependencies on the Axel source.
  • Update the README to include this step. Maybe encapsulate it inside a release.sh script or something?