Commit 34b0d0d2 authored by Julien Wintz's avatar Julien Wintz
Browse files

Updating test infrastructure.

parent 21876672
......@@ -3,9 +3,9 @@
## Author: Julien Wintz
## Created: Mon Feb 4 10:17:21 2013 (+0100)
## Version:
## Last-Updated: Mon Feb 4 14:15:10 2013 (+0100)
## Last-Updated: Mon Feb 4 15:15:15 2013 (+0100)
## By: Julien Wintz
## Update #: 44
## Update #: 48
######################################################################
##
### Change Log:
......@@ -60,10 +60,10 @@ find_package(Qt5Widgets REQUIRED)
## Dependencies - internal
## #################################################################
# include_directories(${CMAKE_SOURCE_DIR}/src)
# include_directories(${CMAKE_SOURCE_DIR}/src/1)
# include_directories(${CMAKE_SOURCE_DIR}/src/2)
# ...
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/src/dtk)
include_directories(${CMAKE_SOURCE_DIR}/src/dtkDistributed)
include_directories(${CMAKE_SOURCE_DIR}/src/dtkTest)
## ###################################################################
## Input
......
#include "dtkTest.h"
/* dtkTest.h ---
*
* Author: Julien Wintz
* Created: Mon Feb 4 15:02:54 2013 (+0100)
* Version:
* Last-Updated: Mon Feb 4 15:37:33 2013 (+0100)
* By: Julien Wintz
* Update #: 10
*/
/* Change Log:
*
*/
#pragma once
#include <QtTest>
#define DTKTEST_MAIN(TestMain, TestObject) \
int TestMain(int argc, char **argv) \
{ \
QApplication app(argc, argv); \
TestObject tc; \
return QTest::qExec(&tc, argc, argv); \
}
#define DTKTEST_MAIN_NOGUI(TestMain, TestObject) \
int TestMain(int argc, char **argv) \
{ \
QCoreApplication app(argc, argv); \
TestObject tc; \
return QTest::qExec(&tc, argc, argv); \
}
......@@ -3,13 +3,15 @@
## Author: Julien Wintz
## Created: Mon Feb 4 12:19:46 2013 (+0100)
## Version:
## Last-Updated: Mon Feb 4 12:19:57 2013 (+0100)
## Last-Updated: Mon Feb 4 15:59:13 2013 (+0100)
## By: Julien Wintz
## Update #: 1
## Update #: 16
######################################################################
##
### Change Log:
##
######################################################################
enable_testing()
add_subdirectory(dtkDistributed)
......@@ -3,9 +3,9 @@
## Author: Julien Wintz
## Created: Mon Feb 4 12:20:18 2013 (+0100)
## Version:
## Last-Updated: Mon Feb 4 14:16:02 2013 (+0100)
## Last-Updated: Mon Feb 4 15:47:30 2013 (+0100)
## By: Julien Wintz
## Update #: 14
## Update #: 39
######################################################################
##
### Change Log:
......@@ -24,12 +24,24 @@ set(${PROJECT_NAME}_HEADERS
set(${PROJECT_NAME}_SOURCES
dtkDistributedCommunicatorTest.cpp)
## ###################################################################
##
## ###################################################################
create_test_sourcelist(
${PROJECT_NAME}_SOURCES_TST
${PROJECT_NAME}.cpp
${${PROJECT_NAME}_SOURCES})
message(${${PROJECT_NAME}_SOURCES_TST})
message(${${PROJECT_NAME}_SOURCES})
## ###################################################################
## Build rules
## ###################################################################
add_executable(${PROJECT_NAME}
${${PROJECT_NAME}_HEADERS}
${${PROJECT_NAME}_SOURCES_TST}
${${PROJECT_NAME}_SOURCES})
## ###################################################################
......@@ -42,7 +54,7 @@ qt5_use_modules(${PROJECT_NAME} Test)
target_link_libraries(${PROJECT_NAME} dtkDistributed)
## ###################################################################
## CTest rules
## Test rules
## ###################################################################
add_test(NAME dtkDistributedCommunicatorTest COMMAND dtkDistributedTest dtkDistributedCommunicatorTest)
add_test(dtkDistributedCommunicatorTest dtkDistributedTest dtkDistributedCommunicatorTest)
......@@ -3,9 +3,9 @@
* Author: Julien Wintz
* Created: Mon Feb 4 14:11:27 2013 (+0100)
* Version:
* Last-Updated: Mon Feb 4 14:17:50 2013 (+0100)
* Last-Updated: Mon Feb 4 15:54:44 2013 (+0100)
* By: Julien Wintz
* Update #: 21
* Update #: 40
*/
/* Change Log:
......@@ -14,38 +14,34 @@
#include "dtkDistributedCommunicatorTest.h"
void dtkDistributedCommunicatorTest::initTestCase(void)
void dtkDistributedCommunicatorTestCase::initTestCase(void)
{
}
void dtkDistributedCommunicatorTest::init(void)
void dtkDistributedCommunicatorTestCase::init(void)
{
}
void dtkDistributedCommunicatorTest::test1(void)
void dtkDistributedCommunicatorTestCase::test1(void)
{
QVERIFY(1 == 1);
}
void dtkDistributedCommunicatorTest::test2(void)
void dtkDistributedCommunicatorTestCase::test2(void)
{
QVERIFY(2 == 2);
}
void dtkDistributedCommunicatorTest::cleanupTestCase(void)
void dtkDistributedCommunicatorTestCase::cleanupTestCase(void)
{
}
void dtkDistributedCommunicatorTest::cleanup(void)
void dtkDistributedCommunicatorTestCase::cleanup(void)
{
}
// ///////////////////////////////////////////////////////////////////
//
// ///////////////////////////////////////////////////////////////////
QTEST_MAIN(dtkDistributedCommunicatorTest)
DTKTEST_MAIN_NOGUI(dtkDistributedCommunicatorTest, dtkDistributedCommunicatorTestCase)
......@@ -3,9 +3,9 @@
* Author: Julien Wintz
* Created: Mon Feb 4 13:58:16 2013 (+0100)
* Version:
* Last-Updated: Mon Feb 4 14:12:58 2013 (+0100)
* Last-Updated: Mon Feb 4 15:53:57 2013 (+0100)
* By: Julien Wintz
* Update #: 12
* Update #: 14
*/
/* Change Log:
......@@ -14,9 +14,9 @@
#pragma once
#include <QtTest>
#include <dtkTest>
class dtkDistributedCommunicatorTest : public QObject
class dtkDistributedCommunicatorTestCase : public QObject
{
Q_OBJECT
......
Supports Markdown
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