mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #364] Adding functional tests to the cmake -DBUILD_TESTS=ON configuration in libxlsxwriter #291
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#291
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jmcnamara on GitHub (Feb 14, 2022).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/364
Originally assigned to: @jmcnamara on GitHub.
The cmake
-DBUILD_TESTS=ONconfiguration builds the libxlsxwriter unit tests but to date it hasn't built the functional tests.The libxlsxwriter functional tests use Python pytest to compile complete C programs (like this), runs them, and compare the outputs file by file and element by element with the XML in files generate by Excel. Currently there are around 800 of these tests and they ensure a high level of fidelity between the files produced by libxlsxwriter and Excel.
I have been enabling GitHub actions to improve the CI since I no longer have access to travis and I made a pass at enabling these functional tests.
They require Python and Pytest. Pytest can be installed like this:
Then you can run the entire test suite like this:
There are some caveats:
I need to add support for testing some of the compilation variants with Cmake/Ctest (they are already in the "make" tests).The check for pytest doesn't work. I've tried a lot offind_package()andfind_program()variations and I can't get it to work. Suggestions welcome here as well.@sjmulder @Alexhuszagh @remicollet @manisandro and any other packagers/porters/cmake users: could you have a look if you get a chance and let me know if you have any feedback.
@jmcnamara commented on GitHub (Feb 14, 2022):
I fixed this and tested it with a clean Ubuntu install without and with pytest.
@jmcnamara commented on GitHub (Feb 15, 2022):
I've added this now as well for most/all Libxlsxwriter Cmake configuration options:
@manisandro commented on GitHub (Feb 15, 2022):
I gave it a quick spin on Fedora and everything seemed to work fine, incl pytest detection.
@jmcnamara commented on GitHub (Feb 15, 2022):
@manisandro Thanks for testing.
Note, in case anyone hits it, there is currently an issue with building the examples and tests together. I'm working on that.Fixed it.@jmcnamara commented on GitHub (Feb 17, 2022):
I've added a Windows Cmake build to the CI. It is quite slow to build OpenSSL and the test cases (~20 mins) but it may catch some issues. There are some minors warning from MSVC that other compilers don't raise so I need to look at them too.
The Windows builds are:
I also had some issues with Ctest that I had to work around.
I'm going to close this issue now since this is the majority of the code tests that I want to put in the CI. I may add an automated code formatting check as well but that is non-critical.
@jmcnamara commented on GitHub (Feb 18, 2022):
For the package maintainers CCed on this issue.
I'm updating the libxlsxwriter installation instructions. If you have any additional package manager instructions that I could add please let me know.
@jmcnamara commented on GitHub (Feb 22, 2022):
For what it is worth I have restructured the Getting Started Guide to group more instructions in terms of OSes and to move cmake onto an even par with make in the instructions.
https://libxlsxwriter.github.io/getting_started.html