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
TR unit tests #270
TR unit tests #270
Conversation
ee74d24
to
8402dd7
Compare
0beb469
to
fa32cc3
Compare
So far the unit tests are rather simplistic and tests mainly simple filtering and display elements. Genuine testing of sortorders, currency conversions etc is far more difficult and requires html parsing :-( |
a0eaebe
to
bc30fa8
Compare
3345c7c
to
24b4bf7
Compare
Could you be a bit more expressive with the commit messages? |
24b4bf7
to
0fc37f3
Compare
Hmm I'm still trying to find the right toolchain, and I've rebase/fixup for now. Unfortunately travis-ci guile uses guile-2.0.9 whch doesn't have srfi-64 :( |
For travis to pass I may have to forego srfi-64 and write custom macros instead, which are not that difficult. |
I'm not sure what Travis's limitations have to do with cryptic commit messages, but if the purpose of the PR is to run Travis on work that isn't actually ready to merge, there are a few alternatives that might work a bit better:
|
Upgrade <br> tags to <br /> to allow well-formed XML parsing.
According to the guide, eqv? better than eq? for chars
initial attempt
Next: use SXML XPath's parser
0fc37f3
to
de0c552
Compare
Wish to canvas opinion about a hack to add srfi-64 in travis -- I've copied srfi-64 into common/test-core/ and modified commonbuild to check for srfi-64, and copy it if does not exist (ie guile-2.0.9 or earlier). This passes on travis. It'll be a shame to seek another unit-test toolchain when srfi-64 is very well designed. Will this hack be acceptable? See latest commit on https://github.com/christopherlam/gnucash/commits/TR-unittest |
Whoops. Rebasing meant the 6a173f6 commit including comment was lost. I've moved to ./borrowed in my tree. I was fighting with travis all day until this worked. SRFI-64, SXML and SXPATH is a good combination for stress testing reports. With this I can be much more productive. |
I would definitely prefer testing for SRFI-64 in the root CMakeLists.txt and only enable scheme unit testing when it's available. |
Ok - this would mean travis-arch has guile-2.2 can run the tests and travis-ubuntu with guile-2.0.9 will skip them. A local build with guile 2.0.10 onwards will run the tests successfully.
The reasoning was, given guile>=2.0.10 always has srfi-64, we'd only need to test that the Alternatively the following?
|
PS it's still preferable to disable tests for travis-ubuntu then please let me know how CMakeLists.txt should change! |
Run the test Geert proposed above and set a variable HAVE_SRFI64 based on the results. Then in the various test/CMakeLists.txt call add_scheme_test for srfi64 based tests only if HAVE_SRFI64 is true. |
Ok - the following does the trick - will enable HAVE_SRFI tests if guile >= 2.0.10 - the downside is an ugly error message during build script. Alternatively I could also add to guile22 section to quietly enable HAVE_SRFI64.
|
You can probably eat the error message with EXECUTE_PROCESS( COMMAND ${GUILE_EXECUTABLE} -c "(use-modules (srfi srfi-64))" > /dev/null 27>1 |
Or more the cmake way by adding "ERROR_QUIET" to the execute_process invocation. Optionally, it may also need "OUTPUT QUIET" if guile is not writing to stderr. And please write cmake commands in lowercase. I know most of it is upper case, but I want to fix this for 4.0. By writing lowercase now for new cmake functionality, there's less to change in the next dev cycle. |
Hmm, looks like you figured out the "ERROR_QUIET" option already in PR286. Only the lowercase request remains then. |
Work in progress. Divided renderer into multistage, will now write tests.