office-gobmx/scp2
Jean-Pierre Ledure 14c7bc1c90 ScriptForge - New 'UnitTest' service for Basic
The "UnitTest" service is implemented as a new
Basic library called 'SFUnitTests'.

ScriptForge unit tests (SF_UnitTest class module)
======================
Class providing a framework to execute and check sets of unit tests.

The UnitTest unit testing framework was originally
inspired by unittest.py in Python
and has a similar flavor as major unit testing
frameworks in other languages.

It supports
- test automation
- sharing of setupand shutdown code
- aggregation of tests into collections.

Both the
- code describing the unit tests
- code to be tested
must be written exclusively in Basic
(the code might call functions written in other languages).
The code to be tested may be released as an extension.
It does not need to make use of ScriptForge services.

The test reporting device is the Console.

Definitions:
- Test Case: each test case is a Basic Sub.
- Test Suite: a collection of test cases stored in 1 Basic module.
- Unit test: a set of test suites stored in 1 library.

Two modes:
- the normal mode ("full mode"), using test suites and test cases
  The UnitTest service is passed as argument to each test case.
- the "simple mode" limited to the use of the Assert...() methods.

Service invocation examples:
- In full mode, the service creation is external to test cases
        Dim myUnitTest As Variant
        myUnitTest = CreateScriptService("UnitTest", ThisComponent, "Tests")
            '    Test code is in the library "Tests"
            '    located in the current document
- In simple mode, the service creation is internal to every test case
        Dim myUnitTest As Variant
        myUnitTest = CreateScriptService("UnitTest")
        With myUnitTest
            If Not .AssertTrue(...) Then ...
            '    ...
            .Dispose()
        End With

Error handling
To support the debugging of the tested code, the UnitTest service, in cases of
- assertion failure
- Basic run-time error in the tested code
- Basic run-time error in the testing code (the unit tests)
will comment the error location and description in a message box and in the console log,
providing every test case (in either mode) implements an error handler
containing at least a call to the ReportError() method.

Change-Id: I9d9b889b148f172cd868af455493c8c696d1e953
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135365
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-06-04 12:08:36 +02:00
..
inc
macros
source ScriptForge - New 'UnitTest' service for Basic 2022-06-04 12:08:36 +02:00
AutoInstall.mk Drop unused CT2N extension 2022-04-26 10:08:30 +02:00
CustomTarget_langmacros.mk
InstallModule_activex.mk
InstallModule_base.mk
InstallModule_calc.mk
InstallModule_draw.mk
InstallModule_extensions.mk Drop unused CT2N extension 2022-04-26 10:08:30 +02:00
InstallModule_gnome.mk
InstallModule_graphicfilter.mk
InstallModule_impress.mk
InstallModule_kde.mk
InstallModule_math.mk
InstallModule_onlineupdate.mk
InstallModule_ooo.mk
InstallModule_python.mk
InstallModule_quickstart.mk
InstallModule_sdkoo.mk
InstallModule_spsupp.mk
InstallModule_ure.mk
InstallModule_windows.mk
InstallModule_winexplorerext.mk
InstallModule_writer.mk
InstallModule_xsltfilter.mk
InstallScript_sdkoo.mk
InstallScript_setup_osl.mk
Makefile
Module_scp2.mk
README.md

SCript Particle Installer

This contains code that describes which pieces of the project should be packaged and installed - it is used to build among other things a setup_osl.inf or .ins file - that is used by solenv/bin/make_installer.pl to build the installation.