'make check' fails when building with gcov code coverage

Maarten Hoes hoes.maarten at gmail.com
Wed May 25 12:38:27 UTC 2022


Hi,


I've been trying to run 'make check' in combination with building
LibreOffice with gcov code coverage, and get failures for the following
tests :


gb_GCOV=YES verbose=t make UITest_solver
gb_GCOV=YES verbose=t make CppunitTest_sccomp_solver
gb_GCOV=YES verbose=t make CppunitTest_sccomp_swarmsolvertest


I set the required *FLAGS on the autogen commandline, and ran make with
'gb_GCOV=YES'.

If I build LibreOffice normally, without setting the *FLAGS for gcov code
coverage (and don't set 'gb_GCOV=YES'), the checks succeed.

I have included some of the output of the checks (see below), but am not
really sure if these parts are any help in trying to troubleshoot this, if
full logs are required, or something else entirely is needed.

(BTW: does this list support attachments, for example, to include full logs
? Or is something like pastebin.com preferred for these sorts of things ?)


- Maarten

------------------------------------------------------------------------------------------------




S=/home/maarten/src/libreoffice/core && I=$S/instdir && W=$S/workdir &&
 mkdir -p $W/CppunitTest/ && rm -fr $W/CppunitTest/sccomp_solver.test.user
&& cp -r $W/unittest $W/CppunitTest/sccomp_solver.test.user &&    rm -fr
$W/CppunitTest/sccomp_solver.test.core && mkdir
$W/CppunitTest/sccomp_solver.test.core && cd $W/C
ppunitTest/sccomp_solver.test.core && (  MAX_CONCURRENCY=4
MOZILLA_CERTIFICATE_FOLDER=dbm: SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION=1
SAL_USE_VCLPLUGIN=svp LIBO_LANG=C
 LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program":$W/UnpackedTarball/cppunit/src/cppunit/.libs
       $W/LinkTarget/Exec
utable/cppunittester $W/LinkTarget/CppunitTest/libtest_sccomp_solver.so
--headless "-env:BRAND_BASE_DIR=file://$S/instdir"
"-env:BRAND_SHARE_SUBDIR=share"
"-env:BRAND_SHARE_RESOURCE_SUBDIR=program/resource"
"-env:UserInstallation=file://$W/CppunitTest/sccomp_solver.test.user"
"-env:CONFIGURATION_LAYERS=xcsxcu:file
://$I/share/registry xcsxcu:file://$W/unittest/registry"
 "-env:UNO_TYPES=file://$I/program/types.rdb
file://$I/program/types/offapi.rdb"
 "-env:UNO_SERVICES=file://$W/Rdb/ure/services.rdb
file://$W/Rdb/services.rdb" -env:URE_BIN_DIR=file://$I/program
-env:URE_INTERNAL_LIB_DIR=file://$I/program -env:LO_LIB_DIR=file:
//$I/program -env:LO_JAVA_DIR=file://$I/program/classes --protector
$W/LinkTarget/Library/unoexceptionprotector.so unoexceptionprotector
--protector $W/LinkTarget/Library/unobootstrapprotector.so
unobootstrapprotector   --protector
$W/LinkTarget/Library/libvclbootstrapprotector.so vclbootstrapprotector
"-env:CPPUN
ITTESTTARGET=$W/CppunitTest/sccomp_solver.test"  )  >
$W/CppunitTest/sccomp_solver.test.log 2>&1 || ( RET=$?;
$S/solenv/bin/gdb-core-bt.sh $W/LinkTarget/Executable/cppunittester
$W/CppunitTest/sccomp_solver.test.core $RET >>
$W/CppunitTest/sccomp_solver.test.log 2>&1; cat
$W/CppunitTest/sccomp_solver.test.log; $S/so
lenv/gbuild/platform/unittest-failed-default.sh Cppunit sccomp_solver)
[_RUN_____] (anonymous namespace)::LpSolverTest::testLpSolver
unknown:0:(anonymous namespace)::LpSolverTest::testLpSolver
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

(anonymous namespace)::LpSolverTest::testLpSolver finished in: 5006ms
[_RUN_____] (anonymous namespace)::LpSolverTest::testCoinMPSolver
unknown:0:(anonymous namespace)::LpSolverTest::testCoinMPSolver
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

(anonymous namespace)::LpSolverTest::testCoinMPSolver finished in: 803ms
##Failure Location unknown## : Error
Test name: (anonymous namespace)::LpSolverTest::testLpSolver
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

##Failure Location unknown## : Error
Test name: (anonymous namespace)::LpSolverTest::testCoinMPSolver
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

Failures !!!
Run: 2   Failure total: 2   Failures: 0   Errors: 2

Error: a unit test failed, please do one of:

make CppunitTest_sccomp_solver CPPUNITTRACE="gdb --args"
    # for interactive debugging on Linux
make CppunitTest_sccomp_solver VALGRIND=memcheck
    # for memory checking
make CppunitTest_sccomp_solver DEBUGCPPUNIT=TRUE
    # for exception catching

You can limit the execution to just one particular test by:

make CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params...

make[1]: ***
[/home/maarten/src/libreoffice/core/solenv/gbuild/CppunitTest.mk:121:
/home/maarten/src/libreoffice/core/workdir/CppunitTest/sccomp_solver.test]
Error 1
make[1]: Leaving directory '/home/maarten/src/libreoffice/core'
make[1]: Entering directory '/home/maarten/src/libreoffice/core'



<------- snip ----------->


(anonymous namespace)::SwarmSolverTest::testTwoVariables finished in: 1066ms
##Failure Location unknown## : Error
Test name: (anonymous namespace)::SwarmSolverTest::testUnconstrained
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

##Failure Location unknown## : Error
Test name: (anonymous namespace)::SwarmSolverTest::testVariableBounded
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

##Failure Location unknown## : Error
Test name: (anonymous namespace)::SwarmSolverTest::testVariableConstrained
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

##Failure Location unknown## : Error
Test name: (anonymous namespace)::SwarmSolverTest::testMultipleVariables
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

##Failure Location unknown## : Error
Test name: (anonymous namespace)::SwarmSolverTest::testTwoVariables
An uncaught exception of type
com.sun.star.loader.CannotActivateFactoryException
- loading component library
<file:///home/maarten/src/libreoffice/core/instdir/program/libsolverlo.so>
failed at /home/maarten/src/libreoffice/core/cppuhelper/source/shlib.cxx:312

Failures !!!
Run: 5   Failure total: 5   Failures: 0   Errors: 5

Error: a unit test failed, please do one of:

make CppunitTest_sccomp_swarmsolvertest CPPUNITTRACE="gdb --args"
    # for interactive debugging on Linux
make CppunitTest_sccomp_swarmsolvertest VALGRIND=memcheck
    # for memory checking
make CppunitTest_sccomp_swarmsolvertest DEBUGCPPUNIT=TRUE
    # for exception catching

You can limit the execution to just one particular test by:

make CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params...

make[1]: ***
[/home/maarten/src/libreoffice/core/solenv/gbuild/CppunitTest.mk:121:
/home/maarten/src/libreoffice/core/workdir/CppunitTest/sccomp_swarmsolvertest.test]
Error 1
make[1]: Leaving directory '/home/maarten/src/libreoffice/core'
make[1]: Entering directory '/home/maarten/src/libreoffice/core'


<------- snip ----------->


[build UIT] solver
S=/home/maarten/src/libreoffice/core && I=$S/instdir && W=$S/workdir &&  rm
-rf $W/UITest/solver/ && mkdir -p $W/UITest/solver//user/user && cp
$S/qadevOOo/qa/registrymodifications.xcu $W/UITest/solver//user/user/ &&
 rm -fr $W/UITest/solver/done.core && mkdir -p $W/UITest/solver/user/ &&
mkdir $W/UITest/solver/done
.core && cd $W/UITest/solver/done.core &&   (   TDOC="$S/sc/qa/uitest/data"
BUNDLED_EXTENSIONS='$BRAND_BASE_DIR/NONE'
TEST_LIB=$W/LinkTarget/Library/libtest.so
URE_BOOTSTRAP=vnd.sun.star.pathname:$I/program/fundamentalrc
PYTHONPATH="$S/uitest:$S/unotest/source/python:$I/program:$S/sc/qa/uitest/solver/"
TestUserDir
="file://$W/UITest/solver/" PYTHONDONTWRITEBYTECODE=0   MAX_CONCURRENCY=4
MOZILLA_CERTIFICATE_FOLDER=dbm: SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION=1
SAL_USE_VCLPLUGIN=svp LIBO_LANG=C   /bin/sh $I/program/python
$S/uitest/test_main.py --soffice="path:$I/program/soffice"
--userdir=file://$W/UITest/solver/user --dir=$
S/sc/qa/uitest/solver/   > $W/UITest/solver/done.log 2>&1 || ( RET=$?;
$S/solenv/bin/gdb-core-bt.sh $I/program/soffice.bin
$W/UITest/solver/done.core $RET >> $W/UITest/solver/done.log 2>&1;  cat
$W/UITest/solver/done.log; $S/solenv/gbuild/uitest-failed-default.sh UI
solver))
test_solver (solver.solver) ... OfficeConnection: connecting to:
uno:pipe,name=pytestb0e838d0-db93-11ec-a252-000c2909e7db;urp;StarOffice.ComponentContext
NoConnectException: sleeping...
NoConnectException: sleeping...
NoConnectException: sleeping...
NoConnectException: sleeping...
NoConnectException: sleeping...
NoConnectException: sleeping...
NoConnectException: sleeping...
['OnLoad']
OnLoadFinished
['OnLoad']
OnTitleChanged
['OnLoad']
OnFocus
['OnLoad']
OnViewCreated
['ModelessDialogVisible']
DialogExecute
['ModelessDialogVisible']
DialogExecute
['DialogExecute', 'ModelessDialogExecute', 'ModelessDialogVisible']
DialogClosed
['ModelessDialogVisible']
DialogClosed
Execution time for solver.solver.test_solver: 14.394
tearDown: calling terminate()...
...done
FAIL

======================================================================
FAIL: test_solver (solver.solver)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/maarten/src/libreoffice/core/sc/qa/uitest/solver/solver.py",
line 55, in test_solver
    self.assertEqual("Solving successfully finished.",
get_state_as_dict(xWarnDialog.getChild("label2"))["Text"])
AssertionError: 'Solving successfully finished.' != 'Solving in progress...'
- Solving successfully finished.
+ Solving in progress...


----------------------------------------------------------------------
Ran 1 test in 22.799s

FAILED (failures=1)
Tests run: 1
Tests failed: 1
Tests errors: 0
Tests skipped: 0

Error: a unit test failed:

To rerun just this failed test without all others, use:
    make UITest_solver

Or to run just a specific test case method, use:
    make UITest_solver UITEST_TEST_NAME="Module.ClassName.methodName"
where
    Module - the name of the python file (without the .py extension)
    Class - is the name in the "class Class" declaration

Or to do interactive debugging, run two shells with:
    LANG=C SAL_USE_VCLPLUGIN=gen make debugrun
    make gb_UITest_DEBUGRUN=T UITest_solver

The SAL_USE_VCLPLUGIN part is unnecessary if you are running on a kde
desktop.
(The default gtk3 backend has issues with some uitests).

Failing that, put a
    time.sleep(60)
in the beginning of the method in the .py file,
and attach gdb to the running soffice process.

make[1]: ***
[/home/maarten/src/libreoffice/core/solenv/gbuild/UITest.mk:60:
/home/maarten/src/libreoffice/core/workdir/UITest/solver/done] Error 1
make[1]: Leaving directory '/home/maarten/src/libreoffice/core'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20220525/10db110d/attachment.htm>


More information about the LibreOffice mailing list