office-gobmx/wizards/Module_wizards.mk
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

66 lines
1.7 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
$(eval $(call gb_Module_Module,wizards))
$(eval $(call gb_Module_add_targets,wizards,\
CustomTarget_share \
CustomTarget_wizards \
Package_access2base \
Package_depot \
Package_euro \
Package_form \
Package_gimmicks \
Package_import \
Package_share \
Package_scriptforge \
Package_sfdatabases \
Package_sfdialogs \
Package_sfdocuments \
Package_sfunittests \
Package_sfwidgets \
Package_standard \
Package_template \
Package_tools \
Package_tutorials \
Package_usr \
Package_wizards \
Package_wizards_properties \
Pyuno_fax \
Pyuno_letter \
Pyuno_agenda \
Pyuno_commonwizards \
))
$(eval $(call gb_Module_add_l10n_targets,wizards,\
AllLangMoTarget_wiz \
))
ifeq ($(ENABLE_JAVA),TRUE)
$(eval $(call gb_Module_add_targets,wizards,\
Jar_commonwizards \
Jar_form \
Jar_query \
Jar_report \
Jar_reportbuilder \
Jar_table \
))
endif
# vim: set noet sw=4 ts=4: