Currently, LibreOffice ships with various built-in Basic Libraries, such as Gimmicks, Tools, ScriptForge etc. However, we are unable to provide unit tests for these libraries and avoid unexpected breakages (see f.i. bug 162962). In the case of ScriptForge, we would like to integrate unit tests into LibreOffice's CI, however we have not been able to do so, because the current Basic unit tests are unable to access the built-in Basic libraries. Ideally, it should be possible to create Basic tests in basic/qa/basic_coverage/ as we currently do to test the language itself. See for instance of a prototype of what I think should be possible in: https://gerrit.libreoffice.org/c/core/+/173485 The test above fails because it is unable to access GlobalScope.BasicLibraries. Alternatively, I have already tried writing Cpp tests as the ones in: /core/sc/qa/extras/macros-test.cxx However, only the document's Standard library is loaded at runtime, so testing ScriptForge with Cpp tests is currently not viable. In summary, we need a testing environment where built-in Basic libraries are accessible by Basic and/or Cpp unit tests.
@Xisco, @Mike any idea what to do about this? Also, who else can help us with this?
would it work to do something like we do for autocorrect dictionaries ? See extras/Package_autocorr.mk and sw/CppunitTest_sw_uiwriter6.mk?
(In reply to Xisco Faulí from comment #2) > would it work to do something like we do for autocorrect dictionaries ? > See extras/Package_autocorr.mk and sw/CppunitTest_sw_uiwriter6.mk? I read the tests in the file /core/sw/qa/extras/uiwriter/uiwriter6.cxx I could not find anything there that calls Basic scripts. Am I looking at the correct file?
(In reply to Rafael Lima from comment #3) > (In reply to Xisco Faulí from comment #2) > > would it work to do something like we do for autocorrect dictionaries ? > > See extras/Package_autocorr.mk and sw/CppunitTest_sw_uiwriter6.mk? > > I read the tests in the file > > /core/sw/qa/extras/uiwriter/uiwriter6.cxx > > I could not find anything there that calls Basic scripts. Am I looking at > the correct file? Hi Rafael, No there is nothing related to Basic script in those tests. What I meant is, adding $(call gb_CppunitTest_get_target,sw_uiwriter6): $(call gb_Package_get_target,extras_autocorr) to CppunitTest_sw_uiwriter6 the autocorrect dictionaries are added to be used by those tests. Maybe the same can be done for scriptforge ?