add a test which checks that cmake can build the latest stable KDE4 (kdelibs) release

To enable this test, the option TEST_KDE4_STABLE_BRANCH must be switched on.
It can only be switched on if CMAKE_RUN_LONG_TESTS is ON.
Then the test will only be added if Qt >= 4.5 can be found, Perl can be
found and ZLIB can be found.

Alex
This commit is contained in:
Alexander Neundorf 2009-10-15 18:18:23 -04:00
parent 680fae9c97
commit 7e53bcc115
2 changed files with 104 additions and 0 deletions

View File

@ -35,6 +35,11 @@ IF(BUILD_TESTING)
"Should the tests that run a full sub ctest process be run?"
OFF)
MARK_AS_ADVANCED(CTEST_TEST_CTEST)
OPTION(TEST_KDE4_STABLE_BRANCH
"Should the KDE4 stable branch test be run?"
OFF)
MARK_AS_ADVANCED(TEST_KDE4_STABLE_BRANCH)
ENDIF (CMAKE_RUN_LONG_TESTS)
# Should tests that use CVS be run?
@ -1198,6 +1203,43 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS)
IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
IF(UNIX)
IF(NOT QT4_FOUND)
FIND_PACKAGE(Qt4)
ENDIF(NOT QT4_FOUND)
SET(TRY_BUILD_KDE4 TRUE)
IF(QT4_FOUND)
# check whether it's Qt 4.5 in a cmake 2.4. compatible way:
IF(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
SET(TRY_BUILD_KDE4 FALSE)
ENDIF(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
ELSE(QT4_FOUND)
SET(TRY_BUILD_KDE4 FALSE)
ENDIF(QT4_FOUND)
FIND_PACKAGE(Perl)
IF(NOT PERL_FOUND)
SET(TRY_BUILD_KDE4 FALSE)
ENDIF(NOT PERL_FOUND)
FIND_PACKAGE(ZLIB)
IF(NOT ZLIB_FOUND)
SET(TRY_BUILD_KDE4 FALSE)
ENDIF(NOT ZLIB_FOUND)
IF(TRY_BUILD_KDE4)
FILE(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
SET(TEST_KDE4_BASE_DIR ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY)
EXECUTE_PROCESS(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh )
ADD_TEST(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh)
ENDIF(TRY_BUILD_KDE4)
ENDIF(UNIX)
ENDIF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)

View File

@ -0,0 +1,62 @@
#!/bin/sh
# This shell script tests whether cmake is able to build the latest
# stable KDE4 release, or at least some part of it.
# It downloads automoc from KDE svn, builds and installs it, then it
# downloads phonon from KDE svn, builds and installs it, and finally
# it downloads kdelibs (currently from the 4.3 branch), and builds
# a (small) part of it, i.e. libkdecore and one unit test depending on it.
#
# <neundorf AT kde.org>
CMAKE="@CMAKE_CMAKE_COMMAND@"
BASEDIR="@TEST_KDE4_BASE_DIR@"
INSTALLDIR="$BASEDIR/install"
QMAKE="@QT_QMAKE_EXECUTABLE@"
cd "$BASEDIR" || exit -1
echo "Removing old install dir " $INSTALLDIR
rm -rf install || exit -1
rm -rf build-automoc || exit -1
rm -rf build-phonon || exit -1
rm -rf build-kdelibs || exit -1
# build and install automoc
cd "$BASEDIR" || exit -1
svn co svn://anonsvn.kde.org/home/kde/tags/kdesupport-for-4.3/kdesupport/automoc || exit -1
mkdir -p build-automoc || exit -1
cd build-automoc || exit -1
"$CMAKE" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DQT_QMAKE_EXECUTABLE:STRING="$QMAKE" ../automoc || exit -1
"$CMAKE" --build . || exit -1
"$CMAKE" -P cmake_install.cmake || exit -1
export CMAKE_PREFIX_PATH="$INSTALLDIR:$CMAKE_PREFIX_PATH"
# build and install phonon
cd "$BASEDIR" || exit -1
svn co svn://anonsvn.kde.org/home/kde/tags/kdesupport-for-4.3/kdesupport/phonon || exit -1
mkdir -p build-phonon || exit -1
cd build-phonon || exit -1
"$CMAKE" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DQT_QMAKE_EXECUTABLE:STRING="$QMAKE" -DWITH_GLIB2=FALSE -DWITH_GObject=FALSE -DWITH_GStreamer=FALSE -DWITH_GStreamerPlugins=FALSE -DWITH_OpenGL=FALSE -DWITH_XCB=FALSE -DWITH_Xine=FALSE ../phonon || exit -1
"$CMAKE" --build . || exit -1
"$CMAKE" -P cmake_install.cmake || exit -1
# finally build kdelibs/kdecore
cd "$BASEDIR" || exit -1
svn co svn://anonsvn.kde.org/home/kde/branches/KDE/4.3/kdelibs/ || exit -1
mkdir -p build-kdelibs || exit -1
cd build-kdelibs || exit -1
# trick cmake into not searching strigi and not searching sharedmimeinfo
"$CMAKE" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DQT_QMAKE_EXECUTABLE:STRING="$QMAKE" -DSTRIGI_FOUND=TRUE -DSTRIGI_INCLUDE_DIR=/usr/include -DSTRIGI_STREAMANALYZER_LIBRARY=-lc -DSTRIGI_STREAMS_LIBRARY=-lc -DSTRIGI_STRIGIQTDBUSCLIENT_LIBRARY=-lc -DSTRIGI_NEEDS_SIGNED_CHAR=TRUE -DSTRIGI_NEEDS_CHAR=FALSE -DUPDATE_MIME_DATABASE_EXECUTABLE=/bin/sh ../kdelibs || exit -1
make -C kdecore/tests kurltest || exit -1