Commit d2f634ba authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

autotests: Make paths more robust and reorganize tests

parent 6d1f1f8d
......@@ -12,8 +12,17 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII)
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/../src ../src )
macro(knewstuff_unit_tests)
foreach(_testname ${ARGN})
ecm_add_test(${_testname}.cpp ../src/core/author.cpp ../src/core/entryinternal.cpp ../src/entry.cpp ../src/core/xmlloader.cpp ../src/core/jobs/httpjob.cpp ../src/core/jobs/httpworker.cpp ../src/knewstuff_debug.cpp ../src/core/knewstuffcore_debug.cpp
foreach(_testmain ${ARGN})
get_filename_component(_testname ${_testmain} NAME)
ecm_add_test(${_testmain}
${CMAKE_SOURCE_DIR}/src/core/author.cpp
${CMAKE_SOURCE_DIR}/src/core/entryinternal.cpp
${CMAKE_SOURCE_DIR}/src/entry.cpp
${CMAKE_SOURCE_DIR}/src/core/xmlloader.cpp
${CMAKE_SOURCE_DIR}/src/core/jobs/httpjob.cpp
${CMAKE_SOURCE_DIR}/src/core/jobs/httpworker.cpp
${CMAKE_BINARY_DIR}/src/knewstuff_debug.cpp
${CMAKE_BINARY_DIR}/src/core/knewstuffcore_debug.cpp
LINK_LIBRARIES Qt5::Xml Qt5::Test Qt5::Gui KF5::KIOCore KF5::NewStuffCore
TEST_NAME ${_testname}
NAME_PREFIX "knewstuff-")
......@@ -25,8 +34,7 @@ macro(knewstuff_unit_tests)
endmacro()
knewstuff_unit_tests(
knewstuffauthortest
knewstuffentrytest
knewstuffentrytest.cpp
)
# KMoreTools:
......@@ -42,3 +50,4 @@ add_executable(kmoretoolstest2 kmoretools/kmoretoolstest2.cpp ../src/knewstuff_d
ecm_mark_as_test(kmoretoolstest2)
target_link_libraries(kmoretoolstest2 Qt5::Test KF5::NewStuff KF5::I18n)
add_subdirectory(core)
knewstuff_unit_tests(
knewstuffauthortest.cpp
)
......@@ -10,7 +10,7 @@
#include <QTest>
#include <QString>
#include "../src/core/author.h"
#include "core/author.h"
const QString name = QStringLiteral("Name");
const QString email = QStringLiteral("Email@nowhere.com");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment