mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-17 06:06:11 -06:00
97 lines
2.8 KiB
Text
97 lines
2.8 KiB
Text
/**
|
|
@page running_the_tests Running the Test Suite
|
|
|
|
@tableofcontents
|
|
|
|
This section shows how to set up and run the test suite for libxlsxwriter.
|
|
|
|
@section tests_functional Functional Tests
|
|
|
|
The functional tests compare the output from libxlsxwriter against xlsx files
|
|
created in Excel.
|
|
|
|
|
|
The functional tests use the Python module [pytest](http://pytest.org/) as a
|
|
test runner.
|
|
|
|
Install the `pytest` module using one of the following methods:
|
|
|
|
sudo apt-get install -y python-pytest
|
|
# or
|
|
sudo easy_install pytest
|
|
# or
|
|
sudo pip install pytest
|
|
|
|
The functional tests can then be run:
|
|
|
|
$ cd libxlsxwriter
|
|
|
|
$ make test_functional
|
|
|
|
=========================== test session starts ===========================
|
|
collected 14 items
|
|
|
|
test/functional/test_formatting.py:16: TestCompareXLSXFiles.test_format01 PASSED
|
|
test/functional/test_formatting.py:19: TestCompareXLSXFiles.test_format02 PASSED
|
|
test/functional/test_formatting.py:24: TestCompareXLSXFiles.test_format06 PASSED
|
|
...
|
|
test/functional/test_write_data.py:25: TestCompareXLSXFiles.test_data04 PASSED
|
|
test/functional/test_write_data.py:28: TestCompareXLSXFiles.test_data05 PASSED
|
|
test/functional/test_write_data.py:31: TestCompareXLSXFiles.test_data06 PASSED
|
|
test/functional/test_write_data.py:34: TestCompareXLSXFiles.test_data07 PASSED
|
|
=========================== 14 passed in 0.41 seconds =====================
|
|
|
|
|
|
@section tests_ Unit Tests
|
|
|
|
The unit tests test the components of the library at the level of individual
|
|
functions or compilation units.
|
|
|
|
The unit tests uses the [ctest](http://github.com/bvdberg/ctest) test
|
|
framework. This is included as a header file in the `test/unit` directory
|
|
and doesn't need to be installed.
|
|
|
|
The unit tests can then be run as follows:
|
|
|
|
$ make test_unit
|
|
Compiling unit tests ...
|
|
TEST 1/155 utility:_datetime_date_and_time [OK]
|
|
TEST 2/155 utility:_datetime_date_only [OK]
|
|
TEST 3/155 utility:_datetime_date_only_1904 [OK]
|
|
TEST 4/155 utility:_datetime_time_only [OK]
|
|
...
|
|
TEST 152/155 styles:write_xf34 [OK]
|
|
TEST 153/155 styles:write_xf35 [OK]
|
|
TEST 154/155 styles:write_xf36 [OK]
|
|
TEST 155/155 styles:xml_declaration [OK]
|
|
|
|
RESULTS: 155 tests (155 ok, 0 failed, 0 skipped) ran in 42 ms
|
|
|
|
Both functional and unit test can be run together:
|
|
|
|
$ make test
|
|
|
|
|
|
@section tests_valgrind Valgrind Tests
|
|
|
|
The functional tests and examples can be run under
|
|
[Valgrind](http://valgrind.org) to verify that there are no memory leaks.
|
|
|
|
Install `valgrind` as follows:
|
|
|
|
apt-get install -y valgrind
|
|
|
|
Then run the tests:
|
|
|
|
make test_valgrind
|
|
|
|
|
|
@section tests_travis Travis Continuous Integration
|
|
|
|
Libxlsxwriter is configured to run all tests in [Travis Continuous
|
|
Integration](https://travis-ci.org/jmcnamara/libxlsxwriter) for each commit.
|
|
|
|
|
|
Next: @ref faq
|
|
|
|
*/
|