lazarus-ccr/components/fpspreadsheet/unit-tests/common
2024-08-01 13:11:19 +00:00
..
celltypetests.pas
colortests.pas
colrowtests.pas
commenttests.pas
conditionalformattests.pas
copytests.pas fpspreadsheet: Add unit tests for copying cell ranges with formulas (https://forum.lazarus.freepascal.org/index.php/topic,67763.msg522550), by veb86. 2024-07-05 16:22:42 +00:00
datetests.pas
dbexporttests.pas
definednames_tests.pas fpspreadsheet: Add unit tests for defined names. 2024-08-01 13:11:19 +00:00
emptycelltests.pas
enumeratortests.pas
errortests.pas
exceltests.pas
fileformattests.pas
fonttests.pas
formattests.pas
formulatests.pas fpspreadsheet: Add unit test for formula SUMIFS 2024-07-17 14:34:51 +00:00
hyperlinktests.pas
internaltests.pas
lazarus32x32.png
manualtests.pas
mathtests.pas
movetests.pas
numberstests.pas
numformatparsertests.pas fpspreadsheet: Fix NumformatParserTests failing in Windows 64bit. 2024-07-17 15:37:45 +00:00
optiontests.pas
pagelayouttests.pas
protectiontests.pas
readme.txt
rpnformulaunit.pas
singleformulatests.pas fpspreadsheet: Add unit tests for COUNTIFS and AVERAGEIFS. 2024-07-17 15:36:49 +00:00
sortingtests.pas
spreadtestcli.lpi
spreadtestcli.lpr
spreadtestgui.lpi fpspreadsheet: Add unit tests for defined names. 2024-08-01 13:11:19 +00:00
spreadtestgui.lpr fpspreadsheet: Add unit tests for defined names. 2024-08-01 13:11:19 +00:00
spreadtestgui.res
ssttests.pas
stringtests.pas
testbiff8_1899.xls
testbiff8_1904.xls
testcases_calc3dformula.inc
testcases_calcrpnformula.inc fpspreadsheet: Refactor internal DoIF procedure for calculation of COUNTIF, SUMIF, AVERAGEIF. Prepared from COUNTIFS, SUMIFS, AVERAGEIFS, but not yet working correctly. Add unit test cases for COUNTIF and SUMIF. 2024-06-03 21:31:47 +00:00
testdbwriter_firebird.sql
testdbwriter_postgresql.sql
testdbwriter.ini
testdbwriter.pas
testdbwriter.rc
testdbwriter.res
testodf_1899.ods
testodf_1904.ods
testooxml_1899.xlsx
testooxml_1904.xlsx
testsutility.pas
testxml_1899.xml
testxml_1904.xml
virtualmodetests.pas

Tests for fpspreadsheet

spreadtestgui
=============
Lets you quickly run tests in a GUI.
If there are problems, you can open the spreadtestgui.lpr in Lazarus, compile it with debug mode, and trace through the offending test and the fpspreadsheet code it calls.
More details: FPCUnit documentation

spreadtestcli
=============
Command line version of the above, extended with database output. Useful for scripting use (use e.g. --all --format=plain.

For output to an embedded Firebird database, make sure the required dlls/packages are present and run the program, e.g:
spreadtestcli --comment="Hoped to have fixed that string issue" --revision="482"
(the revision is the SVN revision number, so you can keep track of regresssions)

More details: FPCUnit documentation and
https://bitbucket.org/reiniero/testdbwriter

The tests
=========
Basic tests read XLS files and check the retrieved values against a list. This tests whether reading dates, text etc works.

Another test is to take that list of normative values, write it to an xls file, then read back and compare with the original list. This basically tests whether write support is correct.
The files are written to the temp directory. They are deleted on succesful test completion; otherwise they are kept so you can open them up with a spreadsheet application/mso dumper tool/hex editor and check what exactly got written.

Finally, there is a manual test unit: these tests write out cells to a spreadsheet file (testmanual.xls) that the user should inspect himself. Examples are tests for colors, formatting etc.

Adding tests
============
For most tests:
- Add new cells to the A column in the relevant xls files; see comments in files.
- Add corresponding normative/expected value in the relevant test unit; increase array size
- Add your tests that read the data from xls and checks against the norm array.

Note that tests that check for known failures are quite valuable. You can indicate you expect an exception etc. 

Ideas for more tests:
- add more tests to internaltests to explicitly tests fpspreadsheet functions/procedures/properties that don't read/write to xls/xml files
- writing RPN formulas in the manualtests unit
- more xls/xml file formats tested
- more corner cases
- writing all data available to various sheets and reading it back to test whether complex sheets work
- reading faulty files to test exception handling

For more details, please see the FPCUnit documentation.