Add a "fix all tests and manuals" file #2897
Labels
kind: enhancement
Label for issues suggesting enhancements; and for pull requests implementing enhancements
topic: tests
issues or PRs related to tests
I think it would be nice to have a single script (or makefile target) which would correct all tests and manual examples when a change is made (obviously users would still have to read the diff to make sure the changes make sense!). This would be (I think) a good PR for someone to work on who is newish to GAP. I'm happy go give more advice if anyone wants to work on this.
Specifically: Have a script in (say tst) called
fixtestsandmanuals.sh
which in-place replaces the results of all tests in both the tst directory, and in the manuals through the library, with the output GAP currently produces. This is based on therewriteToFile
option ofTest
andTestDirectory
(if you haven't usedrewriteToFile
, I'd start by playing with that first).General design idea:
TestDirectory
command has arewriteToFile
option, which re-writes the output of tests. It's easy to run this over testinstall and the other test directories, but it would be nice if there was a quick one-use command to do it. Also we can't just runTestDirectory
overtst
, as we need to run each test directory in a separate GAP session.2A) If you look at how testmanuals is done in ci.sh, we use TestManualChapter, in testmanuals.g. We could pass
rewriteToFile
to rewrite the manual examples into the files. For example, here is a snippet:Note that
#LOC#
, it shows you were this test came from, so you know where to put back a 'fixed' version.2B) Once we've rewriten the manual examples, we need to get them back into the manuals. However, the manual test files have a well-formatted layout where we give the file, start-line and end-line of the extracted example, so it (should?) be easy to take the file, chop out the old test and pop in the new one. If you start this, make sure you do one file in a single pass, as remember when you add or remove lines you'll change the position of other, later lines in the same file.
The text was updated successfully, but these errors were encountered: