[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: KUnitTest
From: Thomas Kadauke <tkadauke () gmx ! de>
Date: 2005-10-21 21:29:40
Message-ID: 200510212329.40372.tkadauke () gmx ! de
[Download RAW message or body]
Am Friday 21 October 2005 22:47 schrieb Adriaan de Groot:
> I'd be pretty hesitant to write dox for this; it's not like KUnitTest is
> widely used. There are surely more low-hanging fruit to be had (KAccel*
> comes to mind, it's missing tons of things) as well as -- more important --
> overview writing. Forward-porting dox is becoming harder as well,now that
> char * name is gone everywhere and patches can't be applied. Frankly, I'm
> starting to think that apidox volunteers -- as opposed to class / library
> authors who are supposed to also maintain their apidox -- should be working
> on KDE 4 dox, in spite of the volatility that's out there.
I didn't write lots of documentation. I just fixed it so that macros would be
shown in the generated dox. See attachment. Also note that I'm now a proud
owner of an SVN account so you don't need to commit ... IF you tell me where
I can find more information about the DOX tag :)
Thanks!
--Thomas
["kunittest_dox.diff" (text/x-diff)]
Index: runner.h
===================================================================
--- runner.h (revision 472669)
+++ runner.h (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
* kunittest.h
*
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
@@ -25,6 +25,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*!
+ * @file runner.h
+ * Defines a set of macros and classes for running unit tests
+ */
+
#ifndef KUNITTEST_RUNNER_H
#define KUNITTEST_RUNNER_H
Index: tester.cpp
===================================================================
--- tester.cpp (revision 472669)
+++ tester.cpp (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (C) 2005 Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
*
* Redistribution and use in source and binary forms, with or without
Index: samplemodule.cpp
===================================================================
--- samplemodule.cpp (revision 472669)
+++ samplemodule.cpp (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (C) 2005 Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
*
* Redistribution and use in source and binary forms, with or without
Index: modrunner.cpp
===================================================================
--- modrunner.cpp (revision 472669)
+++ modrunner.cpp (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (C) 2005 Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
*
* Redistribution and use in source and binary forms, with or without
Index: runner.cpp
===================================================================
--- runner.cpp (revision 472669)
+++ runner.cpp (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
*
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
* Copyright (C) 2005 Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
Index: module.h
===================================================================
--- module.h (revision 472669)
+++ module.h (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (C) 2005 Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
*
* Redistribution and use in source and binary forms, with or without
@@ -23,6 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*!
+ * @file module.h
+ * Provides macros to ease building unit tests as shared libraries
+ */
+
#ifndef KUNITTEST_MODULE_H
#define KUNITTEST_MODULE_H
Index: tester.h
===================================================================
--- tester.h (revision 472669)
+++ tester.h (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
* tester.h
*
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
@@ -100,9 +100,9 @@
* }
* @endcode
*
- * CHECK is implemented using a template, so you get type safe
+ * CHECK() is implemented using a template, so you get type safe
* comparison. All that is needed is that the argument types have an
- * operator==() defined.
+ * @c operator==() defined.
*
* Now that you did that the only other thing to do is to tell the
* framework to add this test case, by using the KUNITTEST_REGISTER_TESTER(x) macro. Just
@@ -215,13 +215,13 @@
* KUNITTEST_MODULE_REGISTER_TESTER( SomeSampleTester );
* @endcode
*
- * The first macro, KUNITTEST_MODULE, makes sure that the module can be loaded and that
+ * The first macro, KUNITTEST_MODULE(), makes sure that the module can be loaded and that
* the test classes are created. The first argument "kunittest_samplemodule" is the library
* name, in this case the library we're creating a kunittest_samplemodule.la module. The
* second argument is name which will appear in the test runner for this test suite.
*
- * The tester class are now added by the KUNITTEST_MODULE_REGISTER_TESTER macro, not the
- * KUNITTEST_REGISTER_TESTER. The only difference between the two is that you have to
+ * The tester class are now added by the KUNITTEST_MODULE_REGISTER_TESTER() macro, not the
+ * KUNITTEST_REGISTER_TESTER(). The only difference between the two is that you have to
* pass the module class name to this macro.
*
* The Makefile.am is also a bit different, but not much:
@@ -290,7 +290,7 @@
*
* KUnitTest comes with simple support for testing whether an exception, such as a function call,
* throws an exception or not. Simply, for the usual macros there corresponding ones for
- * exception testing: CHECK_EXCEPTION, XFAIL_EXCEPTION, and SKIP_EXCEPTION. They all take two
+ * exception testing: CHECK_EXCEPTION(), XFAIL_EXCEPTION(), and SKIP_EXCEPTION(). They all take two
* arguments: the expression that will catch the exception, and the expression that is supposed
* to throw the exception.
*
@@ -317,6 +317,11 @@
* These scripts are part of the kdesdk/kunittest module.
*/
+/*!
+ * @file tester.h
+ * Defines macros for unit testing as well as some test classes.
+ */
+
#include <iostream>
using namespace std;
@@ -351,7 +356,7 @@
#define SKIP( x ) skip( __FILE__, __LINE__, QString::fromLatin1(#x))
/*!
- * An macro testing that @p expression throws an exception that is catched
+ * A macro testing that @p expression throws an exception that is catched
* with @p exceptionCatch. Use it to test that an expression, such as a function call,
* throws a certain exception.
*
@@ -409,6 +414,9 @@
skip( __FILE__, __LINE__, QString("Exception catch: ")\
.arg(QString(#exceptionCatch)).arg(QString(" Test expression: ")).arg(QString(#expression)))
+/**
+ * Namespace for Unit testing classes
+ */
namespace KUnitTest
{
/*! A simple class that encapsulates a test result. A Tester class usually
Index: samplemodule.h
===================================================================
--- samplemodule.h (revision 472669)
+++ samplemodule.h (working copy)
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (C) 2005 Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
*
* Redistribution and use in source and binary forms, with or without
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic