mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-12 04:26:43 +00:00
Renamed the test to test_dotherside.cpp
This commit is contained in:
parent
8f188552c2
commit
5c94dd3d70
@ -12,6 +12,6 @@ find_package(Qt5Widgets REQUIRED)
|
|||||||
find_package(Qt5Test REQUIRED)
|
find_package(Qt5Test REQUIRED)
|
||||||
find_package(Qt5Quick REQUIRED)
|
find_package(Qt5Quick REQUIRED)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} Resources.qrc test_dynamicqobject.cpp main.qml)
|
add_executable(${PROJECT_NAME} Resources.qrc test_dotherside.cpp main.qml)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
|
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
|
||||||
target_link_libraries(${PROJECT_NAME} DOtherSideStatic Qt5::Quick Qt5::Widgets Qt5::Test Qt5::Core)
|
target_link_libraries(${PROJECT_NAME} DOtherSideStatic Qt5::Quick Qt5::Widgets Qt5::Test Qt5::Core)
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include "DOtherSide/DynamicQObject.h"
|
#include "DOtherSide/DynamicQObject.h"
|
||||||
#include "DOtherSide/DynamicQObjectFactory.h"
|
#include "DOtherSide/DynamicQObjectFactory.h"
|
||||||
|
|
||||||
|
|
||||||
template<typename Test>
|
template<typename Test>
|
||||||
bool ExecuteTest(int argc, char* argv[]) {
|
bool ExecuteTest(int argc, char* argv[]) {
|
||||||
Test test;
|
Test test;
|
||||||
@ -34,6 +33,7 @@ bool ExecuteGuiTest(int argc, char* argv[]) {
|
|||||||
class TestQGuiApplication : public QObject
|
class TestQGuiApplication : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void testExecution() {
|
void testExecution() {
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
@ -51,6 +51,7 @@ private slots:
|
|||||||
class TestQApplication : public QObject
|
class TestQApplication : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void testExecution() {
|
void testExecution() {
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
@ -68,11 +69,16 @@ private slots:
|
|||||||
class TestQQmlApplicationEngine : public QObject
|
class TestQQmlApplicationEngine : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void initTestCase() {
|
void initTestCase() {
|
||||||
m_engine = nullptr;
|
m_engine = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cleanupTestCase() {
|
||||||
|
QVERIFY(m_engine == nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
QVERIFY(m_engine == nullptr);
|
QVERIFY(m_engine == nullptr);
|
||||||
dos_qqmlapplicationengine_create(&m_engine);
|
dos_qqmlapplicationengine_create(&m_engine);
|
||||||
@ -117,8 +123,37 @@ private:
|
|||||||
/*
|
/*
|
||||||
* Test QQmlContext
|
* Test QQmlContext
|
||||||
*/
|
*/
|
||||||
class TestQQmlContext {
|
class TestQQmlContext : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void initTestCase() {
|
||||||
|
m_engine = nullptr;
|
||||||
|
m_context = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cleanupTestCase() {
|
||||||
|
QVERIFY(m_engine == nullptr);
|
||||||
|
QVERIFY(m_context == nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void init() {
|
||||||
|
dos_qqmlapplicationengine_create(&m_engine);
|
||||||
|
dos_qqmlapplicationengine_context(m_engine, &m_context);
|
||||||
|
QVERIFY(m_engine != nullptr);
|
||||||
|
QVERIFY(m_context != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cleanup() {
|
||||||
|
m_context = nullptr;
|
||||||
|
dos_qqmlapplicationengine_delete(m_engine);
|
||||||
|
m_engine = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void* m_engine;
|
||||||
|
void* m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -166,4 +201,4 @@ int main(int argc, char* argv[])
|
|||||||
return success ? 0 : 1;
|
return success ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "test_dynamicqobject.moc"
|
#include "test_dotherside.moc"
|
Loading…
x
Reference in New Issue
Block a user