sc/CppunitTest_sc_addin_functions_test.mk        |  110 -----------------------
 sc/CppunitTest_sc_array_functions_test.mk        |  110 -----------------------
 sc/CppunitTest_sc_database_functions_test.mk     |  110 -----------------------
 sc/CppunitTest_sc_datetime_functions_test.mk     |  110 -----------------------
 sc/CppunitTest_sc_financial_functions_test.mk    |  110 -----------------------
 sc/CppunitTest_sc_functions_test_old.mk          |  110 -----------------------
 sc/CppunitTest_sc_information_functions_test.mk  |  110 -----------------------
 sc/CppunitTest_sc_logical_functions_test.mk      |  110 -----------------------
 sc/CppunitTest_sc_mathematical_functions_test.mk |  110 -----------------------
 sc/CppunitTest_sc_spreadsheet_functions_test.mk  |  110 -----------------------
 sc/CppunitTest_sc_statistical_functions_test.mk  |  110 -----------------------
 sc/CppunitTest_sc_text_functions_test.mk         |  110 -----------------------
 sc/Module_sc.mk                                  |    1 
 sc/functions_setup.mk                            |   83 +++++++++++++++++
 solenv/clang-format/excludelist                  |    2 
 15 files changed, 97 insertions(+), 1309 deletions(-)

New commits:
commit c3ca46945aa498907a938e33b2df7937f45199db
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Nov 14 14:02:21 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Nov 14 16:21:27 2022 +0100

    sc: factor out common code in makefiles
    
    Change-Id: I46cce6cb332fb060a9e8f691d8f70808398b85ed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142707
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/CppunitTest_sc_addin_functions_test.mk 
b/sc/CppunitTest_sc_addin_functions_test.mk
index 7db9e8e149ac..d61e693acf85 100644
--- a/sc/CppunitTest_sc_addin_functions_test.mk
+++ b/sc/CppunitTest_sc_addin_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_addin_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_addin_functions_test))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_addin_functions_test, \
-    sc/qa/unit/functions_addin \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_addin_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_addin_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_addin_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_addin_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_addin_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_addin_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_addin_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_addin_functions_test))
+$(eval $(call sc_functions_test,addin))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_array_functions_test.mk 
b/sc/CppunitTest_sc_array_functions_test.mk
index 54616f4239c5..b6261a5a6e0c 100644
--- a/sc/CppunitTest_sc_array_functions_test.mk
+++ b/sc/CppunitTest_sc_array_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_array_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_array_functions_test))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_array_functions_test, \
-    sc/qa/unit/functions_array \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_array_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_array_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_array_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_array_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_array_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_array_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_array_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_array_functions_test))
+$(eval $(call sc_functions_test,array))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_database_functions_test.mk 
b/sc/CppunitTest_sc_database_functions_test.mk
index 1b4c8265f66f..600e0a064445 100644
--- a/sc/CppunitTest_sc_database_functions_test.mk
+++ b/sc/CppunitTest_sc_database_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_database_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_database_functions_test))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_database_functions_test, 
\
-    sc/qa/unit/functions_database \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_database_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_database_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_database_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_database_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_database_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_database_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_database_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_database_functions_test))
+$(eval $(call sc_functions_test,database))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_datetime_functions_test.mk 
b/sc/CppunitTest_sc_datetime_functions_test.mk
index 53910ec5d00c..309dad7cf21d 100644
--- a/sc/CppunitTest_sc_datetime_functions_test.mk
+++ b/sc/CppunitTest_sc_datetime_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_datetime_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_datetime_functions_test))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_datetime_functions_test, 
\
-    sc/qa/unit/functions_datetime \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_datetime_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_datetime_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_datetime_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_datetime_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_datetime_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_datetime_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_datetime_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_datetime_functions_test))
+$(eval $(call sc_functions_test,datetime))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_financial_functions_test.mk 
b/sc/CppunitTest_sc_financial_functions_test.mk
index 1bc723b4bad6..5a3f1c94e967 100644
--- a/sc/CppunitTest_sc_financial_functions_test.mk
+++ b/sc/CppunitTest_sc_financial_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_financial_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_financial_functions_test))
-
-$(eval $(call 
gb_CppunitTest_add_exception_objects,sc_financial_functions_test, \
-    sc/qa/unit/functions_financial \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_financial_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_financial_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_financial_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_financial_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_financial_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_financial_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_financial_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_financial_functions_test))
+$(eval $(call sc_functions_test,financial))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_functions_test_old.mk 
b/sc/CppunitTest_sc_functions_test_old.mk
index 1fb06afee68d..0d8ec44174f6 100644
--- a/sc/CppunitTest_sc_functions_test_old.mk
+++ b/sc/CppunitTest_sc_functions_test_old.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_functions_test_old))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_functions_test_old))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_functions_test_old, \
-    sc/qa/unit/functions_test_old \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_functions_test_old, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_functions_test_old, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_functions_test_old,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_functions_test_old,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_functions_test_old))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_functions_test_old))
-
-$(eval $(call gb_CppunitTest_use_components,sc_functions_test_old,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_functions_test_old))
+$(eval $(call sc_functions_test,old))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_information_functions_test.mk 
b/sc/CppunitTest_sc_information_functions_test.mk
index a32d06ffc56c..986a1a6f268e 100644
--- a/sc/CppunitTest_sc_information_functions_test.mk
+++ b/sc/CppunitTest_sc_information_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_information_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_information_functions_test))
-
-$(eval $(call 
gb_CppunitTest_add_exception_objects,sc_information_functions_test, \
-    sc/qa/unit/functions_information \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_information_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_information_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_information_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_information_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_information_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_information_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_information_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_information_functions_test))
+$(eval $(call sc_functions_test,information))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_logical_functions_test.mk 
b/sc/CppunitTest_sc_logical_functions_test.mk
index 9e11fcda9399..7eeee5b2dc35 100644
--- a/sc/CppunitTest_sc_logical_functions_test.mk
+++ b/sc/CppunitTest_sc_logical_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_logical_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_logical_functions_test))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_logical_functions_test, \
-    sc/qa/unit/functions_logical \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_logical_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_logical_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_logical_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_logical_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_logical_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_logical_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_logical_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_logical_functions_test))
+$(eval $(call sc_functions_test,logical))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_mathematical_functions_test.mk 
b/sc/CppunitTest_sc_mathematical_functions_test.mk
index e159dece6fea..17db46c7302c 100644
--- a/sc/CppunitTest_sc_mathematical_functions_test.mk
+++ b/sc/CppunitTest_sc_mathematical_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_mathematical_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_mathematical_functions_test))
-
-$(eval $(call 
gb_CppunitTest_add_exception_objects,sc_mathematical_functions_test, \
-    sc/qa/unit/functions_mathematical \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_mathematical_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_mathematical_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_mathematical_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_mathematical_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_mathematical_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_mathematical_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_mathematical_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_mathematical_functions_test))
+$(eval $(call sc_functions_test,mathematical))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_spreadsheet_functions_test.mk 
b/sc/CppunitTest_sc_spreadsheet_functions_test.mk
index 36a38a194909..d081f1726d94 100644
--- a/sc/CppunitTest_sc_spreadsheet_functions_test.mk
+++ b/sc/CppunitTest_sc_spreadsheet_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_spreadsheet_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_spreadsheet_functions_test))
-
-$(eval $(call 
gb_CppunitTest_add_exception_objects,sc_spreadsheet_functions_test, \
-    sc/qa/unit/functions_spreadsheet \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_spreadsheet_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_spreadsheet_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_spreadsheet_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_spreadsheet_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_spreadsheet_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_spreadsheet_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_spreadsheet_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_spreadsheet_functions_test))
+$(eval $(call sc_functions_test,spreadsheet))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_statistical_functions_test.mk 
b/sc/CppunitTest_sc_statistical_functions_test.mk
index 06e6ba50a9e0..0be9c7b6a138 100644
--- a/sc/CppunitTest_sc_statistical_functions_test.mk
+++ b/sc/CppunitTest_sc_statistical_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_statistical_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_statistical_functions_test))
-
-$(eval $(call 
gb_CppunitTest_add_exception_objects,sc_statistical_functions_test, \
-    sc/qa/unit/functions_statistical \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_statistical_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_statistical_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_statistical_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_statistical_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_statistical_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_statistical_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_statistical_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_statistical_functions_test))
+$(eval $(call sc_functions_test,statistical))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_text_functions_test.mk 
b/sc/CppunitTest_sc_text_functions_test.mk
index ed8c12befbe7..a042fa3fbb14 100644
--- a/sc/CppunitTest_sc_text_functions_test.mk
+++ b/sc/CppunitTest_sc_text_functions_test.mk
@@ -7,114 +7,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CppunitTest_CppunitTest,sc_text_functions_test))
-
-$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_text_functions_test))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_text_functions_test, \
-    sc/qa/unit/functions_text \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,sc_text_functions_test, \
-       boost_headers \
-       mdds_headers \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,sc_text_functions_test, \
-    basegfx \
-    comphelper \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    drawinglayercore \
-    editeng \
-    for \
-    forui \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sc \
-    scqahelper \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svx \
-    svxcore \
-       test \
-    tk \
-    tl \
-    ucbhelper \
-       unotest \
-    utl \
-    vcl \
-    xo \
-))
-
-$(eval $(call gb_CppunitTest_set_include,sc_text_functions_test,\
-    -I$(SRCDIR)/sc/source/ui/inc \
-    -I$(SRCDIR)/sc/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_CppunitTest_use_api,sc_text_functions_test,\
-    offapi \
-    udkapi \
-    oovbaapi \
-))
-
-$(eval $(call gb_CppunitTest_use_ure,sc_text_functions_test))
-
-$(eval $(call gb_CppunitTest_use_vcl,sc_text_functions_test))
-
-$(eval $(call gb_CppunitTest_use_components,sc_text_functions_test,\
-    basic/util/sb \
-    chart2/source/chartcore \
-    chart2/source/controller/chartcontroller \
-    comphelper/util/comphelp \
-    configmgr/source/configmgr \
-    connectivity/source/manager/sdbc2 \
-    dbaccess/util/dba \
-    embeddedobj/util/embobj \
-    eventattacher/source/evtatt \
-    filter/source/config/cache/filterconfig1 \
-       filter/source/odfflatxml/odfflatxml \
-       filter/source/xmlfilteradaptor/xmlfa \
-    forms/util/frm \
-    framework/util/fwk \
-    i18npool/util/i18npool \
-       i18npool/source/search/i18nsearch \
-    linguistic/source/lng \
-    oox/util/oox \
-    package/source/xstor/xstor \
-    package/util/package2 \
-    sax/source/expatwrap/expwrap \
-    scaddins/source/analysis/analysis \
-    scaddins/source/datefunc/date \
-    sc/util/sc \
-    sc/util/scfilt \
-    sfx2/util/sfx \
-    sot/util/sot \
-    svl/util/svl \
-    svtools/util/svt \
-    svx/util/svx \
-    svx/util/svxcore \
-    toolkit/util/tk \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    ucb/source/ucp/tdoc/ucptdoc1 \
-    unotools/util/utl \
-    unoxml/source/rdf/unordf \
-    unoxml/source/service/unoxml \
-    uui/util/uui \
-    vcl/vcl.common \
-    xmloff/util/xo \
-       xmlscript/util/xmlscript \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,sc_text_functions_test))
+$(eval $(call sc_functions_test,text))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index e03ac7aab1c6..0b8cb0f49d10 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -9,6 +9,7 @@
 #
 
 include $(SRCDIR)/sc/common_unoapi_tests.mk
+include $(SRCDIR)/sc/functions_setup.mk
 include $(SRCDIR)/sc/ucalc_setup.mk
 include $(SRCDIR)/sc/subsequent_setup.mk
 
diff --git a/sc/functions_setup.mk b/sc/functions_setup.mk
new file mode 100644
index 000000000000..0acff70355f7
--- /dev/null
+++ b/sc/functions_setup.mk
@@ -0,0 +1,83 @@
+# -*- 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/.
+#
+
+# template for functions tests
+define sc_functions_test
+
+$(eval $(call gb_CppunitTest_CppunitTest,sc_$(1)_functions_test))
+
+$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_$(1)_functions_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_$(1)_functions_test, \
+    sc/qa/unit/functions_$(1) \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_$(1)_functions_test, \
+       boost_headers \
+       mdds_headers \
+       libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_$(1)_functions_test, \
+    basegfx \
+    comphelper \
+    cppu \
+    cppuhelper \
+    drawinglayer \
+    drawinglayercore \
+    editeng \
+    for \
+    forui \
+    i18nlangtag \
+    msfilter \
+    oox \
+    sal \
+    salhelper \
+    sax \
+    sc \
+    scqahelper \
+    sfx \
+    sot \
+    svl \
+    svt \
+    svx \
+    svxcore \
+       test \
+    tk \
+    tl \
+    ucbhelper \
+       unotest \
+    utl \
+    vcl \
+    xo \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_$(1)_functions_test,\
+    -I$(SRCDIR)/sc/source/ui/inc \
+    -I$(SRCDIR)/sc/inc \
+    $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_$(1)_functions_test,\
+    offapi \
+    udkapi \
+    oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sc_$(1)_functions_test))
+
+$(eval $(call gb_CppunitTest_use_vcl,sc_$(1)_functions_test))
+
+$(eval $(call gb_CppunitTest_use_rdb,sc_$(1)_functions_test,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,sc_$(1)_functions_test))
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/qa/unit/functions_test_old.cxx b/sc/qa/unit/functions_old.cxx
similarity index 100%
rename from sc/qa/unit/functions_test_old.cxx
rename to sc/qa/unit/functions_old.cxx
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 9e953641ec27..aaa00004f80b 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -8025,7 +8025,7 @@ sc/qa/unit/functions_spreadsheet.cxx
 sc/qa/unit/functions_statistical.cxx
 sc/qa/unit/functions_test.cxx
 sc/qa/unit/functions_test.hxx
-sc/qa/unit/functions_test_old.cxx
+sc/qa/unit/functions_old.cxx
 sc/qa/unit/functions_text.cxx
 sc/qa/unit/helper/csv_handler.hxx
 sc/qa/unit/helper/qahelper.cxx

Reply via email to