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

Test suite: normalize path separators across different operating systems #1694

Open
RyanGlScott opened this issue Jul 1, 2024 · 0 comments
Labels
test-framework For issues related to Cryptol's test framework.

Comments

@RyanGlScott
Copy link
Contributor

Currently, the Cryptol test suite has many golden output files that require Windows-specific output (see T16.icry.stdout.mingw32 for one such example). The thing is, most of these Windows-specific golden files are actually checking for the same output as non-Windows operating systems, except with / path separators replaced with Windows-specific \ path separators. For example, the contents of T16.icry.stdout are exactly the same as T16.icry.stdout.mingw32, except that T16\B.cry on line 6 has been replaced with T16/B.cry (and similarly on line 9).

This is unfortunate, as it means that we have to maintain multiple golden files for various tests, and it is all too easy to forget to update the golden files for an operating system that you're not currently using. To avoid needing to do this quite so much, I propose that the Cryptol test suite normalize path separators to / in golden output. That way, the T16.icry test case above would display T16/B.cry regardless of whether Windows is used or not, which would allow us to have only a single golden file for this test case.

For inspiration, here is the code that GHC's test suite uses for normalizing path separators. This makes an effort to avoid converting things like \" (an escaped " character) to /", and it also avoids converting lambda expressions like \x -> x to /x -> x.

@RyanGlScott RyanGlScott added the test-framework For issues related to Cryptol's test framework. label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-framework For issues related to Cryptol's test framework.
Projects
None yet
Development

No branches or pull requests

1 participant