Development/VBA Unit Tests

    From The Document Foundation Wiki

    There is a framework in Calc and Writer to allow testing of our VBA implementation. The concept behind these test allows to write and extend existing tests without any knowledge in C++ programming. The tests are executed during every build by loading a file into Calc or Writer and execute the macros in these files.

    Capabilities and Limitations

    The test concept only works in Linux so we can't detect Windows and macOS only bugs but these tests should ensure that our VBA implementation will no break through changes in Calc or Writer core. Since these tests start LibreOffice with the UI (in contrast to filters-test) they need much time and will therefore at some point in the future move to the subsequenttest target.

    Implementation

    The tests are located in sc/qa/unit and consist of macros_test.cxx and the test files in sc/qa/unit/data/xls. There are also the normal filters-test XLS file so be carefull to pick the right files. The registered files are loaded and then the macro in them should be executed. All macros should test itself that their execution did not fail and return "OK". If there are parts that can not be tested by the macro itself there is the possibility to test these parts with C++ code in macros_test.cxx. If you have such a problem and are not familiar with C++ please attach a note to your mail explaining what needs to be tested in c++ and why it can't be tested in VBA (it might just be a bug).

    Create new tests

    1. Create a XLS test file with a macro that tests itself
    2. Send it to the qa mailing list.

    Examples

    At the moment there is only one test file that executes anything useful. The file can be found at: