Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify that the golden tests are actually valid Haskell #80

Open
3 tasks
jgrosso opened this issue Oct 28, 2022 · 0 comments
Open
3 tasks

Verify that the golden tests are actually valid Haskell #80

jgrosso opened this issue Oct 28, 2022 · 0 comments
Assignees
Labels
improvement Adding a new feature, improving an existing feature, etc. testing Anything related to the Axel test suite.

Comments

@jgrosso
Copy link
Collaborator

jgrosso commented Oct 28, 2022

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?
@jgrosso jgrosso added improvement Adding a new feature, improving an existing feature, etc. testing Anything related to the Axel test suite. labels Oct 28, 2022
@jgrosso jgrosso self-assigned this Oct 28, 2022
@jgrosso jgrosso changed the title Verify that Verify that the Haskell golden tests are valid Haskell files Oct 28, 2022
@jgrosso jgrosso changed the title Verify that the Haskell golden tests are valid Haskell files Verify that the golden tests are actually valid Haskell Oct 28, 2022
jgrosso added a commit that referenced this issue Oct 31, 2022
jgrosso added a commit that referenced this issue Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Adding a new feature, improving an existing feature, etc. testing Anything related to the Axel test suite.
Projects
None yet
Development

No branches or pull requests

1 participant