Commit 1c6ed6bc authored by Fabian Kosmale's avatar Fabian Kosmale

reenable testing

parent b1f0e5fb
......@@ -10,6 +10,8 @@ set(AKABEI_VERSION_STRING "${MAJOR_AKABEI_VERSION}.${MINOR_AKABEI_VERSION}.${PAT
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
enable_testing() # make this conditional?
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-W -Wall)
......
if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
ENABLE_TESTING()
set(CMAKE_AUTOMOC ON)
#General test
set(akabei_test_SRCS
akabeitest.cpp
)
#General test
set(akabei_test_SRCS
akabeitest.cpp
)
qt5_wrap_cpp(akabei_test_MOC_SRCS akabeitest.h)
add_executable(akabei_test ${akabei_test_SRCS} ${akabei_test_MOC_SRCS})
add_executable(akabei_test ${akabei_test_SRCS} ${akabei_test_MOC_SRCS})
target_link_libraries(akabei_test akabeicore
Qt5::Gui
Qt5::Test)
target_link_libraries(akabei_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei akabei_test)
add_test(akabei akabei_test)
#Hook test
set(akabei_hook_test_SRCS
akabeihooktest.cpp
)
#Hook test
set(akabei_hook_test_SRCS
akabeihooktest.cpp
)
qt5_wrap_cpp(akabei_hook_test_MOC_SRCS akabeihooktest.h)
add_executable(akabei_hook_test ${akabei_hook_test_SRCS} ${akabei_hook_test_MOC_SRCS})
add_executable(akabei_hook_test ${akabei_hook_test_SRCS} ${akabei_hook_test_MOC_SRCS})
target_link_libraries(akabei_hook_test akabeicore
Qt5::Gui
Qt5::Test)
target_link_libraries(akabei_hook_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_hook_test akabei_hook_test)
add_test(akabei_hook_test akabei_hook_test)
#Group test
set(akabei_group_test_SRCS
akabeigrouptest.cpp
)
#Group test
set(akabei_group_test_SRCS
akabeigrouptest.cpp
)
qt5_wrap_cpp(akabei_group_test_MOC_SRCS akabeigrouptest.h)
add_executable(akabei_group_test ${akabei_group_test_SRCS} ${akabei_group_test_MOC_SRCS})
add_executable(akabei_group_test ${akabei_group_test_SRCS} ${akabei_group_test_MOC_SRCS})
target_link_libraries(akabei_group_test akabeicore
Qt5::Gui
Qt5::Test)
target_link_libraries(akabei_group_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_group_test akabei_group_test)
add_test(akabei_group_test akabei_group_test)
#Error test
set(akabei_error_test_SRCS
akabeierrortest.cpp
)
#Error test
set(akabei_error_test_SRCS
akabeierrortest.cpp
)
qt5_wrap_cpp(akabei_error_test_MOC_SRCS akabeierrortest.h)
add_executable(akabei_error_test ${akabei_error_test_SRCS} ${akabei_error_test_MOC_SRCS})
add_executable(akabei_error_test ${akabei_error_test_SRCS} ${akabei_error_test_MOC_SRCS})
target_link_libraries(akabei_error_test akabeicore
Qt5::Gui
Qt5::Test)
target_link_libraries(akabei_error_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_error_test akabei_error_test)
add_test(akabei_error_test akabei_error_test)
#MD5SUM test
set(akabei_md5sum_test_SRCS
akabeimd5sumtest.cpp
)
#MD5SUM test
set(akabei_md5sum_test_SRCS
akabeimd5sumtest.cpp
)
qt5_wrap_cpp(akabei_md5sum_test_MOC_SRCS akabeimd5sumtest.h)
add_executable(akabei_md5sum_test ${akabei_md5sum_test_SRCS} ${akabei_md5sum_test_MOC_SRCS})
add_executable(akabei_md5sum_test ${akabei_md5sum_test_SRCS} ${akabei_md5sum_test_MOC_SRCS})
target_link_libraries(akabei_md5sum_test akabeicore
Qt5::Gui
Qt5::Test)
target_link_libraries(akabei_md5sum_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_md5sum_test akabei_md5sum_test)
add_test(akabei_md5sum_test akabei_md5sum_test)
#MD5SUM test
set(akabei_sqlite_test_SRCS
akabeisqlitetest.cpp
)
#MD5SUM test
set(akabei_sqlite_test_SRCS
akabeisqlitetest.cpp
)
qt5_wrap_cpp(akabei_sqlite_test_MOC_SRCS akabeisqlitetest.h)
add_executable(akabei_sqlite_test ${akabei_sqlite_test_SRCS} ${akabei_sqlite_test_MOC_SRCS})
add_executable(akabei_sqlite_test ${akabei_sqlite_test_SRCS} ${akabei_sqlite_test_MOC_SRCS})
target_link_libraries(akabei_sqlite_test akabeicore
Qt5::Gui
Qt5::Test)
target_include_directories(akabei_sqlite_test PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/build)
add_test(akabei_sqlite_test akabei_sqlite_test)
target_link_libraries(akabei_sqlite_test akabeicore
Qt5::Gui
Qt5::Test)
#ArchiveHandler test
set(akabei_archive_handler_test_SRCS
akabeiarchivehandlertest.cpp
)
add_test(akabei_sqlite_test akabei_sqlite_test)
qt5_wrap_cpp(akabei_archive_handler_test_MOC_SRCS akabeiarchivehandlertest.h)
#ArchiveHandler test
set(akabei_archive_handler_test_SRCS
akabeiarchivehandlertest.cpp
)
add_executable(akabei_archive_handler_test ${akabei_archive_handler_test_SRCS} ${akabei_archive_handler_test_MOC_SRCS})
target_link_libraries(akabei_archive_handler_test akabeicore
Qt5::Gui
Qt5::Test)
add_executable(akabei_archive_handler_test ${akabei_archive_handler_test_SRCS} ${akabei_archive_handler_test_MOC_SRCS})
add_test(akabei_archive_handler_test akabei_archive_handler_test)
target_link_libraries(akabei_archive_handler_test akabeicore
Qt5::Gui
Qt5::Test)
#Version test
set(akabei_version_test_SRCS akabeiversiontest.cpp)
qt4_wrap_cpp(akabei_version_test_MOC_SRCS akabeiversiontest.h)
add_test(akabei_archive_handler_test akabei_archive_handler_test)
add_executable(akabei_version_test ${akabei_version_test_SRCS} ${akabei_version_test_MOC_SRCS})
#Version test
set(akabei_version_test_SRCS akabeiversiontest.cpp)
target_link_libraries(akabei_version_test akabeicore
Qt5::Gui
Qt5::Test)
add_executable(akabei_version_test ${akabei_version_test_SRCS} ${akabei_version_test_MOC_SRCS})
add_test(akabei_version_test akabei_version_test)
target_link_libraries(akabei_version_test akabeicore
Qt5::Gui
Qt5::Test)
#PolKitArchiveHandler test
set(akabei_polkit_archive_handler_test_SRCS
akabeipolkitarchivehandlertest.cpp
)
add_test(akabei_version_test akabei_version_test)
qt5_wrap_cpp(akabei_polkit_archive_handler_test_MOC_SRCS akabeipolkitarchivehandlertest.h)
#PolKitArchiveHandler test
set(akabei_polkit_archive_handler_test_SRCS
akabeipolkitarchivehandlertest.cpp
)
add_executable(akabei_polkit_archive_handler_test ${akabei_polkit_archive_handler_test_SRCS} ${akabei_polkit_archive_handler_test_MOC_SRCS})
target_link_libraries(akabei_polkit_archive_handler_test akabeicore
Qt5::Gui
Qt5::Test)
add_executable(akabei_polkit_archive_handler_test ${akabei_polkit_archive_handler_test_SRCS} ${akabei_polkit_archive_handler_test_MOC_SRCS})
add_test(akabei_polkit_archive_handler_test akabei_polkit_archive_handler_test)
target_link_libraries(akabei_polkit_archive_handler_test akabeicore
Qt5::Gui
Qt5::Test)
#PolKitSQLiteConnection test
set(akabei_polkit_sqliteconnection_test_SRCS
akabeipolkitarchivehandlertest.cpp
)
add_test(akabei_polkit_archive_handler_test akabei_polkit_archive_handler_test)
qt5_wrap_cpp(akabei_polkit_sqliteconnection_test_MOC_SRCS akabeipolkitarchivehandlertest.h)
#PolKitSQLiteConnection test
set(akabei_polkit_sqliteconnection_test_SRCS
akabeipolkitsqliteconnectiontest.cpp
)
add_executable(akabei_polkit_sqliteconnection_test ${akabei_polkit_sqliteconnection_test_SRCS} ${akabei_polkit_sqliteconnection_test_MOC_SRCS})
target_link_libraries(akabei_polkit_sqliteconnection_test akabeicore
Qt5::Gui
Qt5::Test)
add_executable(akabei_polkit_sqliteconnection_test ${akabei_polkit_sqliteconnection_test_SRCS} ${akabei_polkit_sqliteconnection_test_MOC_SRCS})
add_test(akabei_polkit_sqliteconnection_test akabei_polkit_sqliteconnection_test)
target_include_directories(akabei_polkit_sqliteconnection_test PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/build)
#Permissions test
set(akabei_permissions_test_SRCS
akabeipermissionstest.cpp
)
target_link_libraries(akabei_polkit_sqliteconnection_test akabeicore
Qt5::Gui
Qt5::Test)
qt5_wrap_cpp(akabei_permissions_test_MOC_SRCS akabeipermissionstest.h)
add_test(akabei_polkit_sqliteconnection_test akabei_polkit_sqliteconnection_test)
add_executable(akabei_permissions_test ${akabei_permissions_test_SRCS} ${akabei_permissions_test_MOC_SRCS})
#Permissions test
set(akabei_permissions_test_SRCS
akabeipermissionstest.cpp
)
target_link_libraries(akabei_permissions_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_permissions_test akabei_permissions_test)
add_executable(akabei_permissions_test ${akabei_permissions_test_SRCS} ${akabei_permissions_test_MOC_SRCS})
target_link_libraries(akabei_permissions_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_permissions_test akabei_permissions_test)
endif("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
......@@ -23,7 +23,7 @@ Q_OBJECT
public:
AkabeiArchiveHandlerTest(QObject * parent = 0);
private slots:
private Q_SLOTS:
void test();
protected:
void Q_WARN(const char* arg1);
......
......@@ -11,17 +11,16 @@
#ifndef AKABEIERRORTEST_H
#define AKABEIERRORTEST_H
#include <QtCore/QObject>
#include <QObject>
class AkabeiErrorTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void test();
public:
AkabeiErrorTest(QObject * parent = 0);
private slots:
void test();
};
#endif // AKABEIERRORTEST_H
......@@ -27,7 +27,7 @@ void AkabeiGroupTest::test()
QString content = "Name=bla\nIconname=foo\nDescription=bar";
QFile *hFile = new QFile("/tmp/" + name);
hFile->open(QFile::WriteOnly);
hFile->write(content.toAscii());
hFile->write(content.toLatin1());
hFile->close();
QVERIFY(hFile->exists());
......
......@@ -11,7 +11,7 @@
#ifndef AKABEIGROUPTEST_H
#define AKABEIGROUPTEST_H
#include <QtCore/QObject>
#include <QObject>
class AkabeiGroupTest : public QObject
......@@ -20,7 +20,7 @@ Q_OBJECT
public:
explicit AkabeiGroupTest(QObject* parent = 0);
private slots:
private Q_SLOTS:
void test();
};
......
......@@ -31,7 +31,7 @@ void AkabeiHookTest::simpleTest()
QString content = "print 'foo'";
QFile *hFile = new QFile("/tmp/" + name);
hFile->open(QFile::WriteOnly);
hFile->write(content.toAscii());
hFile->write(content.toLatin1());
hFile->close();
Akabei::Hook * hook = Akabei::Backend::instance()->loadHookFromFile(hFile->fileName(), QList<Akabei::Package*>());
......
......@@ -11,7 +11,7 @@
#ifndef AKABEIHOOKTEST_H
#define AKABEIHOOKTEST_H
#include <QtCore/QObject>
#include <QObject>
class AkabeiHookTest : public QObject
......@@ -21,7 +21,7 @@ public:
AkabeiHookTest();
virtual ~AkabeiHookTest();
private slots:
private Q_SLOTS:
void simpleTest();
};
......
......@@ -21,7 +21,7 @@ public:
explicit AkabeiMD5SumTest(QObject* parent = 0);
virtual ~AkabeiMD5SumTest();
private slots:
private Q_SLOTS:
void test();
};
......
......@@ -21,7 +21,7 @@ public:
explicit AkabeiPermissionsTest(QObject* parent = 0);
virtual ~AkabeiPermissionsTest();
private slots:
private Q_SLOTS:
void test();
};
......
......@@ -11,7 +11,7 @@
#ifndef AKABEIARCHIVEHANDLERTEST_H
#define AKABEIARCHIVEHANDLERTEST_H
#include <QtCore/QObject>
#include <QObject>
/**
* @class AkabeiPolKitArchiveHandlerTest
......@@ -23,7 +23,7 @@ Q_OBJECT
public:
AkabeiPolKitArchiveHandlerTest(QObject * parent = 0);
private slots:
private Q_SLOTS:
void test();
};
......
......@@ -11,7 +11,7 @@
#ifndef AKABEIPOLKITSQLITECONNECTIONTEST_H
#define AKABEIPOLKITSQLITECONNECTIONTEST_H
#include <QtCore/QObject>
#include <QObject>
class AkabeiPolkitSQLiteConnectionTest : public QObject
{
......@@ -20,7 +20,7 @@ public:
AkabeiPolkitSQLiteConnectionTest();
virtual ~AkabeiPolkitSQLiteConnectionTest();
private slots:
private Q_SLOTS:
void simpleTest();
};
......
......@@ -21,7 +21,7 @@ public:
AkabeiSQLiteTest(QObject * parent = 0);
virtual ~AkabeiSQLiteTest();
private slots:
private Q_SLOTS:
void test();
};
......
......@@ -20,7 +20,7 @@ public:
AkabeiTest();
~AkabeiTest();
private slots:
private Q_SLOTS:
void simpleTest();
};
......
......@@ -20,7 +20,7 @@ class AkabeiVersionTest : public QObject
public:
AkabeiVersionTest(QObject* parent = 0);
private slots:
private Q_SLOTS:
void test_data();
void test();
};
......
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