Skip to content

Verify that the golden tests are actually valid Haskell #80

@jgrosso

Description

@jgrosso

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?

Metadata

Metadata

Assignees

Labels

improvementAdding a new feature, improving an existing feature, etc.testingAnything related to the Axel test suite.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions