TestCocoon support for KDE build system

Stephen Kelly steveire at gmail.com
Sat Aug 27 15:09:12 UTC 2011


Sébastien Fricker wrote:

> Hi,
> I guessing if there are some interests to integrate a support of
> TestCocoon into the KDE build system.
> 
> TestCocoon is an open source code coverage tool which includes a
> graphical interface and which instrument C++ applications up to the
> decision/condition level.
> TestCocoon would permit to collect the coverage information of the unit
> test of the KDE project but also from each beta tester. This would give
> a better overview of the test quality. Also it is possible to work on
> differences between two releases, this permits to check if a hot fix is
> correctly tested.
> 
> The integration into the build system should not be very difficult:
> see http://testcocoon.org/coveragescanner.html#toc66 for an example of a
> CMake configuration.
> 
> I could start myself to work on a patch, but I need first to get
> familiar with the complete KDE build system. So I looking for somebody
> which works with me on this implementation.
> 

That seems interesting. I'm sure we would be happy for better support for 
it.

I've just tried it with grantlee 
(https://www.gitorious.org/grantlee/grantlee) and could not get it to work:

 
kde-devel at bishop:~/dev/src/grantlee/build{master}$ rm -rf *
Qt( 4.7 ) KDE ( 4.6 ) 
kde-devel at bishop:~/dev/src/grantlee/build{master}$ cat 
../cmake/modules/TestCocoonToolchain.cmake
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)

FILE(TO_CMAKE_PATH "/home/kde-devel/dev/qt47/kde46/bin/" 
COVERAGESCANNER_PATH)
# specify the cross compiler
SET(CMAKE_C_COMPILER ${COVERAGESCANNER_PATH}/csgcc
    CACHE FILEPATH "CoverageScanner wrapper" FORCE)
SET(CMAKE_CXX_COMPILER ${COVERAGESCANNER_PATH}/csg++
    CACHE FILEPATH "CoverageScanner wrapper" FORCE)
SET(CMAKE_LINKER ${COVERAGESCANNER_PATH}/csg++
    CACHE FILEPATH "CoverageScanner wrapper" FORCE)
SET(CMAKE_AR ${COVERAGESCANNER_PATH}/csar
    CACHE FILEPATH "CoverageScanner wrapper" FORCE)
Qt( 4.7 ) KDE ( 4.6 ) 
kde-devel at bishop:~/dev/src/grantlee/build{master}$ cmake -
DCMAKE_BUILD_TYPE=TestCocoon -DCMAKE_TOOLCHAIN_FILE=/home/kde-
devel/dev/src/grantlee/cmake/modules/TestCocoonToolchain.cmake -G "Unix 
Makefiles" ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /home/kde-devel/dev/qt47/kde46/bin/csgcc
-- Check for working C compiler: /home/kde-devel/dev/qt47/kde46/bin/csgcc -- 
works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
RegularExpression::compile(): Nested *?+.
RegularExpression::compile(): Error in compile.
CMake Error at /home/kde-
devel/dev/qt47/kde46/share/cmake-2.8/Modules/CMakeParseImplicitLinkInfo.cmake:37 
(if):
  if given arguments:

    "Change Dir: /home/kde-devel/dev/src/grantlee/build/CMakeFiles/CMakeTmp" 
"MATCHES" "^( *|.*[/\\])(csg++|ld|collect2)[^/\\]*( |\$)" "AND" "NOT" 
"Change Dir: /home/kde-devel/dev/src/grantlee/build/CMakeFiles/CMakeTmp" 
"MATCHES" "collect2 version "

  Regular expression "^( *|.*[/\])(csg++|ld|collect2)[^/\]*( |$)" cannot
  compile
Call Stack (most recent call first):
  /home/kde-
devel/dev/qt47/kde46/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:81 
(CMAKE_PARSE_IMPLICIT_LINK_INFO)
  /home/kde-
devel/dev/qt47/kde46/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:71 
(CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
Qt( 4.7 ) KDE ( 4.6 ) 
kde-devel at bishop:~/dev/src/grantlee/build{master}$ cmake -
DCMAKE_BUILD_TYPE=TestCocoon -DCMAKE_TOOLCHAIN_FILE=/home/kde-
devel/dev/src/grantlee/cmake/modules/TestCocoonToolchain.cmake -G "Unix 
Makefiles" ..
-- The CXX compiler identification is GNU
-- Check for working CXX compiler: /home/kde-devel/dev/qt47/kde46/bin/csg++
-- Check for working CXX compiler: /home/kde-devel/dev/qt47/kde46/bin/csg++ 
-- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
RegularExpression::compile(): Nested *?+.
RegularExpression::compile(): Error in compile.
CMake Error at /home/kde-
devel/dev/qt47/kde46/share/cmake-2.8/Modules/CMakeParseImplicitLinkInfo.cmake:37 
(if):
  if given arguments:

    "Change Dir: /home/kde-devel/dev/src/grantlee/build/CMakeFiles/CMakeTmp" 
"MATCHES" "^( *|.*[/\\])(csg++|ld|collect2)[^/\\]*( |\$)" "AND" "NOT" 
"Change Dir: /home/kde-devel/dev/src/grantlee/build/CMakeFiles/CMakeTmp" 
"MATCHES" "collect2 version "

  Regular expression "^( *|.*[/\])(csg++|ld|collect2)[^/\]*( |$)" cannot
  compile
Call Stack (most recent call first):
  /home/kde-
devel/dev/qt47/kde46/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:81 
(CMAKE_PARSE_IMPLICIT_LINK_INFO)
  /home/kde-
devel/dev/qt47/kde46/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:64 
(CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
Qt( 4.7 ) KDE ( 4.6 ) 
kde-devel at bishop:~/dev/src/grantlee/build{master}$ cmake -
DCMAKE_BUILD_TYPE=TestCocoon -DCMAKE_TOOLCHAIN_FILE=/home/kde-
devel/dev/src/grantlee/cmake/modules/TestCocoonToolchain.cmake -G "Unix 
Makefiles" ..
-- Performing Test HAVE_GCC_VISIBILITY
-- Performing Test HAVE_GCC_VISIBILITY - Failed
-- Performing Test HAVE_GCC_INLINE_VISIBILITY
-- Performing Test HAVE_GCC_INLINE_VISIBILITY - Failed
CMake Warning at cmake/modules/GrantleeGenerateExportHeader.cmake:222 
(message):
  GCC Hidden visibility not available for this compiler
Call Stack (most recent call first):
  CMakeLists.txt:61 (grantlee_enable_gcc_hidden_visibility)


-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /home/kde-devel/dev/qt47/bin/qmake (found suitable version 
"4.7.4", required is "4.5.0")
-- Found Qt4: /home/kde-devel/dev/qt47/bin/qmake (found version "4.7.4")
-- Found Qt4: /home/kde-devel/dev/qt47/bin/qmake (found suitable version 
"4.7.4", required is "4.5.0")
-- Found Doxygen: /usr/bin/doxygen 
-- Doxygen and dot found. make docs target is available
-- Found LCov: /usr/bin/lcov 
-- Found Cccc: /usr/bin/cccc 
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE


-- Build files have been written to: /home/kde-devel/dev/src/grantlee/build
Qt( 4.7 ) KDE ( 4.6 ) 
kde-devel at bishop:~/dev/src/grantlee/build{master}$ cmake -
DCMAKE_BUILD_TYPE=TestCocoon -DCMAKE_TOOLCHAIN_FILE=/home/kde-
devel/dev/src/grantlee/cmake/modules/TestCocoonToolchain.cmake -G "Unix 
Makefiles" ..
CMake Warning at cmake/modules/GrantleeGenerateExportHeader.cmake:222 
(message):
  GCC Hidden visibility not available for this compiler
Call Stack (most recent call first):
  CMakeLists.txt:61 (grantlee_enable_gcc_hidden_visibility)


-- Found Qt4: /home/kde-devel/dev/qt47/bin/qmake (found suitable version 
"4.7.4", required is "4.5.0")
-- Found Qt4: /home/kde-devel/dev/qt47/bin/qmake (found version "4.7.4")
-- Found Qt4: /home/kde-devel/dev/qt47/bin/qmake (found suitable version 
"4.7.4", required is "4.5.0")
-- Doxygen and dot found. make docs target is available
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE


-- Build files have been written to: /home/kde-devel/dev/src/grantlee/build

make results in tonnes of output along the lines of 


CoverageScanner ("/home/kde-devel/dev/qt47/kde46/bin/csg++") is build in 
debug mode.
coveragescanner:17: error: style of line directive is a GCC extension
/home/kde-devel/dev/src/grantlee/textdocument/lib/markupdirector.cpp:1: 
error: style of line directive is a GCC extension
/home/kde-devel/dev/src/grantlee/build/textdocument/lib//:1: error: style of 
line directive is a GCC extension
<built-in>:1: error: style of line directive is a GCC extension
<command-line>:1: error: style of line directive is a GCC extension
/home/kde-devel/dev/src/grantlee/textdocument/lib/markupdirector.cpp:1: 
error: style of line directive is a GCC extension
/home/kde-devel/dev/src/grantlee/textdocument/lib/markupdirector.cpp:22: 
error: style of line directive is a GCC extension
In file included from /home/kde-
devel/dev/src/grantlee/textdocument/lib/markupdirector.cpp:23:
/home/kde-devel/dev/src/grantlee/textdocument/lib/markupdirector.h:1: error: 
style of line directive is a GCC extension
In file included from /home/kde-
devel/dev/src/grantlee/textdocument/lib/markupdirector.cpp:23:
/home/kde-devel/dev/src/grantlee/textdocument/lib/markupdirector.h:25: 
error: style of line directive is a GCC extension
In file included from /home/kde-
devel/dev/src/grantlee/textdocument/lib/markupdirector.h:26,
                 from /home/kde-
devel/dev/src/grantlee/textdocument/lib/markupdirector.cpp:23:
/home/kde-devel/dev/src/grantlee/textdocument/lib/abstractmarkupbuilder.h:1: 
error: style of line directive is a GCC extension
In file included from /home/kde-
devel/dev/src/grantlee/textdocument/lib/markupdirector.h:26,
                 from /home/kde-
devel/dev/src/grantlee/textdocument/lib/markupdirector.cpp:23:

And:

Fatal:Could not generate object file
cmd:g++ -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-
subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-
common -pedantic-errors -g -I/home/kde-
devel/dev/src/grantlee/build/templates/tests/pluginpointertest -I/home/kde-
devel/dev/src/grantlee/templates/tests/pluginpointertest -I/home/kde-
devel/dev/qt47/include -I/home/kde-devel/dev/qt47/include/QtScript -
I/home/kde-devel/dev/qt47/include/QtTest -I/home/kde-
devel/dev/qt47/include/QtCore -I/home/kde-
devel/dev/src/grantlee/build/templates/lib -I/home/kde-
devel/dev/src/grantlee/templates/lib -I/home/kde-
devel/dev/src/grantlee/../../corelib -o CMakeFiles/main_app.dir/main.cpp.o -
c /tmp//lqldzj_main.cpp.csmes_o3v_qndxcl.cpp

                                                                                                                             

I'm sure using TestCocoon with KDE would have similar issues. There are a 
few problems already here. Any ideas where to start? I changed the csg++ to 
csgxx in the Toolchain file already, which is a good start, but doesn't 
solve the issues on make, and the fact that csgxx reports that it doesn't 
support -fvisibility=hidden. I've installed testcocoon master, so I can test 
fixes easily.

Thanks,

Steve.







More information about the Kde-buildsystem mailing list