mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
Fix tests for Qt5
This commit is contained in:
@@ -312,12 +312,6 @@ ADD_SUBDIRECTORY( thirdparty )
|
|||||||
ADD_SUBDIRECTORY( src )
|
ADD_SUBDIRECTORY( src )
|
||||||
ADD_SUBDIRECTORY( admin )
|
ADD_SUBDIRECTORY( admin )
|
||||||
|
|
||||||
if( BUILD_TESTS )
|
|
||||||
enable_testing()
|
|
||||||
add_subdirectory( tests )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# Add all targets to the build-tree export set
|
# Add all targets to the build-tree export set
|
||||||
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Tomahawk" CACHE PATH "Installation directory for CMake files")
|
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Tomahawk" CACHE PATH "Installation directory for CMake files")
|
||||||
set(CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}")
|
set(CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}")
|
||||||
|
12
src/tests/CMakeLists.txt
Normal file
12
src/tests/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
if( BUILD_TESTS )
|
||||||
|
setup_qt()
|
||||||
|
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
|
include_directories(${CMAKE_CURRENT_LIST_DIR}/../src/tomahawk ${CMAKE_CURRENT_LIST_DIR}/../src/libtomahawk)
|
||||||
|
include(tomahawk_add_test.cmake)
|
||||||
|
|
||||||
|
tomahawk_add_test(Result)
|
||||||
|
tomahawk_add_test(Query)
|
||||||
|
|
||||||
|
endif()
|
@@ -19,8 +19,6 @@
|
|||||||
#ifndef TOMAHAWK_TESTQUERY_H
|
#ifndef TOMAHAWK_TESTQUERY_H
|
||||||
#define TOMAHAWK_TESTQUERY_H
|
#define TOMAHAWK_TESTQUERY_H
|
||||||
|
|
||||||
#include <QtTest>
|
|
||||||
|
|
||||||
#include "libtomahawk/Query.h"
|
#include "libtomahawk/Query.h"
|
||||||
#include "libtomahawk/Source.h"
|
#include "libtomahawk/Source.h"
|
||||||
|
|
@@ -19,8 +19,6 @@
|
|||||||
#ifndef TOMAHAWK_TESTRESULT_H
|
#ifndef TOMAHAWK_TESTRESULT_H
|
||||||
#define TOMAHAWK_TESTRESULT_H
|
#define TOMAHAWK_TESTRESULT_H
|
||||||
|
|
||||||
#include <QtTest>
|
|
||||||
|
|
||||||
#include "libtomahawk/Result.h"
|
#include "libtomahawk/Result.h"
|
||||||
#include "libtomahawk/Source.h"
|
#include "libtomahawk/Source.h"
|
||||||
|
|
@@ -16,8 +16,8 @@
|
|||||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QtCore>
|
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
|
#include <QtCore>
|
||||||
|
|
||||||
#include "Test@TOMAHAWK_TEST_CLASS@.h"
|
#include "Test@TOMAHAWK_TEST_CLASS@.h"
|
||||||
#include "moc_Test@TOMAHAWK_TEST_CLASS@.cpp"
|
#include "moc_Test@TOMAHAWK_TEST_CLASS@.cpp"
|
||||||
@@ -32,4 +32,4 @@ int main( int argc, char** argv)
|
|||||||
|
|
||||||
TEST( Test@TOMAHAWK_TEST_CLASS@ );
|
TEST( Test@TOMAHAWK_TEST_CLASS@ );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -17,4 +17,7 @@ macro(tomahawk_add_test test_class)
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_test(NAME ${TOMAHAWK_TEST_TARGET} COMMAND ${TOMAHAWK_TEST_TARGET})
|
add_test(NAME ${TOMAHAWK_TEST_TARGET} COMMAND ${TOMAHAWK_TEST_TARGET})
|
||||||
|
|
||||||
|
qt5_use_modules(${TOMAHAWK_TEST_TARGET} Core Network Widgets Sql Xml Test)
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
@@ -1,5 +0,0 @@
|
|||||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/../src ${CMAKE_CURRENT_LIST_DIR}/../src/libtomahawk)
|
|
||||||
include(tomahawk_add_test.cmake)
|
|
||||||
|
|
||||||
tomahawk_add_test(Result)
|
|
||||||
tomahawk_add_test(Query)
|
|
Reference in New Issue
Block a user