From: Aki Koskinen Date: Sun, 14 Mar 2010 18:41:18 +0000 (+0200) Subject: Unit testing template using QTestLib X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=0d1bd7656f6f802e850b804e2f2b7c11c2f69832;p=ptas Unit testing template using QTestLib --- diff --git a/tests/ut_template/.gitignore b/tests/ut_template/.gitignore new file mode 100644 index 0000000..3e300fc --- /dev/null +++ b/tests/ut_template/.gitignore @@ -0,0 +1,2 @@ +Makefile +ut_template diff --git a/tests/ut_template/ut_template.cpp b/tests/ut_template/ut_template.cpp new file mode 100644 index 0000000..58afcbb --- /dev/null +++ b/tests/ut_template/ut_template.cpp @@ -0,0 +1,24 @@ +#include "ut_template.h" +#include + +void Ut_template::initTestCase() +{ + +} + +void Ut_template::cleanupTestCase() +{ + +} + +void Ut_template::init() +{ + +} + +void Ut_template::cleanup() +{ + +} + +QTEST_MAIN(Ut_template) diff --git a/tests/ut_template/ut_template.h b/tests/ut_template/ut_template.h new file mode 100644 index 0000000..91a2b47 --- /dev/null +++ b/tests/ut_template/ut_template.h @@ -0,0 +1,22 @@ +#ifndef UT_TEMPLATE_H +#define UT_TEMPLATE_H + +#include + +class Ut_template : public QObject +{ + Q_OBJECT + +private slots: + // Will be called before the first testfunction is executed. + void initTestCase(); + // Will be called after the last testfunction was executed. + void cleanupTestCase(); + // Will be called before each testfunction is executed. + void init(); + // Will be called after every testfunction. + void cleanup(); + +}; + +#endif // UT_TEMPLATE_H diff --git a/tests/ut_template/ut_template.pro b/tests/ut_template/ut_template.pro new file mode 100644 index 0000000..0e85b81 --- /dev/null +++ b/tests/ut_template/ut_template.pro @@ -0,0 +1,10 @@ +TARGET = ut_template +QT += testlib +QT -= gui +CONFIG += console +CONFIG -= app_bundle +TEMPLATE = app +OBJECTS_DIR = .obj +MOC_DIR = .moc +SOURCES += ut_template.cpp +HEADERS += ut_template.h