sc/common_unoapi_tests.mk    |    4 ++++
 sc/qa/extras/scsolverobj.cxx |    2 ++
 2 files changed, 6 insertions(+)

New commits:
commit e6e1e064e2220987359d1ddd063a603288701c9a
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Dec 12 15:12:35 2025 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Dec 15 14:16:21 2025 +0100

    this test needs lpsolve
    
    Change-Id: Ic2abc9dc6724d05b41428091c52027ca66c4e843
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195569
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/sc/common_unoapi_tests.mk b/sc/common_unoapi_tests.mk
index 025639a4de20..7a8fc75a1673 100644
--- a/sc/common_unoapi_tests.mk
+++ b/sc/common_unoapi_tests.mk
@@ -18,6 +18,10 @@ $(eval $(call 
gb_CppunitTest_use_external,sc_$(1),boost_headers))
 
 $(eval $(call gb_Library_use_common_precompiled_header,sc_$(1)))
 
+$(eval $(call gb_CppunitTest_add_defs,sc_$(1),\
+       $(if $(ENABLE_LPSOLVE), -DENABLE_LPSOLVE) \
+))
+
 $(eval $(call gb_CppunitTest_add_exception_objects,sc_$(1), \
     sc/qa/extras/sc$(1) \
 ))
diff --git a/sc/qa/extras/scsolverobj.cxx b/sc/qa/extras/scsolverobj.cxx
index 0537b6e4f4ff..845946676d73 100644
--- a/sc/qa/extras/scsolverobj.cxx
+++ b/sc/qa/extras/scsolverobj.cxx
@@ -74,6 +74,7 @@ void ScSolverSettingsObj::testCellRangeAddress(const 
uno::Any& rExpected, const
 // Creates a model using the XSolverSettings API checks if it is accessible 
via the API
 void ScSolverSettingsObj::testXSolverSettings()
 {
+#ifdef ENABLE_LPSOLVE
     uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
     uno::Reference<container::XIndexAccess> xIndex(xDoc->getSheets(), 
uno::UNO_QUERY_THROW);
     uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), 
uno::UNO_QUERY_THROW);
@@ -203,6 +204,7 @@ void ScSolverSettingsObj::testXSolverSettings()
     CPPUNIT_ASSERT_EQUAL(uno::Any(true), aEngProps2[4].Value);
     CPPUNIT_ASSERT_EQUAL(u"Timeout"_ustr, aEngProps2[5].Name);
     CPPUNIT_ASSERT_EQUAL(uno::Any(static_cast<sal_Int32>(10)), 
aEngProps2[5].Value);
+#endif
 }
 
 void ScSolverSettingsObj::setUp()

Reply via email to