-
Notifications
You must be signed in to change notification settings - Fork 7
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
Automated tests #5
Comments
Sounds like a fine idea! |
I find
What's your thought behind using |
The idea of <extMeta>
<test xmlns="http://www.meil.er/xml">
<command system="linux">grep 'testlyrics' "$ly"</command>
</test>
</extMeta>
|
Ah, I didn't notice My idea was to just use bash which should work on Mac, Linux and also Windows 10 (though I have no Windows 10 to test whether Lilypond and Java are already working properly). I don't think we should distinguish between Bash has the disadvantage that it might not work as flawlessly cross-platform as e.g. Python. There are some minute differences between certain commands like |
I added some test files in my pull requests, but there's no automation for testing. Could we collect some ideas how to test? Not sure whether there is an existing testing framework that fits the needs of this project. (Sorry for the lengthy issue - IMO tests will be important for sustainability.)
I think creating individual test files for individual problems is sensible. There are different kinds of tests I can think of:
testlyrics
)So, how could one organize these different kinds of checks? We could add one or multiple
<annot>
elements withtype="assert-test"
in the header of each test file. These<annot>
s should describe the tests to be performed. For case 2, it might look like this:subtype="ly-analyze"
would indicate that the script supplied as content will analyze the generated Lilypond file. If that command exits with code 0 (whichgrep
does if it findstestlyrics
), the test passes, otherwise it fails.The different
@type
s for the different kinds of tests I listed above could be:ly-success
ly-analyze
xsl-success
,xsl-fail
svg-analyze
,ps-analyze
,pdf-analyze
For
xsl-success
andxsl-fail
, only the XSL transformation would have to be performed. For all others, Lilypond would have to be run as well.A script for testing could look like this:
We'd have to write an XSLT that takes all the test MEI files and turns the
<annot>
elements into commands for testing.Should I give it a go?
The text was updated successfully, but these errors were encountered: