Added cppunit to the ./contrib dir. Build config for x64 and dll builds (some bugs remaining, but most configs are working)
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@70 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
e8511e89ff
commit
c1b6f29854
|
@ -42,6 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_BASEPROCESS_H_INC
|
#ifndef AI_BASEPROCESS_H_INC
|
||||||
#define AI_BASEPROCESS_H_INC
|
#define AI_BASEPROCESS_H_INC
|
||||||
|
|
||||||
|
|
||||||
|
#include "../include/aiTypes.h"
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
|
@ -56,7 +59,7 @@ namespace Assimp
|
||||||
* and calls IsActive() on each process to evaluate if the step should be executed.
|
* and calls IsActive() on each process to evaluate if the step should be executed.
|
||||||
* If the function returns true, the class' Execute() function is called subsequently.
|
* If the function returns true, the class' Execute() function is called subsequently.
|
||||||
*/
|
*/
|
||||||
class BaseProcess
|
class ASSIMP_API BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace Assimp
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** The GenFaceNormalsProcess computes face normals for all faces of all meshes
|
/** The GenFaceNormalsProcess computes face normals for all faces of all meshes
|
||||||
*/
|
*/
|
||||||
class GenFaceNormalsProcess : public BaseProcess
|
class ASSIMP_API GenFaceNormalsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Assimp
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** The GenFaceNormalsProcess computes vertex normals for all vertizes of all meshes
|
/** The GenFaceNormalsProcess computes vertex normals for all vertizes of all meshes
|
||||||
*/
|
*/
|
||||||
class GenVertexNormalsProcess : public BaseProcess
|
class ASSIMP_API GenVertexNormalsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,9 @@ namespace Assimp
|
||||||
* cache locality. It tries to arrange all faces to fans and to render
|
* cache locality. It tries to arrange all faces to fans and to render
|
||||||
* faces which share vertices directly one after the other.
|
* faces which share vertices directly one after the other.
|
||||||
*
|
*
|
||||||
* @note This step expects the triagulated input data.
|
* @note This step expects triagulated input data.
|
||||||
*/
|
*/
|
||||||
class ImproveCacheLocalityProcess : public BaseProcess
|
class ASSIMP_API ImproveCacheLocalityProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace Assimp
|
||||||
* erases all but one of the copies. This usually reduces the number of vertices
|
* erases all but one of the copies. This usually reduces the number of vertices
|
||||||
* in a mesh by a serious amount and is the standard form to render a mesh.
|
* in a mesh by a serious amount and is the standard form to render a mesh.
|
||||||
*/
|
*/
|
||||||
class JoinVerticesProcess : public BaseProcess
|
class ASSIMP_API JoinVerticesProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Assimp
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** KillNormalsProcess: Class to kill all normals loaded
|
/** KillNormalsProcess: Class to kill all normals loaded
|
||||||
*/
|
*/
|
||||||
class KillNormalsProcess : public BaseProcess
|
class ASSIMP_API KillNormalsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace Assimp
|
||||||
* The other weights on this bone are then renormalized to assure the sum weight
|
* The other weights on this bone are then renormalized to assure the sum weight
|
||||||
* to be 1.
|
* to be 1.
|
||||||
*/
|
*/
|
||||||
class LimitBoneWeightsProcess : public BaseProcess
|
class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
friend class ::LimitBoneWeightsTest;
|
friend class ::LimitBoneWeightsTest;
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace Assimp
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Internal material helper class. Can be used to fill an aiMaterial
|
/** Internal material helper class. Can be used to fill an aiMaterial
|
||||||
structure easily. */
|
structure easily. */
|
||||||
class MaterialHelper : public ::aiMaterial
|
class ASSIMP_API MaterialHelper : public ::aiMaterial
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace Assimp
|
||||||
* and removes the whole graph. The output is a list of meshes, one for
|
* and removes the whole graph. The output is a list of meshes, one for
|
||||||
* each material.
|
* each material.
|
||||||
*/
|
*/
|
||||||
class PretransformVertices : public BaseProcess
|
class ASSIMP_API PretransformVertices : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace Assimp
|
||||||
* to those in C or C++ so this code has been moved to a separate
|
* to those in C or C++ so this code has been moved to a separate
|
||||||
* module.
|
* module.
|
||||||
*/
|
*/
|
||||||
class CommentRemover
|
class ASSIMP_API CommentRemover
|
||||||
{
|
{
|
||||||
// class cannot be instanced
|
// class cannot be instanced
|
||||||
CommentRemover() {}
|
CommentRemover() {}
|
||||||
|
|
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_SPATIALSORT_H_INC
|
#define AI_SPATIALSORT_H_INC
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../include/aiVector3D.h"
|
#include "../include/aiTypes.h"
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@ namespace Assimp
|
||||||
* time, with O(n) worst case complexity when all vertices lay on the plane. The plane is chosen
|
* time, with O(n) worst case complexity when all vertices lay on the plane. The plane is chosen
|
||||||
* so that it avoids common planes in usual data sets.
|
* so that it avoids common planes in usual data sets.
|
||||||
*/
|
*/
|
||||||
class SpatialSort
|
class ASSIMP_API SpatialSort
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
|
|
||||||
#include "../include/aiMesh.h"
|
#include "../include/aiMesh.h"
|
||||||
#include "../include/aiScene.h"
|
#include "../include/aiScene.h"
|
||||||
|
|
||||||
|
@ -58,9 +59,9 @@ class SplitLargeMeshesProcess_Vertex;
|
||||||
// corresponding values in all Assimp ports
|
// corresponding values in all Assimp ports
|
||||||
|
|
||||||
// **********************************************************
|
// **********************************************************
|
||||||
// Java: PostProcessStep.java,
|
// Java: ConfigProperty.java,
|
||||||
// PostProcessStep.DEFAULT_VERTEX_SPLIT_LIMIT
|
// ConfigProperty.DEFAULT_VERTEX_SPLIT_LIMIT
|
||||||
// PostProcessStep.DEFAULT_TRIANGLE_SPLIT_LIMIT
|
// ConfigProperty.DEFAULT_TRIANGLE_SPLIT_LIMIT
|
||||||
// **********************************************************
|
// **********************************************************
|
||||||
|
|
||||||
// default limit for vertices
|
// default limit for vertices
|
||||||
|
@ -79,7 +80,7 @@ class SplitLargeMeshesProcess_Vertex;
|
||||||
* Applied BEFORE the JoinVertices-Step occurs.
|
* Applied BEFORE the JoinVertices-Step occurs.
|
||||||
* Returns NON-UNIQUE vertices, splits by triangle number.
|
* Returns NON-UNIQUE vertices, splits by triangle number.
|
||||||
*/
|
*/
|
||||||
class SplitLargeMeshesProcess_Triangle : public BaseProcess
|
class ASSIMP_API SplitLargeMeshesProcess_Triangle : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
friend class SplitLargeMeshesProcess_Vertex;
|
friend class SplitLargeMeshesProcess_Vertex;
|
||||||
|
@ -130,7 +131,7 @@ public:
|
||||||
* Applied AFTER the JoinVertices-Step occurs.
|
* Applied AFTER the JoinVertices-Step occurs.
|
||||||
* Returns UNIQUE vertices, splits by vertex number.
|
* Returns UNIQUE vertices, splits by vertex number.
|
||||||
*/
|
*/
|
||||||
class SplitLargeMeshesProcess_Vertex : public BaseProcess
|
class ASSIMP_API SplitLargeMeshesProcess_Vertex : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ struct STransformVecInfo
|
||||||
/** Helper class used by the ASE/ASK and 3DS loaders to handle texture
|
/** Helper class used by the ASE/ASK and 3DS loaders to handle texture
|
||||||
* coordinate transformations correctly (such as offsets, scaling)
|
* coordinate transformations correctly (such as offsets, scaling)
|
||||||
*/
|
*/
|
||||||
class TextureTransform
|
class ASSIMP_API TextureTransform
|
||||||
{
|
{
|
||||||
//! Constructor, it is not possible to create instances of this class
|
//! Constructor, it is not possible to create instances of this class
|
||||||
TextureTransform() {}
|
TextureTransform() {}
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace Assimp
|
||||||
* into triangles. You usually want this to happen because the graphics cards
|
* into triangles. You usually want this to happen because the graphics cards
|
||||||
* need their data as triangles.
|
* need their data as triangles.
|
||||||
*/
|
*/
|
||||||
class TriangulateProcess : public BaseProcess
|
class ASSIMP_API TriangulateProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_VALIDATEPROCESS_H_INC
|
#ifndef AI_VALIDATEPROCESS_H_INC
|
||||||
#define AI_VALIDATEPROCESS_H_INC
|
#define AI_VALIDATEPROCESS_H_INC
|
||||||
|
|
||||||
|
#include "../include/aiTypes.h"
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
|
|
||||||
struct aiBone;
|
struct aiBone;
|
||||||
|
@ -61,7 +62,7 @@ namespace Assimp
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Validates the ASSIMP data structure
|
/** Validates the ASSIMP data structure
|
||||||
*/
|
*/
|
||||||
class ValidateDSProcess : public BaseProcess
|
class ASSIMP_API ValidateDSProcess : public BaseProcess
|
||||||
{
|
{
|
||||||
friend class Importer;
|
friend class Importer;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace Assimp
|
||||||
*
|
*
|
||||||
* @note The input data is expected to be triangulated.
|
* @note The input data is expected to be triangulated.
|
||||||
*/
|
*/
|
||||||
class VertexTriangleAdjacency
|
class ASSIMP_API VertexTriangleAdjacency
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
Michael Feathers <mfeathers@objectmentor.com>
|
||||||
|
Jerome Lacoste <lacostej@altern.org>
|
||||||
|
E. Sommerlade <eric@sommerla.de>
|
||||||
|
Baptiste Lepilleur <gaiacrtn@free.fr> <blep@sourceforge.net>
|
||||||
|
Bastiaan Bakker <bastiaan.bakker@lifeline.nl>
|
||||||
|
Steve Robbins <smr99@sourceforge.net>
|
|
@ -0,0 +1,6 @@
|
||||||
|
KNOWN BUGS
|
||||||
|
----------
|
||||||
|
|
||||||
|
The handling of html and man pages in doc/Makefile.am is
|
||||||
|
flawed. It will not pass "make distcheck".
|
||||||
|
|
|
@ -0,0 +1,504 @@
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 2.1, February 1999
|
||||||
|
|
||||||
|
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||||
|
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
[This is the first released version of the Lesser GPL. It also counts
|
||||||
|
as the successor of the GNU Library Public License, version 2, hence
|
||||||
|
the version number 2.1.]
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
Licenses are intended to guarantee your freedom to share and change
|
||||||
|
free software--to make sure the software is free for all its users.
|
||||||
|
|
||||||
|
This license, the Lesser General Public License, applies to some
|
||||||
|
specially designated software packages--typically libraries--of the
|
||||||
|
Free Software Foundation and other authors who decide to use it. You
|
||||||
|
can use it too, but we suggest you first think carefully about whether
|
||||||
|
this license or the ordinary General Public License is the better
|
||||||
|
strategy to use in any particular case, based on the explanations below.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom of use,
|
||||||
|
not price. Our General Public Licenses are designed to make sure that
|
||||||
|
you have the freedom to distribute copies of free software (and charge
|
||||||
|
for this service if you wish); that you receive source code or can get
|
||||||
|
it if you want it; that you can change the software and use pieces of
|
||||||
|
it in new free programs; and that you are informed that you can do
|
||||||
|
these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
distributors to deny you these rights or to ask you to surrender these
|
||||||
|
rights. These restrictions translate to certain responsibilities for
|
||||||
|
you if you distribute copies of the library or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of the library, whether gratis
|
||||||
|
or for a fee, you must give the recipients all the rights that we gave
|
||||||
|
you. You must make sure that they, too, receive or can get the source
|
||||||
|
code. If you link other code with the library, you must provide
|
||||||
|
complete object files to the recipients, so that they can relink them
|
||||||
|
with the library after making changes to the library and recompiling
|
||||||
|
it. And you must show them these terms so they know their rights.
|
||||||
|
|
||||||
|
We protect your rights with a two-step method: (1) we copyright the
|
||||||
|
library, and (2) we offer you this license, which gives you legal
|
||||||
|
permission to copy, distribute and/or modify the library.
|
||||||
|
|
||||||
|
To protect each distributor, we want to make it very clear that
|
||||||
|
there is no warranty for the free library. Also, if the library is
|
||||||
|
modified by someone else and passed on, the recipients should know
|
||||||
|
that what they have is not the original version, so that the original
|
||||||
|
author's reputation will not be affected by problems that might be
|
||||||
|
introduced by others.
|
||||||
|
|
||||||
|
Finally, software patents pose a constant threat to the existence of
|
||||||
|
any free program. We wish to make sure that a company cannot
|
||||||
|
effectively restrict the users of a free program by obtaining a
|
||||||
|
restrictive license from a patent holder. Therefore, we insist that
|
||||||
|
any patent license obtained for a version of the library must be
|
||||||
|
consistent with the full freedom of use specified in this license.
|
||||||
|
|
||||||
|
Most GNU software, including some libraries, is covered by the
|
||||||
|
ordinary GNU General Public License. This license, the GNU Lesser
|
||||||
|
General Public License, applies to certain designated libraries, and
|
||||||
|
is quite different from the ordinary General Public License. We use
|
||||||
|
this license for certain libraries in order to permit linking those
|
||||||
|
libraries into non-free programs.
|
||||||
|
|
||||||
|
When a program is linked with a library, whether statically or using
|
||||||
|
a shared library, the combination of the two is legally speaking a
|
||||||
|
combined work, a derivative of the original library. The ordinary
|
||||||
|
General Public License therefore permits such linking only if the
|
||||||
|
entire combination fits its criteria of freedom. The Lesser General
|
||||||
|
Public License permits more lax criteria for linking other code with
|
||||||
|
the library.
|
||||||
|
|
||||||
|
We call this license the "Lesser" General Public License because it
|
||||||
|
does Less to protect the user's freedom than the ordinary General
|
||||||
|
Public License. It also provides other free software developers Less
|
||||||
|
of an advantage over competing non-free programs. These disadvantages
|
||||||
|
are the reason we use the ordinary General Public License for many
|
||||||
|
libraries. However, the Lesser license provides advantages in certain
|
||||||
|
special circumstances.
|
||||||
|
|
||||||
|
For example, on rare occasions, there may be a special need to
|
||||||
|
encourage the widest possible use of a certain library, so that it becomes
|
||||||
|
a de-facto standard. To achieve this, non-free programs must be
|
||||||
|
allowed to use the library. A more frequent case is that a free
|
||||||
|
library does the same job as widely used non-free libraries. In this
|
||||||
|
case, there is little to gain by limiting the free library to free
|
||||||
|
software only, so we use the Lesser General Public License.
|
||||||
|
|
||||||
|
In other cases, permission to use a particular library in non-free
|
||||||
|
programs enables a greater number of people to use a large body of
|
||||||
|
free software. For example, permission to use the GNU C Library in
|
||||||
|
non-free programs enables many more people to use the whole GNU
|
||||||
|
operating system, as well as its variant, the GNU/Linux operating
|
||||||
|
system.
|
||||||
|
|
||||||
|
Although the Lesser General Public License is Less protective of the
|
||||||
|
users' freedom, it does ensure that the user of a program that is
|
||||||
|
linked with the Library has the freedom and the wherewithal to run
|
||||||
|
that program using a modified version of the Library.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow. Pay close attention to the difference between a
|
||||||
|
"work based on the library" and a "work that uses the library". The
|
||||||
|
former contains code derived from the library, whereas the latter must
|
||||||
|
be combined with the library in order to run.
|
||||||
|
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License Agreement applies to any software library or other
|
||||||
|
program which contains a notice placed by the copyright holder or
|
||||||
|
other authorized party saying it may be distributed under the terms of
|
||||||
|
this Lesser General Public License (also called "this License").
|
||||||
|
Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
A "library" means a collection of software functions and/or data
|
||||||
|
prepared so as to be conveniently linked with application programs
|
||||||
|
(which use some of those functions and data) to form executables.
|
||||||
|
|
||||||
|
The "Library", below, refers to any such software library or work
|
||||||
|
which has been distributed under these terms. A "work based on the
|
||||||
|
Library" means either the Library or any derivative work under
|
||||||
|
copyright law: that is to say, a work containing the Library or a
|
||||||
|
portion of it, either verbatim or with modifications and/or translated
|
||||||
|
straightforwardly into another language. (Hereinafter, translation is
|
||||||
|
included without limitation in the term "modification".)
|
||||||
|
|
||||||
|
"Source code" for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For a library, complete source code means
|
||||||
|
all the source code for all modules it contains, plus any associated
|
||||||
|
interface definition files, plus the scripts used to control compilation
|
||||||
|
and installation of the library.
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running a program using the Library is not restricted, and output from
|
||||||
|
such a program is covered only if its contents constitute a work based
|
||||||
|
on the Library (independent of the use of the Library in a tool for
|
||||||
|
writing it). Whether that is true depends on what the Library does
|
||||||
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
|
complete source code as you receive it, in any medium, provided that
|
||||||
|
you conspicuously and appropriately publish on each copy an
|
||||||
|
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||||
|
all the notices that refer to this License and to the absence of any
|
||||||
|
warranty; and distribute a copy of this License along with the
|
||||||
|
Library.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy,
|
||||||
|
and you may at your option offer warranty protection in exchange for a
|
||||||
|
fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Library or any portion
|
||||||
|
of it, thus forming a work based on the Library, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The modified work must itself be a software library.
|
||||||
|
|
||||||
|
b) You must cause the files modified to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
c) You must cause the whole of the work to be licensed at no
|
||||||
|
charge to all third parties under the terms of this License.
|
||||||
|
|
||||||
|
d) If a facility in the modified Library refers to a function or a
|
||||||
|
table of data to be supplied by an application program that uses
|
||||||
|
the facility, other than as an argument passed when the facility
|
||||||
|
is invoked, then you must make a good faith effort to ensure that,
|
||||||
|
in the event an application does not supply such function or
|
||||||
|
table, the facility still operates, and performs whatever part of
|
||||||
|
its purpose remains meaningful.
|
||||||
|
|
||||||
|
(For example, a function in a library to compute square roots has
|
||||||
|
a purpose that is entirely well-defined independent of the
|
||||||
|
application. Therefore, Subsection 2d requires that any
|
||||||
|
application-supplied function or table used by this function must
|
||||||
|
be optional: if the application does not supply it, the square
|
||||||
|
root function must still compute square roots.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Library,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Library, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote
|
||||||
|
it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Library.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Library
|
||||||
|
with the Library (or with a work based on the Library) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||||
|
License instead of this License to a given copy of the Library. To do
|
||||||
|
this, you must alter all the notices that refer to this License, so
|
||||||
|
that they refer to the ordinary GNU General Public License, version 2,
|
||||||
|
instead of to this License. (If a newer version than version 2 of the
|
||||||
|
ordinary GNU General Public License has appeared, then you can specify
|
||||||
|
that version instead if you wish.) Do not make any other change in
|
||||||
|
these notices.
|
||||||
|
|
||||||
|
Once this change is made in a given copy, it is irreversible for
|
||||||
|
that copy, so the ordinary GNU General Public License applies to all
|
||||||
|
subsequent copies and derivative works made from that copy.
|
||||||
|
|
||||||
|
This option is useful when you wish to copy part of the code of
|
||||||
|
the Library into a program that is not a library.
|
||||||
|
|
||||||
|
4. You may copy and distribute the Library (or a portion or
|
||||||
|
derivative of it, under Section 2) in object code or executable form
|
||||||
|
under the terms of Sections 1 and 2 above provided that you accompany
|
||||||
|
it with the complete corresponding machine-readable source code, which
|
||||||
|
must be distributed under the terms of Sections 1 and 2 above on a
|
||||||
|
medium customarily used for software interchange.
|
||||||
|
|
||||||
|
If distribution of object code is made by offering access to copy
|
||||||
|
from a designated place, then offering equivalent access to copy the
|
||||||
|
source code from the same place satisfies the requirement to
|
||||||
|
distribute the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
5. A program that contains no derivative of any portion of the
|
||||||
|
Library, but is designed to work with the Library by being compiled or
|
||||||
|
linked with it, is called a "work that uses the Library". Such a
|
||||||
|
work, in isolation, is not a derivative work of the Library, and
|
||||||
|
therefore falls outside the scope of this License.
|
||||||
|
|
||||||
|
However, linking a "work that uses the Library" with the Library
|
||||||
|
creates an executable that is a derivative of the Library (because it
|
||||||
|
contains portions of the Library), rather than a "work that uses the
|
||||||
|
library". The executable is therefore covered by this License.
|
||||||
|
Section 6 states terms for distribution of such executables.
|
||||||
|
|
||||||
|
When a "work that uses the Library" uses material from a header file
|
||||||
|
that is part of the Library, the object code for the work may be a
|
||||||
|
derivative work of the Library even though the source code is not.
|
||||||
|
Whether this is true is especially significant if the work can be
|
||||||
|
linked without the Library, or if the work is itself a library. The
|
||||||
|
threshold for this to be true is not precisely defined by law.
|
||||||
|
|
||||||
|
If such an object file uses only numerical parameters, data
|
||||||
|
structure layouts and accessors, and small macros and small inline
|
||||||
|
functions (ten lines or less in length), then the use of the object
|
||||||
|
file is unrestricted, regardless of whether it is legally a derivative
|
||||||
|
work. (Executables containing this object code plus portions of the
|
||||||
|
Library will still fall under Section 6.)
|
||||||
|
|
||||||
|
Otherwise, if the work is a derivative of the Library, you may
|
||||||
|
distribute the object code for the work under the terms of Section 6.
|
||||||
|
Any executables containing that work also fall under Section 6,
|
||||||
|
whether or not they are linked directly with the Library itself.
|
||||||
|
|
||||||
|
6. As an exception to the Sections above, you may also combine or
|
||||||
|
link a "work that uses the Library" with the Library to produce a
|
||||||
|
work containing portions of the Library, and distribute that work
|
||||||
|
under terms of your choice, provided that the terms permit
|
||||||
|
modification of the work for the customer's own use and reverse
|
||||||
|
engineering for debugging such modifications.
|
||||||
|
|
||||||
|
You must give prominent notice with each copy of the work that the
|
||||||
|
Library is used in it and that the Library and its use are covered by
|
||||||
|
this License. You must supply a copy of this License. If the work
|
||||||
|
during execution displays copyright notices, you must include the
|
||||||
|
copyright notice for the Library among them, as well as a reference
|
||||||
|
directing the user to the copy of this License. Also, you must do one
|
||||||
|
of these things:
|
||||||
|
|
||||||
|
a) Accompany the work with the complete corresponding
|
||||||
|
machine-readable source code for the Library including whatever
|
||||||
|
changes were used in the work (which must be distributed under
|
||||||
|
Sections 1 and 2 above); and, if the work is an executable linked
|
||||||
|
with the Library, with the complete machine-readable "work that
|
||||||
|
uses the Library", as object code and/or source code, so that the
|
||||||
|
user can modify the Library and then relink to produce a modified
|
||||||
|
executable containing the modified Library. (It is understood
|
||||||
|
that the user who changes the contents of definitions files in the
|
||||||
|
Library will not necessarily be able to recompile the application
|
||||||
|
to use the modified definitions.)
|
||||||
|
|
||||||
|
b) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (1) uses at run time a
|
||||||
|
copy of the library already present on the user's computer system,
|
||||||
|
rather than copying library functions into the executable, and (2)
|
||||||
|
will operate properly with a modified version of the library, if
|
||||||
|
the user installs one, as long as the modified version is
|
||||||
|
interface-compatible with the version that the work was made with.
|
||||||
|
|
||||||
|
c) Accompany the work with a written offer, valid for at
|
||||||
|
least three years, to give the same user the materials
|
||||||
|
specified in Subsection 6a, above, for a charge no more
|
||||||
|
than the cost of performing this distribution.
|
||||||
|
|
||||||
|
d) If distribution of the work is made by offering access to copy
|
||||||
|
from a designated place, offer equivalent access to copy the above
|
||||||
|
specified materials from the same place.
|
||||||
|
|
||||||
|
e) Verify that the user has already received a copy of these
|
||||||
|
materials or that you have already sent this user a copy.
|
||||||
|
|
||||||
|
For an executable, the required form of the "work that uses the
|
||||||
|
Library" must include any data and utility programs needed for
|
||||||
|
reproducing the executable from it. However, as a special exception,
|
||||||
|
the materials to be distributed need not include anything that is
|
||||||
|
normally distributed (in either source or binary form) with the major
|
||||||
|
components (compiler, kernel, and so on) of the operating system on
|
||||||
|
which the executable runs, unless that component itself accompanies
|
||||||
|
the executable.
|
||||||
|
|
||||||
|
It may happen that this requirement contradicts the license
|
||||||
|
restrictions of other proprietary libraries that do not normally
|
||||||
|
accompany the operating system. Such a contradiction means you cannot
|
||||||
|
use both them and the Library together in an executable that you
|
||||||
|
distribute.
|
||||||
|
|
||||||
|
7. You may place library facilities that are a work based on the
|
||||||
|
Library side-by-side in a single library together with other library
|
||||||
|
facilities not covered by this License, and distribute such a combined
|
||||||
|
library, provided that the separate distribution of the work based on
|
||||||
|
the Library and of the other library facilities is otherwise
|
||||||
|
permitted, and provided that you do these two things:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work
|
||||||
|
based on the Library, uncombined with any other library
|
||||||
|
facilities. This must be distributed under the terms of the
|
||||||
|
Sections above.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library of the fact
|
||||||
|
that part of it is a work based on the Library, and explaining
|
||||||
|
where to find the accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
8. You may not copy, modify, sublicense, link with, or distribute
|
||||||
|
the Library except as expressly provided under this License. Any
|
||||||
|
attempt otherwise to copy, modify, sublicense, link with, or
|
||||||
|
distribute the Library is void, and will automatically terminate your
|
||||||
|
rights under this License. However, parties who have received copies,
|
||||||
|
or rights, from you under this License will not have their licenses
|
||||||
|
terminated so long as such parties remain in full compliance.
|
||||||
|
|
||||||
|
9. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Library or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Library (or any work based on the
|
||||||
|
Library), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Library or works based on it.
|
||||||
|
|
||||||
|
10. Each time you redistribute the Library (or any work based on the
|
||||||
|
Library), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute, link with or modify the Library
|
||||||
|
subject to these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties with
|
||||||
|
this License.
|
||||||
|
|
||||||
|
11. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Library at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Library by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Library.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under any
|
||||||
|
particular circumstance, the balance of the section is intended to apply,
|
||||||
|
and the section as a whole is intended to apply in other circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
12. If the distribution and/or use of the Library is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Library under this License may add
|
||||||
|
an explicit geographical distribution limitation excluding those countries,
|
||||||
|
so that distribution is permitted only in or among countries not thus
|
||||||
|
excluded. In such case, this License incorporates the limitation as if
|
||||||
|
written in the body of this License.
|
||||||
|
|
||||||
|
13. The Free Software Foundation may publish revised and/or new
|
||||||
|
versions of the Lesser General Public License from time to time.
|
||||||
|
Such new versions will be similar in spirit to the present version,
|
||||||
|
but may differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Library
|
||||||
|
specifies a version number of this License which applies to it and
|
||||||
|
"any later version", you have the option of following the terms and
|
||||||
|
conditions either of that version or of any later version published by
|
||||||
|
the Free Software Foundation. If the Library does not specify a
|
||||||
|
license version number, you may choose any version ever published by
|
||||||
|
the Free Software Foundation.
|
||||||
|
|
||||||
|
14. If you wish to incorporate parts of the Library into other free
|
||||||
|
programs whose distribution conditions are incompatible with these,
|
||||||
|
write to the author to ask for permission. For software which is
|
||||||
|
copyrighted by the Free Software Foundation, write to the Free
|
||||||
|
Software Foundation; we sometimes make exceptions for this. Our
|
||||||
|
decision will be guided by the two goals of preserving the free status
|
||||||
|
of all derivatives of our free software and of promoting the sharing
|
||||||
|
and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||||
|
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||||
|
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||||
|
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||||
|
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||||
|
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||||
|
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||||
|
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||||
|
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||||
|
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||||
|
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||||
|
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||||
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||||
|
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||||
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Libraries
|
||||||
|
|
||||||
|
If you develop a new library, and you want it to be of the greatest
|
||||||
|
possible use to the public, we recommend making it free software that
|
||||||
|
everyone can redistribute and change. You can do so by permitting
|
||||||
|
redistribution under these terms (or, alternatively, under the terms of the
|
||||||
|
ordinary General Public License).
|
||||||
|
|
||||||
|
To apply these terms, attach the following notices to the library. It is
|
||||||
|
safest to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least the
|
||||||
|
"copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the library's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||||
|
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1990
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
That's all there is to it!
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,61 @@
|
||||||
|
CppUnit's coding guidelines for portability:
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
|
- don't explicitly declare CppUnit namespace, instead use macro
|
||||||
|
CPPUNIT_NS_BEGIN and CPPUNIT_NS_END.
|
||||||
|
|
||||||
|
- don't explicitly use 'CppUnit' to refer to class in CppUnit namespace,
|
||||||
|
instead use macro CPPUNIT_NS which expands to either 'CppUnit' or
|
||||||
|
nothing depending on the configuration.
|
||||||
|
|
||||||
|
- don't use the 'using directive', always use full qualification. For STL,
|
||||||
|
always use std::.
|
||||||
|
|
||||||
|
- don't use C++ style cast directly, instead use CppUnit's cast macro
|
||||||
|
(CPPUNIT_CONST_CAST).
|
||||||
|
|
||||||
|
- don't use the mutable keyword, instead do a const cast.
|
||||||
|
|
||||||
|
- don't use the typename keyword in template declaration, instead use 'class'.
|
||||||
|
|
||||||
|
- don't make use of RTTI (typeid) or dynamic_cast mandatory.
|
||||||
|
|
||||||
|
- don't use STL container directly, instead use CppUnit's wrapper located
|
||||||
|
in include/cppunit/portability. This help support compilers that don't
|
||||||
|
support default template parameter and require an allocator to be
|
||||||
|
specified.
|
||||||
|
|
||||||
|
- don't use default template parameters. If needed, use STLPort wrapper
|
||||||
|
technic (see include/cppunit/portability/).
|
||||||
|
|
||||||
|
- don't use templatized member functions (template method declared inside a
|
||||||
|
class), instead declares them as simple template functions (even
|
||||||
|
mainstream compiler such as VC++ 6 as trouble with them).
|
||||||
|
|
||||||
|
- don't use default parameter value in template function. Not supported
|
||||||
|
by all compiler (on OS/390 for instance).
|
||||||
|
|
||||||
|
- don't use STL container at() method, instead use the array accessor [].
|
||||||
|
at() is not supported on some gcc versions.
|
||||||
|
|
||||||
|
- dereferencing containers must be done by (*ref_ptr).data instead of
|
||||||
|
ref_ptr->data.
|
||||||
|
|
||||||
|
In brief, it should be possible to compile CppUnit on a C++ compiler that do
|
||||||
|
not have the following features:
|
||||||
|
- C++ style cast
|
||||||
|
- mutable and typename keyword
|
||||||
|
- RTTI
|
||||||
|
- template default parameters
|
||||||
|
- templatized member functions (that is a template function declared within a
|
||||||
|
class).
|
||||||
|
- namespace
|
||||||
|
|
||||||
|
As such, usage of those features should always be optional.
|
||||||
|
|
||||||
|
Following those guidelines should allow to compile on most compilers, as long
|
||||||
|
as STL are available (in std namespace or not), with some form of strstream and
|
||||||
|
iostream, as well as exception support.
|
||||||
|
|
||||||
|
--
|
||||||
|
Baptiste Lepilleur <gaiacrtn@free.fr>
|
|
@ -0,0 +1,226 @@
|
||||||
|
Basic Installation
|
||||||
|
==================
|
||||||
|
|
||||||
|
These are generic installation instructions.
|
||||||
|
|
||||||
|
The `configure' shell script attempts to guess correct values for
|
||||||
|
various system-dependent variables used during compilation. It uses
|
||||||
|
those values to create a `Makefile' in each directory of the package.
|
||||||
|
It may also create one or more `.h' files containing system-dependent
|
||||||
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
|
you can run in the future to recreate the current configuration, and a
|
||||||
|
file `config.log' containing compiler output (useful mainly for
|
||||||
|
debugging `configure').
|
||||||
|
|
||||||
|
It can also use an optional file (typically called `config.cache'
|
||||||
|
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||||
|
the results of its tests to speed up reconfiguring. (Caching is
|
||||||
|
disabled by default to prevent problems with accidental use of stale
|
||||||
|
cache files.)
|
||||||
|
|
||||||
|
If you need to do unusual things to compile the package, please try
|
||||||
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
|
diffs or instructions to the address given in the `README' so they can
|
||||||
|
be considered for the next release. If you are using the cache, and at
|
||||||
|
some point `config.cache' contains results you don't want to keep, you
|
||||||
|
may remove or edit it.
|
||||||
|
|
||||||
|
The file `configure.ac' (or `configure.in') is used to create
|
||||||
|
`configure' by a program called `autoconf'. You only need
|
||||||
|
`configure.ac' if you want to change it or regenerate `configure' using
|
||||||
|
a newer version of `autoconf'.
|
||||||
|
|
||||||
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
|
1. `cd' to the directory containing the package's source code and type
|
||||||
|
`./configure' to configure the package for your system. If you're
|
||||||
|
using `csh' on an old version of System V, you might need to type
|
||||||
|
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||||
|
`configure' itself.
|
||||||
|
|
||||||
|
Running `configure' takes awhile. While running, it prints some
|
||||||
|
messages telling which features it is checking for.
|
||||||
|
|
||||||
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
|
3. Optionally, type `make check' to run any self-tests that come with
|
||||||
|
the package.
|
||||||
|
|
||||||
|
4. Type `make install' to install the programs and any data files and
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
5. You can remove the program binaries and object files from the
|
||||||
|
source code directory by typing `make clean'. To also remove the
|
||||||
|
files that `configure' created (so you can compile the package for
|
||||||
|
a different kind of computer), type `make distclean'. There is
|
||||||
|
also a `make maintainer-clean' target, but that is intended mainly
|
||||||
|
for the package's developers. If you use it, you may have to get
|
||||||
|
all sorts of other programs in order to regenerate files that came
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
Compilers and Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Some systems require unusual options for compilation or linking that
|
||||||
|
the `configure' script does not know about. Run `./configure --help'
|
||||||
|
for details on some of the pertinent environment variables.
|
||||||
|
|
||||||
|
You can give `configure' initial values for variables by setting
|
||||||
|
them in the environment. You can do that on the command line like this:
|
||||||
|
|
||||||
|
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||||
|
|
||||||
|
*Note Environment Variables::, for more details.
|
||||||
|
|
||||||
|
Compiling For Multiple Architectures
|
||||||
|
====================================
|
||||||
|
|
||||||
|
You can compile the package for more than one kind of computer at the
|
||||||
|
same time, by placing the object files for each architecture in their
|
||||||
|
own directory. To do this, you must use a version of `make' that
|
||||||
|
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||||
|
directory where you want the object files and executables to go and run
|
||||||
|
the `configure' script. `configure' automatically checks for the
|
||||||
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
|
If you have to use a `make' that does not support the `VPATH'
|
||||||
|
variable, you have to compile the package for one architecture at a time
|
||||||
|
in the source code directory. After you have installed the package for
|
||||||
|
one architecture, use `make distclean' before reconfiguring for another
|
||||||
|
architecture.
|
||||||
|
|
||||||
|
Installation Names
|
||||||
|
==================
|
||||||
|
|
||||||
|
By default, `make install' will install the package's files in
|
||||||
|
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||||
|
installation prefix other than `/usr/local' by giving `configure' the
|
||||||
|
option `--prefix=PATH'.
|
||||||
|
|
||||||
|
You can specify separate installation prefixes for
|
||||||
|
architecture-specific files and architecture-independent files. If you
|
||||||
|
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||||
|
PATH as the prefix for installing programs and libraries.
|
||||||
|
Documentation and other data files will still use the regular prefix.
|
||||||
|
|
||||||
|
In addition, if you use an unusual directory layout you can give
|
||||||
|
options like `--bindir=PATH' to specify different values for particular
|
||||||
|
kinds of files. Run `configure --help' for a list of the directories
|
||||||
|
you can set and what kinds of files go in them.
|
||||||
|
|
||||||
|
If the package supports it, you can cause programs to be installed
|
||||||
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
|
Optional Features
|
||||||
|
=================
|
||||||
|
|
||||||
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
|
package recognizes.
|
||||||
|
|
||||||
|
For packages that use the X Window System, `configure' can usually
|
||||||
|
find the X include and library files automatically, but if it doesn't,
|
||||||
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
|
Specifying the System Type
|
||||||
|
==========================
|
||||||
|
|
||||||
|
There may be some features `configure' cannot figure out
|
||||||
|
automatically, but needs to determine by the type of host the package
|
||||||
|
will run on. Usually `configure' can figure that out, but if it prints
|
||||||
|
a message saying it cannot guess the host type, give it the
|
||||||
|
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||||
|
type, such as `sun4', or a canonical name which has the form:
|
||||||
|
|
||||||
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
|
where SYSTEM can have one of these forms:
|
||||||
|
|
||||||
|
OS
|
||||||
|
KERNEL-OS
|
||||||
|
|
||||||
|
See the file `config.sub' for the possible values of each field. If
|
||||||
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
|
need to know the host type.
|
||||||
|
|
||||||
|
If you are _building_ compiler tools for cross-compiling, you should
|
||||||
|
use the `--target=TYPE' option to select the type of system they will
|
||||||
|
produce code for.
|
||||||
|
|
||||||
|
If you want to _use_ a cross compiler, that generates code for a
|
||||||
|
platform different from the build platform, you should specify the host
|
||||||
|
platform (i.e., that on which the generated programs will eventually be
|
||||||
|
run) with `--host=TYPE'. In this case, you should also specify the
|
||||||
|
build platform with `--build=TYPE', because, in this case, it may not
|
||||||
|
be possible to guess the build platform (it sometimes involves
|
||||||
|
compiling and running simple test programs, and this can't be done if
|
||||||
|
the compiler is a cross compiler).
|
||||||
|
|
||||||
|
Sharing Defaults
|
||||||
|
================
|
||||||
|
|
||||||
|
If you want to set default values for `configure' scripts to share,
|
||||||
|
you can create a site shell script called `config.site' that gives
|
||||||
|
default values for variables like `CC', `cache_file', and `prefix'.
|
||||||
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
|
Environment Variables
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Variables not defined in a site shell script can be set in the
|
||||||
|
environment passed to configure. However, some packages may run
|
||||||
|
configure again during the build, and the customized values of these
|
||||||
|
variables may be lost. In order to avoid this problem, you should set
|
||||||
|
them in the `configure' command line, using `VAR=value'. For example:
|
||||||
|
|
||||||
|
./configure CC=/usr/local2/bin/gcc
|
||||||
|
|
||||||
|
will cause the specified gcc to be used as the C compiler (unless it is
|
||||||
|
overridden in the site shell script).
|
||||||
|
|
||||||
|
`configure' Invocation
|
||||||
|
======================
|
||||||
|
|
||||||
|
`configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
|
`--help'
|
||||||
|
`-h'
|
||||||
|
Print a summary of the options to `configure', and exit.
|
||||||
|
|
||||||
|
`--version'
|
||||||
|
`-V'
|
||||||
|
Print the version of Autoconf used to generate the `configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
|
`--cache-file=FILE'
|
||||||
|
Enable the cache: use and save the results of the tests in FILE,
|
||||||
|
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||||
|
disable caching.
|
||||||
|
|
||||||
|
`--config-cache'
|
||||||
|
`-C'
|
||||||
|
Alias for `--cache-file=config.cache'.
|
||||||
|
|
||||||
|
`--quiet'
|
||||||
|
`--silent'
|
||||||
|
`-q'
|
||||||
|
Do not print messages saying which checks are being made. To
|
||||||
|
suppress all normal output, redirect it to `/dev/null' (any error
|
||||||
|
messages will still be shown).
|
||||||
|
|
||||||
|
`--srcdir=DIR'
|
||||||
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options. Run
|
||||||
|
`configure --help' for more details.
|
||||||
|
|
|
@ -0,0 +1,205 @@
|
||||||
|
Frequently Asked Questions: See doc/FAQ
|
||||||
|
|
||||||
|
|
||||||
|
At the current time, the only supported WIN32 platform is
|
||||||
|
Microsoft Visual C++. You must have VC++ 6.0 at least.
|
||||||
|
|
||||||
|
Quick Steps to compile & run a sample using the GUI TestRunner:
|
||||||
|
- Open examples/examples.dsw in VC++ (contains all the samples).
|
||||||
|
VC7 will ask you if you want to convert, anwser 'yes to all'.
|
||||||
|
- Make HostApp the Active project
|
||||||
|
- Compile
|
||||||
|
- For Visual Studio 6 only:
|
||||||
|
- in VC++, Tools/Customize.../Add-ins and macro files/Browse...
|
||||||
|
- select the file lib/TestRunnerDSPlugIn.dll and press ok to register
|
||||||
|
the add-ins (double-click on failure = open file in VC++).
|
||||||
|
- Run the project
|
||||||
|
|
||||||
|
|
||||||
|
Project build Target:
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Framework & tools:
|
||||||
|
|
||||||
|
* cppunit (cppunit.lib) : unit testing framework library, the one you use
|
||||||
|
to write unit tests.
|
||||||
|
|
||||||
|
* cppunit_dll(cppunit_dll.dll/lib) : same as above, but build as a DLL.
|
||||||
|
|
||||||
|
* DllPlugInTester(DllPlugInTester.exe) : test plug-in runner executable.
|
||||||
|
Use this to test DLL in your post-build step, or debug them.
|
||||||
|
|
||||||
|
* TestRunner (testrunner.dll) : a MFC extension DLL to run and browser unit
|
||||||
|
tests from a GUI.
|
||||||
|
|
||||||
|
* DSPlugIn (lib/TestRunnerDSPlugIn.dll) : a VC++ 6.0 add-in used by
|
||||||
|
testrunner.dll. If you double-click on a failure in the MFC TestRunner,
|
||||||
|
a running instance of VC++ will open the file and highlight the line.
|
||||||
|
This add-ins is not required for Visual Studio 7.
|
||||||
|
|
||||||
|
* TestPlugInRunner : (Warning: experimental) a VC++
|
||||||
|
application to run test plug-in. A test plug-in is a DLL that publish a
|
||||||
|
specified interface. This application is still incomplete (the auto-reload
|
||||||
|
feature is missing).
|
||||||
|
|
||||||
|
All libraries are placed in the lib/ directory.
|
||||||
|
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
---------
|
||||||
|
|
||||||
|
* CppUnitTestMain : the actual test suite use to test CppUnit. Use a
|
||||||
|
TextTestRunner, and post-build testing with CompilterOutputter. Configuration
|
||||||
|
to link against cppunit static library and cppunit dll library.
|
||||||
|
|
||||||
|
* CppUnitTestApp : contains the same test suite as CppUnitTestMain, but
|
||||||
|
run them using the MFC TestRunner.
|
||||||
|
|
||||||
|
* hierarchy : a sample demonstrating how to sublcass test (you might rather
|
||||||
|
want to use HelperMacros.h and the CPPUNIT_TEST_SUB_SUITE macro which does
|
||||||
|
it in a 'cleaner' way. That sample has not been updated for a long time).
|
||||||
|
|
||||||
|
* HostApp : a sample using the MFC TestRunner demonstrating different test
|
||||||
|
failure. Also demonstrates the MFC Unicode TestRunner.
|
||||||
|
|
||||||
|
* Money : an example that come along with the Money article of the
|
||||||
|
documentation. Probably what you want to look at if you are a newbie.
|
||||||
|
|
||||||
|
|
||||||
|
Configuration:
|
||||||
|
--------------
|
||||||
|
|
||||||
|
CppUnit and TestRunner comes with 3 configurations.
|
||||||
|
|
||||||
|
* Release (): Multihtreaded DLL, release mode
|
||||||
|
* Debug (d): Debug Multithreaded DLL, debug mode
|
||||||
|
* Unicode Release (u): Unicode Multihtreaded DLL, release mode
|
||||||
|
* Unicode Debug (ud): Unicode Debug Multithreaded DLL, debug mode
|
||||||
|
|
||||||
|
For CppUnit, when building as dll, "dll" is appended to the 'suffix'.
|
||||||
|
|
||||||
|
The letters enclosed in brackets indicates the suffix added to
|
||||||
|
the library name. For example, the debug configuration cppunit static library
|
||||||
|
name is cppunitd.lib. The debug configuration cppunit dll name is cppunitd_dll.lib.
|
||||||
|
|
||||||
|
|
||||||
|
Building:
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Open the src/CppUnitLibraries.dsw workspace in VC++.
|
||||||
|
* In the 'Build' menu, select 'Batch Build...'
|
||||||
|
* In the batch build dialog, select all projects and press the build button.
|
||||||
|
* The resulting libraries can be found in the lib/ directory.
|
||||||
|
|
||||||
|
|
||||||
|
Testing:
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Open the workspace examples/Examples.dsw.
|
||||||
|
* Make CppUnitTestApp the active project.
|
||||||
|
* Select the configuration you build the library for.
|
||||||
|
* Compile and run the project. The TestRunner GUI should appear.
|
||||||
|
|
||||||
|
|
||||||
|
Libraries:
|
||||||
|
----------
|
||||||
|
|
||||||
|
All the compiled libraries and DLL can be found in the 'lib' directory.
|
||||||
|
Most libraries can be build from src/CppUnitLibraries.dsw workspace.
|
||||||
|
|
||||||
|
lib\:
|
||||||
|
cppunit.lib : CppUnit static library "Multithreaded DLL"
|
||||||
|
cppunitd.lib : CppUnit static library "Debug Multithreaded DLL"
|
||||||
|
cppunit_dll.dll : CppUnit dynamic library (DLL) "Multithreaded DLL"
|
||||||
|
cppunit_dll.lib : CppUnit dynamic import library "Multithreaded DLL"
|
||||||
|
cppunitd_dll.dll : CppUnit dynamic library (DLL) "Debug Multithreaded DLL"
|
||||||
|
cppunitd_dll.lib : CppUnit dynamic import library "Debug Multithreaded DLL"
|
||||||
|
qttestrunner.dll : QT TestRunner dynamic library (DLL) "Multithreaded DLL"
|
||||||
|
qttestrunner.lib : QT TestRunner import library "Multithreaded DLL"
|
||||||
|
testrunner.dll : MFC TestRunner dynamic library (DLL) "Multithreaded DLL"
|
||||||
|
testrunner.lib : MFC TestRunner import library "Multithreaded DLL"
|
||||||
|
testrunnerd.dll : MFC TestRunner dynamic library (DLL) "Debug Multithreaded DLL"
|
||||||
|
testrunnerd.lib : MFC TestRunner import library "Debug Multithreaded DLL"
|
||||||
|
testrunneru.dll : MFC Unicode TestRunner dynamic library (DLL) "Multithreaded DLL"
|
||||||
|
testrunneru.lib : MFC Unicode TestRunner import library "Multithreaded DLL"
|
||||||
|
testrunnerud.dll : MFC Unicode TestRunner dynamic library (DLL) "Debug Multithreaded DLL"
|
||||||
|
testrunnerud.lib : MFC Unicode TestRunner import library "Debug Multithreaded DLL"
|
||||||
|
TestRunnerDSPlugIn.dll : The add-in you register in VC++.
|
||||||
|
|
||||||
|
Notes that when you are using CppUnit DLL (cppunit*_dll.dll), you must link
|
||||||
|
against the associated import library and define the pre-processor symbol
|
||||||
|
CPPUNIT_DLL in your project.
|
||||||
|
|
||||||
|
|
||||||
|
Tools:
|
||||||
|
------
|
||||||
|
|
||||||
|
CppUnit provides a generic test runner for test plug-in: DllPlugInTester.
|
||||||
|
It can be found in the lib/ directory. It requires cppunit*_dll.dll
|
||||||
|
|
||||||
|
lib/:
|
||||||
|
DllPlugInTester_dll.exe : test plug-in runner, "Multithreaded DLL", cppunit_dll.dll
|
||||||
|
DllPlugInTesterd_dll.exe : test plug-in runner, "Debug Multithreaded DLL", cppunitd_dll.dll
|
||||||
|
DllPlugInTester.exe : test plug-in runner, "Multithreaded DLL", static link cppunit.lib
|
||||||
|
DllPlugInTesterd.exe : test plug-in runner, "Debug Multithreaded DLL", static link cppunitd.lib
|
||||||
|
|
||||||
|
Notes that the DllPlugInTester(d).exe version of this tools does not allow
|
||||||
|
to use the automatic test registration that comes along with test plug-in.
|
||||||
|
You probably don't want to use them unless you really know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
Using CppUnit:
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* Writing unit tests:
|
||||||
|
To write unit tests, you need to link against cppunitXX.lib, where
|
||||||
|
XX is the chosen configuration suffix letters.
|
||||||
|
CppUnit include directory must be in the include search path.
|
||||||
|
You can do that by adding the include directory in
|
||||||
|
Project Settings/C++/Preprocessor/Additional include directories,
|
||||||
|
or Tools/Options/Directories/Include.
|
||||||
|
|
||||||
|
Quick steps:
|
||||||
|
- link lib/cppunitXX.lib
|
||||||
|
- include/ must be in the include search path
|
||||||
|
|
||||||
|
* Using the TestRunner GUI:
|
||||||
|
To use the test runner GUI you need to link against testrunnerXX.lib
|
||||||
|
and cppunitXX.lib, where XX is the chosen configuration suffix
|
||||||
|
letters. testrunner.dll must be in the path when your program is
|
||||||
|
run (the Debug/Release directory, your project dsp directory, or
|
||||||
|
in a directory specified in the PATH environment variable).
|
||||||
|
One of the easiest way to do that is to either add a post-build
|
||||||
|
command or add the testrunner.dll which is in the lib/ directory
|
||||||
|
to your project and define a custom build step that copy the
|
||||||
|
dll to your "Intermediate" directory (Debug or Release usually).
|
||||||
|
|
||||||
|
Since the TestRunner GUI is a MFC extension DLL, it can access
|
||||||
|
the CWinApp of the using application. Settings are stored using
|
||||||
|
the application registry key. That means that "most recently used
|
||||||
|
test" settings are different for each application.
|
||||||
|
|
||||||
|
Quick steps:
|
||||||
|
- link lib/cppunitXX.lib and lib/testrunnerXX.lib
|
||||||
|
- include/ must be in the include search path
|
||||||
|
- lib/testrunnerXX.dll must be available to run your project
|
||||||
|
|
||||||
|
* Using the DSPlugIn:
|
||||||
|
You must register the plug-in with VC++. This is done in
|
||||||
|
Tools/Customize/Add-ins and Macro files, selecting browse and
|
||||||
|
selecting lib/TestRunnerDSPlugIn.dll (you can register the release
|
||||||
|
or the debug version, both work).
|
||||||
|
|
||||||
|
If an instance of VC++ is running and you double-click on a failure,
|
||||||
|
VC++ will open the file and select the failure line.
|
||||||
|
|
||||||
|
* Using the Test Plug In Runner:
|
||||||
|
Your DLL must export a function that implement the interface
|
||||||
|
defined in include/msvc6/testrunner/TestPlugInInterface.h.
|
||||||
|
See examples/msvc6/TestPlugIn/TestPlugInInterfaceImpl.* for an example.
|
||||||
|
Be warned, that runner is still experimental and have not been tested
|
||||||
|
much.
|
||||||
|
|
||||||
|
If you did a batch build, run TestPlugInRunnerd.exe and choose dll
|
||||||
|
examples/cppunittest/DebugPlugIn/CppUnitTestPlugInd.dll, or
|
||||||
|
examples/simple/DebugPlugIn/simple_plugind.dll to test it out.
|
|
@ -0,0 +1,121 @@
|
||||||
|
See the file INSTALL for basic instructions. A short explanation for
|
||||||
|
each non-standard configure option follows.
|
||||||
|
|
||||||
|
--disable-typeinfo-name
|
||||||
|
|
||||||
|
Some output from the library will use a class name to distinguish
|
||||||
|
between tests. Normally, the Run-Time Type Information (RTTI) system
|
||||||
|
is used (specifically, the type_info::name() function) to generate the
|
||||||
|
name. Some compilers return human-readable names via this interface.
|
||||||
|
Other compilers do not.
|
||||||
|
|
||||||
|
If your compiler does not generate a pleasing class name, specify
|
||||||
|
this option; the names will be generated by other means. The names
|
||||||
|
are used only for diagnostic purposes -- no functionality will be
|
||||||
|
lost nor gained by using this option.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
System Notes
|
||||||
|
------------
|
||||||
|
|
||||||
|
cygwin
|
||||||
|
------
|
||||||
|
|
||||||
|
We have a number of reports that the shared library fails to
|
||||||
|
build properly. This may manifest itself as a failure to
|
||||||
|
build and run the test suite ("make check").
|
||||||
|
|
||||||
|
The workaround is to build a static library only. Configure using
|
||||||
|
|
||||||
|
./configure --disable-shared
|
||||||
|
|
||||||
|
Then build normally.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEC alpha with cxx V6.1-029 and RogueWave STL
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
A user reports that you have to issue the command
|
||||||
|
|
||||||
|
export DEC_CXX="-D__USE_STD_IOSTREAM -D__STD_MS"
|
||||||
|
|
||||||
|
in order to get ostream defined in namespace std. Otherwise, the
|
||||||
|
build reports the following error.
|
||||||
|
|
||||||
|
Cannot define CppUnit::OStringStream
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If the compiler complains about 'exception', it may help to
|
||||||
|
re-run configure with
|
||||||
|
|
||||||
|
CPPFLAGS='-U_OSF_SOURCE'
|
||||||
|
|
||||||
|
on the configure line. Please let us know about your experiences
|
||||||
|
with this platform so that we can keep this information up-to-date.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IRIX 6 / MIPSpro compiler
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
The MIPSpro compiler requires the "-LANG:std" flag to enable the
|
||||||
|
standard C++ library. You must set the CC variable when you configure,
|
||||||
|
as follows
|
||||||
|
./configure CC='CC -LANG:std'
|
||||||
|
|
||||||
|
There is a bug in released versions of libtool prevents the -LANG flag
|
||||||
|
from being properly passed during the linking stage. To check if you
|
||||||
|
have this bug, examine the output of "grep 'no.*irix' libtool". If
|
||||||
|
you see a line like "no/*-*-irix*)" then you suffer from the bug. [A
|
||||||
|
fixed version of libtool will look like "no/*-*-irix* | /*-*-irix*)".]
|
||||||
|
|
||||||
|
If your libtool script suffers from the bug, open it in an editor,
|
||||||
|
find the first line that contains "with_gcc", and change it to
|
||||||
|
read "with_gcc=no".
|
||||||
|
|
||||||
|
The MIPSpro version 7.30 is able to compile cppunit proper, but will
|
||||||
|
fail to compile the example testsuite. I am assuming this is due
|
||||||
|
to known bugs in the compiler (7.30 is not the latest version).
|
||||||
|
The library appears to function OK. Please let us know if you find
|
||||||
|
it otherwise.
|
||||||
|
|
||||||
|
|
||||||
|
Solaris/Sun CC compiler
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Use the following configure line:
|
||||||
|
|
||||||
|
./configure CXX=CC CXXFLAGS="-pta -instances=static -mt
|
||||||
|
-xtarget=generic -g -features=no%transitions
|
||||||
|
-xildoff" LD=CC LDFLAGS=-xildoff
|
||||||
|
|
||||||
|
In Forte C++ compiler for Solaris all the linking has to go via
|
||||||
|
CC and ar, ld should not be run directly. For archive use CC -xar and
|
||||||
|
for linking and generating the .so use CC -G
|
||||||
|
|
||||||
|
Notes: CC 5.5 don't need that much flag to compile correctly. Though, I'm not
|
||||||
|
sure what are the required one.
|
||||||
|
|
||||||
|
|
||||||
|
AIX
|
||||||
|
---
|
||||||
|
|
||||||
|
./configure --disable-shared
|
||||||
|
|
||||||
|
The autogen tools don't seem to generate correctly script to handle dynamic linking.
|
||||||
|
If anyone know how to get it working, please contact us.
|
||||||
|
|
||||||
|
|
||||||
|
HP-UX
|
||||||
|
-----
|
||||||
|
Use the following options with configure to
|
||||||
|
enable the use of aCC and cc for the compilation of
|
||||||
|
CppUnit:
|
||||||
|
./configure --enable-hpuxshl CC=cc CXX=aCC CXXFLAGS="-AA"
|
||||||
|
|
||||||
|
AA sets all the necessary flags to enable namespaces,
|
||||||
|
stl v2,....
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
AUTOMAKE_OPTIONS = 1.4
|
||||||
|
ACLOCAL_AMFLAGS = -I config
|
||||||
|
|
||||||
|
SUBDIRS = src include examples doc
|
||||||
|
|
||||||
|
pkgconfigdatadir = $(libdir)/pkgconfig
|
||||||
|
|
||||||
|
pkgconfigdata_DATA = cppunit.pc
|
||||||
|
|
||||||
|
bin_SCRIPTS = cppunit-config
|
||||||
|
man_MANS = cppunit-config.1
|
||||||
|
|
||||||
|
|
||||||
|
EXTRA_DIST = BUGS INSTALL-unix INSTALL-WIN32.txt CodingGuideLines.txt \
|
||||||
|
cppunit-config.1 \
|
||||||
|
cppunit.m4 cppunit.spec.in cppunit.spec \
|
||||||
|
$(m4sources) \
|
||||||
|
contrib/msvc/CppUnit.WWTpl \
|
||||||
|
contrib/msvc/readme.txt \
|
||||||
|
contrib/msvc/AddingUnitTestMethod.dsm \
|
||||||
|
contrib/bc5/bcc-makefile.zip \
|
||||||
|
contrib/xml-xsl/tests.xml \
|
||||||
|
contrib/xml-xsl/report.xsl \
|
||||||
|
src/CppUnitLibraries.dsw \
|
||||||
|
lib/.keepme
|
||||||
|
|
||||||
|
m4sources = \
|
||||||
|
config/ac_create_prefix_config_h.m4 \
|
||||||
|
config/ac_cxx_have_sstream.m4 \
|
||||||
|
config/ac_cxx_have_strstream.m4 \
|
||||||
|
config/ax_cxx_gcc_abi_demangle.m4 \
|
||||||
|
config/ac_cxx_namespaces.m4 \
|
||||||
|
config/ac_cxx_rtti.m4 \
|
||||||
|
config/ac_cxx_string_compare_string_first.m4 \
|
||||||
|
config/bb_enable_doxygen.m4 \
|
||||||
|
config/ac_dll.m4
|
||||||
|
|
||||||
|
m4datadir = $(datadir)/aclocal
|
||||||
|
m4data_DATA = cppunit.m4
|
||||||
|
|
||||||
|
# Not sure what is creating the timestamp file.
|
||||||
|
# The so_locations file only happens on IRIX.
|
||||||
|
DISTCLEANFILES = config/stamp-h1 so_locations
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
cp -dpR $(top_srcdir)/src/msvc6 $(distdir)/src
|
||||||
|
cp -dpR $(top_srcdir)/src/qttestrunner $(distdir)/src
|
||||||
|
cp -dpR $(top_srcdir)/include/msvc6 $(distdir)/include
|
||||||
|
cp -dpR $(top_srcdir)/examples/msvc6 $(distdir)/examples
|
||||||
|
cp -dpR $(top_srcdir)/examples/qt $(distdir)/examples
|
||||||
|
test -d $(distdir)/lib || mkdir $(distdir)/lib
|
||||||
|
find $(distdir) -name CVS | xargs rm -rf
|
||||||
|
perl -pi -e 's/\n/\r\n/g' `find $(distdir) -name '*.ds?'` \
|
||||||
|
$(distdir)/contrib/msvc/* \
|
||||||
|
$(distdir)/INSTALL-WIN32.txt
|
||||||
|
|
||||||
|
.PHONY: release snapshot rpm docs doc-dist
|
||||||
|
|
||||||
|
release:
|
||||||
|
rm -rf .deps */.deps
|
||||||
|
$(MAKE) distcheck
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
$(MAKE) dist distdir=$(PACKAGE)-`date +%Y-%m-%d`
|
||||||
|
|
||||||
|
rpm: dist
|
||||||
|
rpm -ta $(PACKAGE)-$(VERSION).tar.gz
|
||||||
|
mv -f /usr/src/redhat/SRPMS/$(PACKAGE)-$(VERSION)-*.rpm .
|
||||||
|
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-$(VERSION)-*.rpm .
|
||||||
|
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-doc-$(VERSION)-*.rpm .
|
||||||
|
|
||||||
|
debian:
|
||||||
|
chmod a+x debian/rules
|
||||||
|
dpkg-buildpackage -rfakeroot -sa -us -uc -tc
|
||||||
|
|
||||||
|
doc-dist:
|
||||||
|
$(MAKE) -C doc doc-dist
|
||||||
|
mv -f doc/$(PACKAGE)-docs-$(VERSION).tar.gz .
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,872 @@
|
||||||
|
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
|
||||||
|
VPATH = @srcdir@
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
install_sh_DATA = $(install_sh) -c -m 644
|
||||||
|
install_sh_PROGRAM = $(install_sh) -c
|
||||||
|
install_sh_SCRIPT = $(install_sh) -c
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = $(program_transform_name)
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
build_triplet = @build@
|
||||||
|
host_triplet = @host@
|
||||||
|
subdir = .
|
||||||
|
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||||
|
$(srcdir)/Makefile.in $(srcdir)/cppunit-config.in \
|
||||||
|
$(srcdir)/cppunit.pc.in $(srcdir)/cppunit.spec.in \
|
||||||
|
$(top_srcdir)/config/config.h.in $(top_srcdir)/configure \
|
||||||
|
AUTHORS COPYING ChangeLog INSTALL NEWS THANKS TODO \
|
||||||
|
config/config.guess config/config.sub config/depcomp \
|
||||||
|
config/install-sh config/ltmain.sh config/missing
|
||||||
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
|
am__aclocal_m4_deps = \
|
||||||
|
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_rtti.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_string_compare_string_first.m4 \
|
||||||
|
$(top_srcdir)/config/ac_dll.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_gcc_abi_demangle.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_have_isfinite.m4 \
|
||||||
|
$(top_srcdir)/config/bb_enable_doxygen.m4 \
|
||||||
|
$(top_srcdir)/configure.in
|
||||||
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
|
$(ACLOCAL_M4)
|
||||||
|
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||||
|
configure.lineno config.status.lineno
|
||||||
|
mkinstalldirs = $(install_sh) -d
|
||||||
|
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||||
|
CONFIG_CLEAN_FILES = cppunit.pc cppunit.spec cppunit-config
|
||||||
|
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
|
||||||
|
"$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdatadir)"
|
||||||
|
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
|
||||||
|
SCRIPTS = $(bin_SCRIPTS)
|
||||||
|
SOURCES =
|
||||||
|
DIST_SOURCES =
|
||||||
|
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||||
|
html-recursive info-recursive install-data-recursive \
|
||||||
|
install-dvi-recursive install-exec-recursive \
|
||||||
|
install-html-recursive install-info-recursive \
|
||||||
|
install-pdf-recursive install-ps-recursive install-recursive \
|
||||||
|
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||||
|
ps-recursive uninstall-recursive
|
||||||
|
man1dir = $(mandir)/man1
|
||||||
|
NROFF = nroff
|
||||||
|
MANS = $(man_MANS)
|
||||||
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
|
am__vpath_adj = case $$p in \
|
||||||
|
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||||
|
*) f=$$p;; \
|
||||||
|
esac;
|
||||||
|
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||||
|
m4dataDATA_INSTALL = $(INSTALL_DATA)
|
||||||
|
pkgconfigdataDATA_INSTALL = $(INSTALL_DATA)
|
||||||
|
DATA = $(m4data_DATA) $(pkgconfigdata_DATA)
|
||||||
|
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||||
|
distclean-recursive maintainer-clean-recursive
|
||||||
|
ETAGS = etags
|
||||||
|
CTAGS = ctags
|
||||||
|
DIST_SUBDIRS = $(SUBDIRS)
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
top_distdir = $(distdir)
|
||||||
|
am__remove_distdir = \
|
||||||
|
{ test ! -d $(distdir) \
|
||||||
|
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||||
|
&& rm -fr $(distdir); }; }
|
||||||
|
DIST_ARCHIVES = $(distdir).tar.gz
|
||||||
|
GZIP_ENV = --best
|
||||||
|
distuninstallcheck_listfiles = find . -type f -print
|
||||||
|
distcleancheck_listfiles = find . -type f -print
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AR = @AR@
|
||||||
|
AS = @AS@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AWK = @AWK@
|
||||||
|
CC = @CC@
|
||||||
|
CCDEPMODE = @CCDEPMODE@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
CPP = @CPP@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_BINARY_AGE = @CPPUNIT_BINARY_AGE@
|
||||||
|
CPPUNIT_INTERFACE_AGE = @CPPUNIT_INTERFACE_AGE@
|
||||||
|
CPPUNIT_MAJOR_VERSION = @CPPUNIT_MAJOR_VERSION@
|
||||||
|
CPPUNIT_MICRO_VERSION = @CPPUNIT_MICRO_VERSION@
|
||||||
|
CPPUNIT_MINOR_VERSION = @CPPUNIT_MINOR_VERSION@
|
||||||
|
CPPUNIT_VERSION = @CPPUNIT_VERSION@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
|
CYGPATH_W = @CYGPATH_W@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
DLLTOOL = @DLLTOOL@
|
||||||
|
DOT = @DOT@
|
||||||
|
DOXYGEN = @DOXYGEN@
|
||||||
|
DSYMUTIL = @DSYMUTIL@
|
||||||
|
ECHO = @ECHO@
|
||||||
|
ECHO_C = @ECHO_C@
|
||||||
|
ECHO_N = @ECHO_N@
|
||||||
|
ECHO_T = @ECHO_T@
|
||||||
|
EGREP = @EGREP@
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
F77 = @F77@
|
||||||
|
FFLAGS = @FFLAGS@
|
||||||
|
GREP = @GREP@
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
LIBADD_DL = @LIBADD_DL@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LN_S = @LN_S@
|
||||||
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_AGE = @LT_AGE@
|
||||||
|
LT_CURRENT = @LT_CURRENT@
|
||||||
|
LT_RELEASE = @LT_RELEASE@
|
||||||
|
LT_REVISION = @LT_REVISION@
|
||||||
|
MAKEINFO = @MAKEINFO@
|
||||||
|
MKDIR_P = @MKDIR_P@
|
||||||
|
NMEDIT = @NMEDIT@
|
||||||
|
OBJDUMP = @OBJDUMP@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||||
|
PACKAGE_NAME = @PACKAGE_NAME@
|
||||||
|
PACKAGE_STRING = @PACKAGE_STRING@
|
||||||
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
SED = @SED@
|
||||||
|
SET_MAKE = @SET_MAKE@
|
||||||
|
SHELL = @SHELL@
|
||||||
|
STRIP = @STRIP@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
abs_builddir = @abs_builddir@
|
||||||
|
abs_srcdir = @abs_srcdir@
|
||||||
|
abs_top_builddir = @abs_top_builddir@
|
||||||
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
|
ac_ct_F77 = @ac_ct_F77@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__leading_dot = @am__leading_dot@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
am__tar = @am__tar@
|
||||||
|
am__untar = @am__untar@
|
||||||
|
bindir = @bindir@
|
||||||
|
build = @build@
|
||||||
|
build_alias = @build_alias@
|
||||||
|
build_cpu = @build_cpu@
|
||||||
|
build_os = @build_os@
|
||||||
|
build_vendor = @build_vendor@
|
||||||
|
builddir = @builddir@
|
||||||
|
datadir = @datadir@
|
||||||
|
datarootdir = @datarootdir@
|
||||||
|
docdir = @docdir@
|
||||||
|
dvidir = @dvidir@
|
||||||
|
enable_dot = @enable_dot@
|
||||||
|
enable_html_docs = @enable_html_docs@
|
||||||
|
enable_latex_docs = @enable_latex_docs@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
host = @host@
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_cpu = @host_cpu@
|
||||||
|
host_os = @host_os@
|
||||||
|
host_vendor = @host_vendor@
|
||||||
|
htmldir = @htmldir@
|
||||||
|
includedir = @includedir@
|
||||||
|
infodir = @infodir@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
libdir = @libdir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
localedir = @localedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
mandir = @mandir@
|
||||||
|
mkdir_p = @mkdir_p@
|
||||||
|
oldincludedir = @oldincludedir@
|
||||||
|
pdfdir = @pdfdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
program_transform_name = @program_transform_name@
|
||||||
|
psdir = @psdir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
target_alias = @target_alias@
|
||||||
|
top_builddir = @top_builddir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
AUTOMAKE_OPTIONS = 1.4
|
||||||
|
ACLOCAL_AMFLAGS = -I config
|
||||||
|
SUBDIRS = src include examples doc
|
||||||
|
pkgconfigdatadir = $(libdir)/pkgconfig
|
||||||
|
pkgconfigdata_DATA = cppunit.pc
|
||||||
|
bin_SCRIPTS = cppunit-config
|
||||||
|
man_MANS = cppunit-config.1
|
||||||
|
EXTRA_DIST = BUGS INSTALL-unix INSTALL-WIN32.txt CodingGuideLines.txt \
|
||||||
|
cppunit-config.1 \
|
||||||
|
cppunit.m4 cppunit.spec.in cppunit.spec \
|
||||||
|
$(m4sources) \
|
||||||
|
contrib/msvc/CppUnit.WWTpl \
|
||||||
|
contrib/msvc/readme.txt \
|
||||||
|
contrib/msvc/AddingUnitTestMethod.dsm \
|
||||||
|
contrib/bc5/bcc-makefile.zip \
|
||||||
|
contrib/xml-xsl/tests.xml \
|
||||||
|
contrib/xml-xsl/report.xsl \
|
||||||
|
src/CppUnitLibraries.dsw \
|
||||||
|
lib/.keepme
|
||||||
|
|
||||||
|
m4sources = \
|
||||||
|
config/ac_create_prefix_config_h.m4 \
|
||||||
|
config/ac_cxx_have_sstream.m4 \
|
||||||
|
config/ac_cxx_have_strstream.m4 \
|
||||||
|
config/ax_cxx_gcc_abi_demangle.m4 \
|
||||||
|
config/ac_cxx_namespaces.m4 \
|
||||||
|
config/ac_cxx_rtti.m4 \
|
||||||
|
config/ac_cxx_string_compare_string_first.m4 \
|
||||||
|
config/bb_enable_doxygen.m4 \
|
||||||
|
config/ac_dll.m4
|
||||||
|
|
||||||
|
m4datadir = $(datadir)/aclocal
|
||||||
|
m4data_DATA = cppunit.m4
|
||||||
|
|
||||||
|
# Not sure what is creating the timestamp file.
|
||||||
|
# The so_locations file only happens on IRIX.
|
||||||
|
DISTCLEANFILES = config/stamp-h1 so_locations
|
||||||
|
all: all-recursive
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
am--refresh:
|
||||||
|
@:
|
||||||
|
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
|
@for dep in $?; do \
|
||||||
|
case '$(am__configure_deps)' in \
|
||||||
|
*$$dep*) \
|
||||||
|
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
|
||||||
|
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||||
|
&& exit 0; \
|
||||||
|
exit 1;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||||
|
cd $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
@case '$?' in \
|
||||||
|
*config.status*) \
|
||||||
|
echo ' $(SHELL) ./config.status'; \
|
||||||
|
$(SHELL) ./config.status;; \
|
||||||
|
*) \
|
||||||
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||||
|
esac;
|
||||||
|
|
||||||
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
$(SHELL) ./config.status --recheck
|
||||||
|
|
||||||
|
$(top_srcdir)/configure: $(am__configure_deps)
|
||||||
|
cd $(srcdir) && $(AUTOCONF)
|
||||||
|
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||||
|
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||||
|
|
||||||
|
config/config.h: config/stamp-h1
|
||||||
|
@if test ! -f $@; then \
|
||||||
|
rm -f config/stamp-h1; \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; \
|
||||||
|
else :; fi
|
||||||
|
|
||||||
|
config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status
|
||||||
|
@rm -f config/stamp-h1
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status config/config.h
|
||||||
|
$(top_srcdir)/config/config.h.in: $(am__configure_deps)
|
||||||
|
cd $(top_srcdir) && $(AUTOHEADER)
|
||||||
|
rm -f config/stamp-h1
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
distclean-hdr:
|
||||||
|
-rm -f config/config.h config/stamp-h1
|
||||||
|
cppunit.pc: $(top_builddir)/config.status $(srcdir)/cppunit.pc.in
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||||
|
cppunit.spec: $(top_builddir)/config.status $(srcdir)/cppunit.spec.in
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||||
|
cppunit-config: $(top_builddir)/config.status $(srcdir)/cppunit-config.in
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||||
|
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||||
|
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||||
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
|
if test -f $$d$$p; then \
|
||||||
|
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
|
||||||
|
echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||||
|
$(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
|
||||||
|
else :; fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-binSCRIPTS:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||||
|
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
|
||||||
|
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||||
|
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
mostlyclean-libtool:
|
||||||
|
-rm -f *.lo
|
||||||
|
|
||||||
|
clean-libtool:
|
||||||
|
-rm -rf .libs _libs
|
||||||
|
|
||||||
|
distclean-libtool:
|
||||||
|
-rm -f libtool
|
||||||
|
install-man1: $(man1_MANS) $(man_MANS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
|
||||||
|
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||||
|
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||||
|
for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||||
|
else file=$$i; fi; \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
case "$$ext" in \
|
||||||
|
1*) ;; \
|
||||||
|
*) ext='1' ;; \
|
||||||
|
esac; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||||
|
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
done
|
||||||
|
uninstall-man1:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||||
|
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||||
|
for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
case "$$ext" in \
|
||||||
|
1*) ;; \
|
||||||
|
*) ext='1' ;; \
|
||||||
|
esac; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||||
|
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
done
|
||||||
|
install-m4dataDATA: $(m4data_DATA)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)"
|
||||||
|
@list='$(m4data_DATA)'; for p in $$list; do \
|
||||||
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " $(m4dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(m4datadir)/$$f'"; \
|
||||||
|
$(m4dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(m4datadir)/$$f"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-m4dataDATA:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(m4data_DATA)'; for p in $$list; do \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " rm -f '$(DESTDIR)$(m4datadir)/$$f'"; \
|
||||||
|
rm -f "$(DESTDIR)$(m4datadir)/$$f"; \
|
||||||
|
done
|
||||||
|
install-pkgconfigdataDATA: $(pkgconfigdata_DATA)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
test -z "$(pkgconfigdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdatadir)"
|
||||||
|
@list='$(pkgconfigdata_DATA)'; for p in $$list; do \
|
||||||
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " $(pkgconfigdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdatadir)/$$f'"; \
|
||||||
|
$(pkgconfigdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdatadir)/$$f"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-pkgconfigdataDATA:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(pkgconfigdata_DATA)'; for p in $$list; do \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " rm -f '$(DESTDIR)$(pkgconfigdatadir)/$$f'"; \
|
||||||
|
rm -f "$(DESTDIR)$(pkgconfigdatadir)/$$f"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
# This directory's subdirectories are mostly independent; you can cd
|
||||||
|
# into them and run `make' without going through this Makefile.
|
||||||
|
# To change the values of `make' variables: instead of editing Makefiles,
|
||||||
|
# (1) if the variable is set in `config.status', edit `config.status'
|
||||||
|
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||||
|
# (2) otherwise, pass the desired values on the `make' command line.
|
||||||
|
$(RECURSIVE_TARGETS):
|
||||||
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
dot_seen=no; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
dot_seen=yes; \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| eval $$failcom; \
|
||||||
|
done; \
|
||||||
|
if test "$$dot_seen" = "no"; then \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
|
fi; test -z "$$fail"
|
||||||
|
|
||||||
|
$(RECURSIVE_CLEAN_TARGETS):
|
||||||
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
dot_seen=no; \
|
||||||
|
case "$@" in \
|
||||||
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
|
*) list='$(SUBDIRS)' ;; \
|
||||||
|
esac; \
|
||||||
|
rev=''; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = "."; then :; else \
|
||||||
|
rev="$$subdir $$rev"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
rev="$$rev ."; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
for subdir in $$rev; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| eval $$failcom; \
|
||||||
|
done && test -z "$$fail"
|
||||||
|
tags-recursive:
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||||
|
done
|
||||||
|
ctags-recursive:
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||||
|
done
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
mkid -fID $$unique
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
tags=; \
|
||||||
|
here=`pwd`; \
|
||||||
|
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||||
|
include_option=--etags-include; \
|
||||||
|
empty_fix=.; \
|
||||||
|
else \
|
||||||
|
include_option=--include; \
|
||||||
|
empty_fix=; \
|
||||||
|
fi; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test ! -f $$subdir/TAGS || \
|
||||||
|
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||||
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||||
|
$$tags $$unique; \
|
||||||
|
fi
|
||||||
|
ctags: CTAGS
|
||||||
|
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
tags=; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||||
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
|
$$tags $$unique
|
||||||
|
|
||||||
|
GTAGS:
|
||||||
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
|
&& cd $(top_srcdir) \
|
||||||
|
&& gtags -i $(GTAGS_ARGS) $$here
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
$(am__remove_distdir)
|
||||||
|
test -d $(distdir) || mkdir $(distdir)
|
||||||
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
list='$(DISTFILES)'; \
|
||||||
|
dist_files=`for file in $$list; do echo $$file; done | \
|
||||||
|
sed -e "s|^$$srcdirstrip/||;t" \
|
||||||
|
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||||
|
case $$dist_files in \
|
||||||
|
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||||
|
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||||
|
sort -u` ;; \
|
||||||
|
esac; \
|
||||||
|
for file in $$dist_files; do \
|
||||||
|
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||||
|
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
fi; \
|
||||||
|
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
else \
|
||||||
|
test -f $(distdir)/$$file \
|
||||||
|
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test -d "$(distdir)/$$subdir" \
|
||||||
|
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||||
|
|| exit 1; \
|
||||||
|
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||||
|
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||||
|
(cd $$subdir && \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
top_distdir="$$top_distdir" \
|
||||||
|
distdir="$$distdir/$$subdir" \
|
||||||
|
am__remove_distdir=: \
|
||||||
|
am__skip_length_check=: \
|
||||||
|
distdir) \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||||
|
dist-hook
|
||||||
|
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||||
|
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||||
|
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||||
|
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||||
|
|| chmod -R a+r $(distdir)
|
||||||
|
dist-gzip: distdir
|
||||||
|
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
dist-bzip2: distdir
|
||||||
|
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
dist-lzma: distdir
|
||||||
|
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
dist-tarZ: distdir
|
||||||
|
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
dist-shar: distdir
|
||||||
|
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
dist-zip: distdir
|
||||||
|
-rm -f $(distdir).zip
|
||||||
|
zip -rq $(distdir).zip $(distdir)
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
dist dist-all: distdir
|
||||||
|
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
# This target untars the dist file and tries a VPATH configuration. Then
|
||||||
|
# it guarantees that the distribution is self-contained by making another
|
||||||
|
# tarfile.
|
||||||
|
distcheck: dist
|
||||||
|
case '$(DIST_ARCHIVES)' in \
|
||||||
|
*.tar.gz*) \
|
||||||
|
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||||
|
*.tar.bz2*) \
|
||||||
|
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||||
|
*.tar.lzma*) \
|
||||||
|
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
|
||||||
|
*.tar.Z*) \
|
||||||
|
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||||
|
*.shar.gz*) \
|
||||||
|
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||||
|
*.zip*) \
|
||||||
|
unzip $(distdir).zip ;;\
|
||||||
|
esac
|
||||||
|
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||||
|
mkdir $(distdir)/_build
|
||||||
|
mkdir $(distdir)/_inst
|
||||||
|
chmod a-w $(distdir)
|
||||||
|
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||||
|
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||||
|
&& cd $(distdir)/_build \
|
||||||
|
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||||
|
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||||
|
distuninstallcheck \
|
||||||
|
&& chmod -R a-w "$$dc_install_base" \
|
||||||
|
&& ({ \
|
||||||
|
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||||
|
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||||
|
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||||
|
&& rm -rf "$$dc_destdir" \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||||
|
&& rm -rf $(DIST_ARCHIVES) \
|
||||||
|
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||||
|
$(am__remove_distdir)
|
||||||
|
@(echo "$(distdir) archives ready for distribution: "; \
|
||||||
|
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||||
|
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||||
|
distuninstallcheck:
|
||||||
|
@cd $(distuninstallcheck_dir) \
|
||||||
|
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||||
|
|| { echo "ERROR: files left after uninstall:" ; \
|
||||||
|
if test -n "$(DESTDIR)"; then \
|
||||||
|
echo " (check DESTDIR support)"; \
|
||||||
|
fi ; \
|
||||||
|
$(distuninstallcheck_listfiles) ; \
|
||||||
|
exit 1; } >&2
|
||||||
|
distcleancheck: distclean
|
||||||
|
@if test '$(srcdir)' = . ; then \
|
||||||
|
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||||
|
exit 1 ; \
|
||||||
|
fi
|
||||||
|
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||||
|
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||||
|
$(distcleancheck_listfiles) ; \
|
||||||
|
exit 1; } >&2
|
||||||
|
check-am: all-am
|
||||||
|
check: check-recursive
|
||||||
|
all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
|
||||||
|
installdirs: installdirs-recursive
|
||||||
|
installdirs-am:
|
||||||
|
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdatadir)"; do \
|
||||||
|
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||||
|
done
|
||||||
|
install: install-recursive
|
||||||
|
install-exec: install-exec-recursive
|
||||||
|
install-data: install-data-recursive
|
||||||
|
uninstall: uninstall-recursive
|
||||||
|
|
||||||
|
install-am: all-am
|
||||||
|
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||||
|
|
||||||
|
installcheck: installcheck-recursive
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
`test -z '$(STRIP)' || \
|
||||||
|
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
@echo "This command is intended for maintainers to use"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
clean: clean-recursive
|
||||||
|
|
||||||
|
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-recursive
|
||||||
|
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||||
|
-rm -f Makefile
|
||||||
|
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||||
|
distclean-libtool distclean-tags
|
||||||
|
|
||||||
|
dvi: dvi-recursive
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
html: html-recursive
|
||||||
|
|
||||||
|
info: info-recursive
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am: install-m4dataDATA install-man \
|
||||||
|
install-pkgconfigdataDATA
|
||||||
|
|
||||||
|
install-dvi: install-dvi-recursive
|
||||||
|
|
||||||
|
install-exec-am: install-binSCRIPTS
|
||||||
|
|
||||||
|
install-html: install-html-recursive
|
||||||
|
|
||||||
|
install-info: install-info-recursive
|
||||||
|
|
||||||
|
install-man: install-man1
|
||||||
|
|
||||||
|
install-pdf: install-pdf-recursive
|
||||||
|
|
||||||
|
install-ps: install-ps-recursive
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-recursive
|
||||||
|
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||||
|
-rm -rf $(top_srcdir)/autom4te.cache
|
||||||
|
-rm -f Makefile
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-recursive
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||||
|
|
||||||
|
pdf: pdf-recursive
|
||||||
|
|
||||||
|
pdf-am:
|
||||||
|
|
||||||
|
ps: ps-recursive
|
||||||
|
|
||||||
|
ps-am:
|
||||||
|
|
||||||
|
uninstall-am: uninstall-binSCRIPTS uninstall-m4dataDATA uninstall-man \
|
||||||
|
uninstall-pkgconfigdataDATA
|
||||||
|
|
||||||
|
uninstall-man: uninstall-man1
|
||||||
|
|
||||||
|
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||||
|
install-strip
|
||||||
|
|
||||||
|
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||||
|
all all-am am--refresh check check-am clean clean-generic \
|
||||||
|
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
|
||||||
|
dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
|
||||||
|
distcheck distclean distclean-generic distclean-hdr \
|
||||||
|
distclean-libtool distclean-tags distcleancheck distdir \
|
||||||
|
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||||
|
install install-am install-binSCRIPTS install-data \
|
||||||
|
install-data-am install-dvi install-dvi-am install-exec \
|
||||||
|
install-exec-am install-html install-html-am install-info \
|
||||||
|
install-info-am install-m4dataDATA install-man install-man1 \
|
||||||
|
install-pdf install-pdf-am install-pkgconfigdataDATA \
|
||||||
|
install-ps install-ps-am install-strip installcheck \
|
||||||
|
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||||
|
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||||
|
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
|
||||||
|
uninstall uninstall-am uninstall-binSCRIPTS \
|
||||||
|
uninstall-m4dataDATA uninstall-man uninstall-man1 \
|
||||||
|
uninstall-pkgconfigdataDATA
|
||||||
|
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
cp -dpR $(top_srcdir)/src/msvc6 $(distdir)/src
|
||||||
|
cp -dpR $(top_srcdir)/src/qttestrunner $(distdir)/src
|
||||||
|
cp -dpR $(top_srcdir)/include/msvc6 $(distdir)/include
|
||||||
|
cp -dpR $(top_srcdir)/examples/msvc6 $(distdir)/examples
|
||||||
|
cp -dpR $(top_srcdir)/examples/qt $(distdir)/examples
|
||||||
|
test -d $(distdir)/lib || mkdir $(distdir)/lib
|
||||||
|
find $(distdir) -name CVS | xargs rm -rf
|
||||||
|
perl -pi -e 's/\n/\r\n/g' `find $(distdir) -name '*.ds?'` \
|
||||||
|
$(distdir)/contrib/msvc/* \
|
||||||
|
$(distdir)/INSTALL-WIN32.txt
|
||||||
|
|
||||||
|
.PHONY: release snapshot rpm docs doc-dist
|
||||||
|
|
||||||
|
release:
|
||||||
|
rm -rf .deps */.deps
|
||||||
|
$(MAKE) distcheck
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
$(MAKE) dist distdir=$(PACKAGE)-`date +%Y-%m-%d`
|
||||||
|
|
||||||
|
rpm: dist
|
||||||
|
rpm -ta $(PACKAGE)-$(VERSION).tar.gz
|
||||||
|
mv -f /usr/src/redhat/SRPMS/$(PACKAGE)-$(VERSION)-*.rpm .
|
||||||
|
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-$(VERSION)-*.rpm .
|
||||||
|
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-doc-$(VERSION)-*.rpm .
|
||||||
|
|
||||||
|
debian:
|
||||||
|
chmod a+x debian/rules
|
||||||
|
dpkg-buildpackage -rfakeroot -sa -us -uc -tc
|
||||||
|
|
||||||
|
doc-dist:
|
||||||
|
$(MAKE) -C doc doc-dist
|
||||||
|
mv -f doc/$(PACKAGE)-docs-$(VERSION).tar.gz .
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
||||||
|
CppUnit --- The C++ Unit Test Library
|
||||||
|
-------------------------------------
|
||||||
|
http://cppunit.sourceforge.net
|
||||||
|
|
||||||
|
|
||||||
|
CppUnit is the C++ port of the famous JUnit framework for unit
|
||||||
|
testing.
|
||||||
|
|
||||||
|
For MSWindows installation notes, see INSTALL-WIN32.txt.
|
||||||
|
For other systems -- including cygwin -- see INSTALL and INSTALL-unix.
|
||||||
|
|
||||||
|
|
||||||
|
Bug reports are welcome. Please use the SourceForge bug tracking
|
||||||
|
system at http://sourceforge.net/projects/cppunit/. Bugs that already
|
||||||
|
appear in the file BUGS do not need to be reported.
|
||||||
|
|
||||||
|
Email to the current maintainers may be sent to
|
||||||
|
<cppunit-devel@lists.sourceforge.net>.
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
Tim Jansen <timj@systembureau.com>
|
||||||
|
Christian Leutloff <leutloff@debian.org>
|
||||||
|
Steve M. Robbins <smr@sumost.ca>
|
||||||
|
Patrick Berny <PPBerny@web.de>
|
||||||
|
Patrick Hartling
|
||||||
|
Peer Sommerlund
|
||||||
|
Duane Murphy <duanem@users.sourceforge.net>
|
||||||
|
Gigi Sayfan <gigi@morphink.com>
|
||||||
|
Armin "bored" Michel <bored@sourceforge.net>
|
||||||
|
Jeffrey Morgan <kuzman@zoominternet.net>
|
||||||
|
'cuppa' project team (http://sourceforge.jp/projects/cuppa/)
|
||||||
|
Phil Verghese <philv@users.sourceforge.net>
|
||||||
|
Lavoie Philippe <lavoie@yukon.genie.uottawa.ca>
|
||||||
|
Pavel Zabelin
|
||||||
|
Marco Welti <Welti@GretagMacbeth.ch>
|
||||||
|
Thomas Neidhart
|
||||||
|
Hans Bühler <hans.buehler@topmail.de> (Dynamic Window library used by MFC UI)
|
||||||
|
John Sisson
|
||||||
|
Steven Mitter <smitter@iicm.tu-graz.ac.at>
|
||||||
|
Stephan Stapel <stephan.stapel@web.de>
|
||||||
|
Abdessattar Sassi <abdesassi@users.sourceforge.net> (hp-ux plug-in support)
|
||||||
|
Max Quatember and Andreas Pfaffenbichler (VC++ 7 MFC TestRunner go to source line)
|
||||||
|
Vincent Rivière
|
|
@ -0,0 +1,35 @@
|
||||||
|
* Bugs:
|
||||||
|
Asserter::makeNotEqualMessage() strip the shortDescription of the additional message.
|
||||||
|
|
||||||
|
* CppUnit:
|
||||||
|
- STL concept checker.
|
||||||
|
- Memory leak tracking: setUp/tearDown should be leak safe if no failure occured.
|
||||||
|
|
||||||
|
* UnitTest
|
||||||
|
- add tests for XmlOutputter::setStyleSheet (current assertion macro strip <?...> when
|
||||||
|
testing )
|
||||||
|
|
||||||
|
* VC++ TestRunner:
|
||||||
|
- Modify MfcUi::TestRunner to expose TestResult (which allow specific TestListener
|
||||||
|
for global initialization).
|
||||||
|
- Update MfcTestRunner to use TestPath to store test in the registry
|
||||||
|
|
||||||
|
* Documentation:
|
||||||
|
CookBook:
|
||||||
|
- how to create simple test cases (with CppUnit namespace)
|
||||||
|
- test case using only CPPUINT_ASSERT
|
||||||
|
- test case using CPPUNIT_ASSERT_EQUAL
|
||||||
|
- advanced assertions with the CPPUNIT_ASSERT_MESSAGE
|
||||||
|
- Helper Macros for convenience
|
||||||
|
- Creating a suite
|
||||||
|
- Composing a suite from more suites (i.e. compose tests for n modules to
|
||||||
|
form a big test for the whole program)
|
||||||
|
- customizing output using an user defined TestListener
|
||||||
|
- how to write the TestListener (subclass of TestListener)
|
||||||
|
- how to hook it in
|
||||||
|
- how to use the GUI
|
||||||
|
- MSVC++ special stuff
|
||||||
|
- other custmization stuff I haven't understood yet
|
||||||
|
|
||||||
|
CppUnit: architecture overview.
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,107 @@
|
||||||
|
dnl @synopsis AC_CREATE_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
|
||||||
|
dnl
|
||||||
|
dnl this is a new variant from ac_prefix_config_
|
||||||
|
dnl this one will use a lowercase-prefix if
|
||||||
|
dnl the config-define was starting with a lowercase-char, e.g.
|
||||||
|
dnl #define const or #define restrict or #define off_t
|
||||||
|
dnl (and this one can live in another directory, e.g. testpkg/config.h
|
||||||
|
dnl therefore I decided to move the output-header to be the first arg)
|
||||||
|
dnl
|
||||||
|
dnl takes the usual config.h generated header file; looks for each of
|
||||||
|
dnl the generated "#define SOMEDEF" lines, and prefixes the defined name
|
||||||
|
dnl (ie. makes it "#define PREFIX_SOMEDEF". The result is written to
|
||||||
|
dnl the output config.header file. The PREFIX is converted to uppercase
|
||||||
|
dnl for the conversions.
|
||||||
|
dnl
|
||||||
|
dnl default OUTPUT-HEADER = $PACKAGE-config.h
|
||||||
|
dnl default PREFIX = $PACKAGE
|
||||||
|
dnl default ORIG-HEADER, derived from OUTPUT-HEADER
|
||||||
|
dnl if OUTPUT-HEADER has a "/", use the basename
|
||||||
|
dnl if OUTPUT-HEADER has a "-", use the section after it.
|
||||||
|
dnl otherwise, just config.h
|
||||||
|
dnl
|
||||||
|
dnl In most cases, the configure.in will contain a line saying
|
||||||
|
dnl AC_CONFIG_HEADER(config.h)
|
||||||
|
dnl somewhere *before* AC_OUTPUT and a simple line saying
|
||||||
|
dnl AC_PREFIX_CONFIG_HEADER
|
||||||
|
dnl somewhere *after* AC_OUTPUT.
|
||||||
|
dnl
|
||||||
|
dnl example:
|
||||||
|
dnl AC_INIT(config.h.in) # config.h.in as created by "autoheader"
|
||||||
|
dnl AM_INIT_AUTOMAKE(testpkg, 0.1.1) # "#undef VERSION" and "PACKAGE"
|
||||||
|
dnl AM_CONFIG_HEADER(config.h) # in config.h.in
|
||||||
|
dnl AC_MEMORY_H # "#undef NEED_MEMORY_H"
|
||||||
|
dnl AC_C_CONST_H # "#undef const"
|
||||||
|
dnl AC_OUTPUT(Makefile) # creates the "config.h" now
|
||||||
|
dnl AC_CREATE_PREFIX_CONFIG_H # creates "testpkg-config.h"
|
||||||
|
dnl and the resulting "testpkg-config.h" contains lines like
|
||||||
|
dnl #ifndef TESTPKG_VERSION
|
||||||
|
dnl #define TESTPKG_VERSION "0.1.1"
|
||||||
|
dnl #endif
|
||||||
|
dnl #ifndef TESTPKG_NEED_MEMORY_H
|
||||||
|
dnl #define TESTPKG_NEED_MEMORY_H 1
|
||||||
|
dnl #endif
|
||||||
|
dnl #ifndef _testpkg_const
|
||||||
|
dnl #define _testpkg_const const
|
||||||
|
dnl #endif
|
||||||
|
dnl
|
||||||
|
dnl and this "testpkg-config.h" can be installed along with other
|
||||||
|
dnl header-files, which is most convenient when creating a shared
|
||||||
|
dnl library (that has some headers) where some functionality is
|
||||||
|
dnl dependent on the OS-features detected at compile-time. No
|
||||||
|
dnl need to invent some "testpkg-confdefs.h.in" manually. :-)
|
||||||
|
dnl
|
||||||
|
dnl @version $Id: ac_create_prefix_config_h.m4,v 1.1 2001/06/17 15:47:32 bastiaan Exp $
|
||||||
|
dnl @author Guido Draheim <guidod@gmx.de>
|
||||||
|
|
||||||
|
AC_DEFUN([AC_CREATE_PREFIX_CONFIG_H],
|
||||||
|
[changequote({, })dnl
|
||||||
|
ac_prefix_conf_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
|
||||||
|
ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e 'y:abcdefghijklmnopqrstuvwxyz./,-:ABCDEFGHIJKLMNOPQRSTUVWXYZ____:'`
|
||||||
|
ac_prefix_conf_PKG=`echo ifelse($2, , $PACKAGE, $2)`
|
||||||
|
ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:'`
|
||||||
|
ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:' -e '/^[0-9]/s/^/_/'`
|
||||||
|
ac_prefix_conf_INP=`echo ifelse($3, , _, $3)`
|
||||||
|
if test "$ac_prefix_conf_INP" = "_"; then
|
||||||
|
case $ac_prefix_conf_OUT in
|
||||||
|
*/*) ac_prefix_conf_INP=`basename $ac_prefix_conf_OUT`
|
||||||
|
;;
|
||||||
|
*-*) ac_prefix_conf_INP=`echo $ac_prefix_conf_OUT | sed -e 's/[a-zA-Z0-9_]*-//'`
|
||||||
|
;;
|
||||||
|
*) ac_prefix_conf_INP=config.h
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
changequote([, ])dnl
|
||||||
|
if test -z "$ac_prefix_conf_PKG" ; then
|
||||||
|
AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines)
|
||||||
|
if test -f $ac_prefix_conf_INP ; then
|
||||||
|
AS_DIRNAME([/* automatically generated */], $ac_prefix_conf_OUT)
|
||||||
|
changequote({, })dnl
|
||||||
|
echo '#ifndef '$ac_prefix_conf_DEF >$ac_prefix_conf_OUT
|
||||||
|
echo '#define '$ac_prefix_conf_DEF' 1' >>$ac_prefix_conf_OUT
|
||||||
|
echo ' ' >>$ac_prefix_conf_OUT
|
||||||
|
echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$ac_prefix_conf_OUT
|
||||||
|
|
||||||
|
echo 's/#undef *\([A-Z_]\)/#undef '$ac_prefix_conf_UPP'_\1/' >conftest.sed
|
||||||
|
echo 's/#undef *\([a-z]\)/#undef '$ac_prefix_conf_LOW'_\1/' >>conftest.sed
|
||||||
|
echo 's/#define *\([A-Z_][A-Za-z0-9_]*\)\(.*\)/#ifndef '$ac_prefix_conf_UPP"_\\1 \\" >>conftest.sed
|
||||||
|
echo '#define '$ac_prefix_conf_UPP"_\\1 \\2 \\" >>conftest.sed
|
||||||
|
echo '#endif/' >>conftest.sed
|
||||||
|
echo 's/#define *\([a-z][A-Za-z0-9_]*\)\(.*\)/#ifndef '$ac_prefix_conf_LOW"_\\1 \\" >>conftest.sed
|
||||||
|
echo '#define '$ac_prefix_conf_LOW"_\\1 \\2 \\" >>conftest.sed
|
||||||
|
echo '#endif/' >>conftest.sed
|
||||||
|
sed -f conftest.sed $ac_prefix_conf_INP >>$ac_prefix_conf_OUT
|
||||||
|
echo ' ' >>$ac_prefix_conf_OUT
|
||||||
|
echo '/*' $ac_prefix_conf_DEF '*/' >>$ac_prefix_conf_OUT
|
||||||
|
echo '#endif' >>$ac_prefix_conf_OUT
|
||||||
|
changequote([, ])dnl
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([input file $ac_prefix_conf_IN does not exist, dnl
|
||||||
|
skip generating $ac_prefix_conf_OUT])
|
||||||
|
fi
|
||||||
|
rm -f conftest.*
|
||||||
|
fi])
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
dnl @synopsis AC_CXX_HAVE_SSTREAM
|
||||||
|
dnl
|
||||||
|
dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
|
||||||
|
dnl
|
||||||
|
dnl @author Ben Stanley
|
||||||
|
dnl @version $Id: ac_cxx_have_sstream.m4,v 1.1 2001/07/07 16:05:47 smr99 Exp $
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AC_CXX_HAVE_SSTREAM],
|
||||||
|
[AC_CACHE_CHECK(whether the compiler has stringstream,
|
||||||
|
ac_cv_cxx_have_sstream,
|
||||||
|
[AC_REQUIRE([AC_CXX_NAMESPACES])
|
||||||
|
AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_TRY_COMPILE([#include <sstream>
|
||||||
|
#ifdef HAVE_NAMESPACES
|
||||||
|
using namespace std;
|
||||||
|
#endif],[stringstream message; message << "Hello"; return 0;],
|
||||||
|
ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
if test "$ac_cv_cxx_have_sstream" = yes; then
|
||||||
|
AC_DEFINE(HAVE_SSTREAM,1,[define if the compiler has stringstream])
|
||||||
|
fi
|
||||||
|
])
|
|
@ -0,0 +1,29 @@
|
||||||
|
dnl @synopsis AC_CXX_HAVE_STRSTREAM
|
||||||
|
dnl
|
||||||
|
dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM.
|
||||||
|
dnl
|
||||||
|
dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AC_CXX_HAVE_STRSTREAM],
|
||||||
|
[AC_CACHE_CHECK(whether the library defines class strstream,
|
||||||
|
ac_cv_cxx_have_class_strstream,
|
||||||
|
[AC_REQUIRE([AC_CXX_NAMESPACES])
|
||||||
|
AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_CHECK_HEADERS(strstream)
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#if HAVE_STRSTREAM
|
||||||
|
# include <strstream>
|
||||||
|
#else
|
||||||
|
# include <strstream.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NAMESPACES
|
||||||
|
using namespace std;
|
||||||
|
#endif],[ostrstream message; message << "Hello"; return 0;],
|
||||||
|
ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
if test "$ac_cv_cxx_have_class_strstream" = yes; then
|
||||||
|
AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream])
|
||||||
|
fi
|
||||||
|
])
|
|
@ -0,0 +1,22 @@
|
||||||
|
dnl @synopsis AC_CXX_NAMESPACES
|
||||||
|
dnl
|
||||||
|
dnl If the compiler can prevent names clashes using namespaces, define
|
||||||
|
dnl HAVE_NAMESPACES.
|
||||||
|
dnl
|
||||||
|
dnl @version $Id: ac_cxx_namespaces.m4,v 1.1 2001/06/02 23:26:36 smr99 Exp $
|
||||||
|
dnl @author Luc Maisonobe
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AC_CXX_NAMESPACES],
|
||||||
|
[AC_CACHE_CHECK(whether the compiler implements namespaces,
|
||||||
|
ac_cv_cxx_namespaces,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
|
||||||
|
[using namespace Outer::Inner; return i;],
|
||||||
|
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
if test "$ac_cv_cxx_namespaces" = yes; then
|
||||||
|
AC_DEFINE(HAVE_NAMESPACES,1,[define to 1 if the compiler implements namespaces])
|
||||||
|
fi
|
||||||
|
])
|
|
@ -0,0 +1,34 @@
|
||||||
|
dnl @synopsis AC_CXX_RTTI
|
||||||
|
dnl
|
||||||
|
dnl If the compiler supports Run-Time Type Identification (typeinfo
|
||||||
|
dnl header and typeid keyword), define HAVE_RTTI.
|
||||||
|
dnl
|
||||||
|
dnl @version $Id: ac_cxx_rtti.m4,v 1.1 2001/06/02 22:29:52 smr99 Exp $
|
||||||
|
dnl @author Luc Maisonobe
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AC_CXX_RTTI],
|
||||||
|
[AC_CACHE_CHECK(whether the compiler supports Run-Time Type Identification,
|
||||||
|
ac_cv_cxx_rtti,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_TRY_COMPILE([#include <typeinfo>
|
||||||
|
class Base { public :
|
||||||
|
Base () {}
|
||||||
|
virtual int f () { return 0; }
|
||||||
|
};
|
||||||
|
class Derived : public Base { public :
|
||||||
|
Derived () {}
|
||||||
|
virtual int f () { return 1; }
|
||||||
|
};
|
||||||
|
],[Derived d;
|
||||||
|
Base *ptr = &d;
|
||||||
|
return typeid (*ptr) == typeid (Derived);
|
||||||
|
],
|
||||||
|
ac_cv_cxx_rtti=yes, ac_cv_cxx_rtti=no)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
if test "$ac_cv_cxx_rtti" = yes; then
|
||||||
|
AC_DEFINE(HAVE_RTTI,1,
|
||||||
|
[define if the compiler supports Run-Time Type Identification])
|
||||||
|
fi
|
||||||
|
])
|
|
@ -0,0 +1,27 @@
|
||||||
|
dnl @synopsis AC_CXX_STRING_COMPARE_STRING_FIRST
|
||||||
|
dnl
|
||||||
|
dnl If the standard library string::compare() function takes the
|
||||||
|
dnl string as its first argument, define FUNC_STRING_COMPARE_STRING_FIRST to 1.
|
||||||
|
dnl
|
||||||
|
dnl @author Steven Robbins
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AC_CXX_STRING_COMPARE_STRING_FIRST],
|
||||||
|
[AC_CACHE_CHECK(whether std::string::compare takes a string in argument 1,
|
||||||
|
ac_cv_cxx_string_compare_string_first,
|
||||||
|
[AC_REQUIRE([AC_CXX_NAMESPACES])
|
||||||
|
AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_TRY_COMPILE([#include <string>
|
||||||
|
#ifdef HAVE_NAMESPACES
|
||||||
|
using namespace std;
|
||||||
|
#endif],[string x("hi"); string y("h");
|
||||||
|
return x.compare(y,0,1) == 0;],
|
||||||
|
ac_cv_cxx_string_compare_string_first=yes,
|
||||||
|
ac_cv_cxx_string_compare_string_first=no)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
if test "$ac_cv_cxx_string_compare_string_first" = yes; then
|
||||||
|
AC_DEFINE(FUNC_STRING_COMPARE_STRING_FIRST,1,
|
||||||
|
[define if library uses std::string::compare(string,pos,n)])
|
||||||
|
fi
|
||||||
|
])
|
|
@ -0,0 +1,47 @@
|
||||||
|
|
||||||
|
# AC_LTDL_DLLIB
|
||||||
|
# -------------
|
||||||
|
AC_DEFUN([AC_LTDL_DLLIB],
|
||||||
|
[LIBADD_DL=
|
||||||
|
AC_SUBST(LIBADD_DL)
|
||||||
|
|
||||||
|
AC_CHECK_FUNC([shl_load],
|
||||||
|
[AC_DEFINE([HAVE_SHL_LOAD], [1],
|
||||||
|
[Define if you have the shl_load function.])],
|
||||||
|
[AC_CHECK_LIB([dld], [shl_load],
|
||||||
|
[AC_DEFINE([HAVE_SHL_LOAD], [1],
|
||||||
|
[Define if you have the shl_load function.])
|
||||||
|
LIBADD_DL="$LIBADD_DL -ldld"],
|
||||||
|
[AC_CHECK_LIB([dl], [dlopen],
|
||||||
|
[AC_DEFINE([HAVE_LIBDL], [1],
|
||||||
|
[Define if you have the libdl library or equivalent.])
|
||||||
|
LIBADD_DL="-ldl"],
|
||||||
|
[AC_TRY_LINK([#if HAVE_DLFCN_H
|
||||||
|
# include <dlfcn.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[dlopen(0, 0);],
|
||||||
|
[AC_DEFINE([HAVE_LIBDL], [1],
|
||||||
|
[Define if you have the libdl library or equivalent.])],
|
||||||
|
[AC_CHECK_LIB([svld], [dlopen],
|
||||||
|
[AC_DEFINE([HAVE_LIBDL], [1],
|
||||||
|
[Define if you have the libdl library or equivalent.])
|
||||||
|
LIBADD_DL="-lsvld"],
|
||||||
|
[AC_CHECK_LIB([dld], [dld_link],
|
||||||
|
[AC_DEFINE([HAVE_DLD], [1],
|
||||||
|
[Define if you have the GNU dld library.])
|
||||||
|
LIBADD_DL="$LIBADD_DL -ldld"
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
|
||||||
|
LIBS_SAVE="$LIBS"
|
||||||
|
LIBS="$LIBS $LIBADD_DL"
|
||||||
|
AC_CHECK_FUNCS(dlerror)
|
||||||
|
LIBS="$LIBS_SAVE"
|
||||||
|
fi
|
||||||
|
])# AC_LTDL_DLLIB
|
|
@ -0,0 +1,40 @@
|
||||||
|
dnl @synopsis AX_CXX_GCC_ABI_DEMANGLE
|
||||||
|
dnl
|
||||||
|
dnl If the compiler supports GCC C++ ABI name demangling (has header cxxabi.h
|
||||||
|
dnl and abi::__cxa_demangle() function), define HAVE_GCC_ABI_DEMANGLE
|
||||||
|
dnl
|
||||||
|
dnl Adapted from AC_CXX_RTTI by Luc Maisonobe
|
||||||
|
dnl
|
||||||
|
dnl @version $Id: ax_cxx_gcc_abi_demangle.m4,v 1.1 2004/02/18 20:45:36 blep Exp $
|
||||||
|
dnl @author Neil Ferguson <nferguso@eso.org>
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE],
|
||||||
|
[AC_CACHE_CHECK(whether the compiler supports GCC C++ ABI name demangling,
|
||||||
|
ac_cv_cxx_gcc_abi_demangle,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_TRY_COMPILE([#include <typeinfo>
|
||||||
|
#include <cxxabi.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
template<typename TYPE>
|
||||||
|
class A {};
|
||||||
|
],[A<int> instance;
|
||||||
|
int status = 0;
|
||||||
|
char* c_name = 0;
|
||||||
|
|
||||||
|
c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status);
|
||||||
|
|
||||||
|
std::string name(c_name);
|
||||||
|
free(c_name);
|
||||||
|
|
||||||
|
return name == "A<int>";
|
||||||
|
],
|
||||||
|
ac_cv_cxx_gcc_abi_demangle=yes, ac_cv_cxx_gcc_abi_demangle=no)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
if test "$ac_cv_cxx_gcc_abi_demangle" = yes; then
|
||||||
|
AC_DEFINE(HAVE_GCC_ABI_DEMANGLE,1,
|
||||||
|
[define if the compiler supports GCC C++ ABI name demangling])
|
||||||
|
fi
|
||||||
|
])
|
|
@ -0,0 +1,27 @@
|
||||||
|
dnl @synopsis AX_CXX_HAVE_ISFINITE
|
||||||
|
dnl
|
||||||
|
dnl If isfinite() is available to the C++ compiler:
|
||||||
|
dnl define HAVE_ISFINITE
|
||||||
|
dnl add "-lm" to LIBS
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AX_CXX_HAVE_ISFINITE],
|
||||||
|
[ax_cxx_have_isfinite_save_LIBS=$LIBS
|
||||||
|
LIBS="$LIBS -lm"
|
||||||
|
|
||||||
|
AC_CACHE_CHECK(for isfinite, ax_cv_cxx_have_isfinite,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_LINK_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM(
|
||||||
|
[[#include <math.h>]],
|
||||||
|
[[int f = isfinite( 3 );]])],
|
||||||
|
[ax_cv_cxx_have_isfinite=yes],
|
||||||
|
[ax_cv_cxx_have_isfinite=no])
|
||||||
|
AC_LANG_RESTORE])
|
||||||
|
|
||||||
|
if test "$ax_cv_cxx_have_isfinite" = yes; then
|
||||||
|
AC_DEFINE([HAVE_ISFINITE],1,[define if compiler has isfinite])
|
||||||
|
else
|
||||||
|
LIBS=$ax_cxx_have_isfinite_save_LIBS
|
||||||
|
fi
|
||||||
|
])
|
|
@ -0,0 +1,34 @@
|
||||||
|
AC_DEFUN([BB_ENABLE_DOXYGEN],
|
||||||
|
[
|
||||||
|
AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (auto)])
|
||||||
|
AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)])
|
||||||
|
AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes])
|
||||||
|
AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no])
|
||||||
|
if test "x$enable_doxygen" = xno; then
|
||||||
|
enable_doc=no
|
||||||
|
else
|
||||||
|
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
|
||||||
|
if test "x$DOXYGEN" = x; then
|
||||||
|
if test "x$enable_doxygen" = xyes; then
|
||||||
|
AC_MSG_ERROR([could not find doxygen])
|
||||||
|
fi
|
||||||
|
enable_doc=no
|
||||||
|
else
|
||||||
|
enable_doc=yes
|
||||||
|
AC_PATH_PROG(DOT, dot, , $PATH)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
|
||||||
|
|
||||||
|
if test x$DOT = x; then
|
||||||
|
if test "x$enable_dot" = xyes; then
|
||||||
|
AC_MSG_ERROR([could not find dot])
|
||||||
|
fi
|
||||||
|
enable_dot=no
|
||||||
|
else
|
||||||
|
enable_dot=yes
|
||||||
|
fi
|
||||||
|
AC_SUBST(enable_dot)
|
||||||
|
AC_SUBST(enable_html_docs)
|
||||||
|
AC_SUBST(enable_latex_docs)
|
||||||
|
])
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,100 @@
|
||||||
|
/* config/config.h.in. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* define if library uses std::string::compare(string,pos,n) */
|
||||||
|
#undef FUNC_STRING_COMPARE_STRING_FIRST
|
||||||
|
|
||||||
|
/* define if the library defines strstream */
|
||||||
|
#undef HAVE_CLASS_STRSTREAM
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <cmath> header file. */
|
||||||
|
#undef HAVE_CMATH
|
||||||
|
|
||||||
|
/* Define if you have the GNU dld library. */
|
||||||
|
#undef HAVE_DLD
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `dlerror' function. */
|
||||||
|
#undef HAVE_DLERROR
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `finite' function. */
|
||||||
|
#undef HAVE_FINITE
|
||||||
|
|
||||||
|
/* define if the compiler supports GCC C++ ABI name demangling */
|
||||||
|
#undef HAVE_GCC_ABI_DEMANGLE
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
/* define if compiler has isfinite */
|
||||||
|
#undef HAVE_ISFINITE
|
||||||
|
|
||||||
|
/* Define if you have the libdl library or equivalent. */
|
||||||
|
#undef HAVE_LIBDL
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* define to 1 if the compiler implements namespaces */
|
||||||
|
#undef HAVE_NAMESPACES
|
||||||
|
|
||||||
|
/* define if the compiler supports Run-Time Type Identification */
|
||||||
|
#undef HAVE_RTTI
|
||||||
|
|
||||||
|
/* Define if you have the shl_load function. */
|
||||||
|
#undef HAVE_SHL_LOAD
|
||||||
|
|
||||||
|
/* define if the compiler has stringstream */
|
||||||
|
#undef HAVE_SSTREAM
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strstream> header file. */
|
||||||
|
#undef HAVE_STRSTREAM
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
|
#undef HAVE_SYS_STAT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#undef PACKAGE_BUGREPORT
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#undef PACKAGE_NAME
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#undef PACKAGE_STRING
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define to 1 to use type_info::name() for class names */
|
||||||
|
#undef USE_TYPEINFO_NAME
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#undef VERSION
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,589 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# depcomp - compile a program generating dependencies as side-effects
|
||||||
|
|
||||||
|
scriptversion=2007-03-29.01
|
||||||
|
|
||||||
|
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
'')
|
||||||
|
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
-h | --h*)
|
||||||
|
cat <<\EOF
|
||||||
|
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||||
|
|
||||||
|
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||||
|
as side-effects.
|
||||||
|
|
||||||
|
Environment variables:
|
||||||
|
depmode Dependency tracking mode.
|
||||||
|
source Source file read by `PROGRAMS ARGS'.
|
||||||
|
object Object file output by `PROGRAMS ARGS'.
|
||||||
|
DEPDIR directory where to store dependencies.
|
||||||
|
depfile Dependency file to output.
|
||||||
|
tmpdepfile Temporary file to use when outputing dependencies.
|
||||||
|
libtool Whether libtool is used (yes/no).
|
||||||
|
|
||||||
|
Report bugs to <bug-automake@gnu.org>.
|
||||||
|
EOF
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-v | --v*)
|
||||||
|
echo "depcomp $scriptversion"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||||
|
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||||
|
depfile=${depfile-`echo "$object" |
|
||||||
|
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||||
|
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||||
|
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
|
||||||
|
# Some modes work just like other modes, but use different flags. We
|
||||||
|
# parameterize here, but still list the modes in the big case below,
|
||||||
|
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||||
|
# here, because this file can only contain one case statement.
|
||||||
|
if test "$depmode" = hp; then
|
||||||
|
# HP compiler uses -M and no extra arg.
|
||||||
|
gccflag=-M
|
||||||
|
depmode=gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$depmode" = dashXmstdout; then
|
||||||
|
# This is just like dashmstdout with a different argument.
|
||||||
|
dashmflag=-xM
|
||||||
|
depmode=dashmstdout
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$depmode" in
|
||||||
|
gcc3)
|
||||||
|
## gcc 3 implements dependency tracking that does exactly what
|
||||||
|
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||||
|
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||||
|
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||||
|
## the command line argument order; so add the flags where they
|
||||||
|
## appear in depend2.am. Note that the slowdown incurred here
|
||||||
|
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||||
|
*) set fnord "$@" "$arg" ;;
|
||||||
|
esac
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
done
|
||||||
|
"$@"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
mv "$tmpdepfile" "$depfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
gcc)
|
||||||
|
## There are various ways to get dependency output from gcc. Here's
|
||||||
|
## why we pick this rather obscure method:
|
||||||
|
## - Don't want to use -MD because we'd like the dependencies to end
|
||||||
|
## up in a subdir. Having to rename by hand is ugly.
|
||||||
|
## (We might end up doing this anyway to support other compilers.)
|
||||||
|
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||||
|
## -MM, not -M (despite what the docs say).
|
||||||
|
## - Using -M directly means running the compiler twice (even worse
|
||||||
|
## than renaming).
|
||||||
|
if test -z "$gccflag"; then
|
||||||
|
gccflag=-MD,
|
||||||
|
fi
|
||||||
|
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||||
|
## The second -e expression handles DOS-style file names with drive letters.
|
||||||
|
sed -e 's/^[^:]*: / /' \
|
||||||
|
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||||
|
## This next piece of magic avoids the `deleted header file' problem.
|
||||||
|
## The problem is that when a header file which appears in a .P file
|
||||||
|
## is deleted, the dependency causes make to die (because there is
|
||||||
|
## typically no way to rebuild the header). We avoid this by adding
|
||||||
|
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||||
|
## this for us directly.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" |
|
||||||
|
## Some versions of gcc put a space before the `:'. On the theory
|
||||||
|
## that the space means something, we add a space to the output as
|
||||||
|
## well.
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
hp)
|
||||||
|
# This case exists only to let depend.m4 do its work. It works by
|
||||||
|
# looking at the text of this script. This case will never be run,
|
||||||
|
# since it is checked for above.
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
sgi)
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||||
|
else
|
||||||
|
"$@" -MDupdate "$tmpdepfile"
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
|
||||||
|
# Clip off the initial element (the dependent). Don't try to be
|
||||||
|
# clever and replace this with sed code, as IRIX sed won't handle
|
||||||
|
# lines with more than a fixed number of characters (4096 in
|
||||||
|
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||||
|
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||||
|
# dependency line.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||||
|
tr '
|
||||||
|
' ' ' >> $depfile
|
||||||
|
echo >> $depfile
|
||||||
|
|
||||||
|
# The second pass generates a dummy entry for each header file.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||||
|
>> $depfile
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
aix)
|
||||||
|
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||||
|
# in a .u file. In older versions, this file always lives in the
|
||||||
|
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||||
|
# start of each line; $object doesn't have directory information.
|
||||||
|
# Version 6 uses the directory in both cases.
|
||||||
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
tmpdepfile1=$dir$base.u
|
||||||
|
tmpdepfile2=$base.u
|
||||||
|
tmpdepfile3=$dir.libs/$base.u
|
||||||
|
"$@" -Wc,-M
|
||||||
|
else
|
||||||
|
tmpdepfile1=$dir$base.u
|
||||||
|
tmpdepfile2=$dir$base.u
|
||||||
|
tmpdepfile3=$dir$base.u
|
||||||
|
"$@" -M
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||||
|
do
|
||||||
|
test -f "$tmpdepfile" && break
|
||||||
|
done
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
# Each line is of the form `foo.o: dependent.h'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
|
# That's a tab and a space in the [].
|
||||||
|
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
icc)
|
||||||
|
# Intel's C compiler understands `-MD -MF file'. However on
|
||||||
|
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||||
|
# ICC 7.0 will fill foo.d with something like
|
||||||
|
# foo.o: sub/foo.c
|
||||||
|
# foo.o: sub/foo.h
|
||||||
|
# which is wrong. We want:
|
||||||
|
# sub/foo.o: sub/foo.c
|
||||||
|
# sub/foo.o: sub/foo.h
|
||||||
|
# sub/foo.c:
|
||||||
|
# sub/foo.h:
|
||||||
|
# ICC 7.1 will output
|
||||||
|
# foo.o: sub/foo.c sub/foo.h
|
||||||
|
# and will wrap long lines using \ :
|
||||||
|
# foo.o: sub/foo.c ... \
|
||||||
|
# sub/foo.h ... \
|
||||||
|
# ...
|
||||||
|
|
||||||
|
"$@" -MD -MF "$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
# Each line is of the form `foo.o: dependent.h',
|
||||||
|
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
|
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||||
|
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
# correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||||
|
sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
hp2)
|
||||||
|
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||||
|
# compilers, which have integrated preprocessors. The correct option
|
||||||
|
# to use with these is +Maked; it writes dependencies to a file named
|
||||||
|
# 'foo.d', which lands next to the object file, wherever that
|
||||||
|
# happens to be.
|
||||||
|
# Much of this is similar to the tru64 case; see comments there.
|
||||||
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
tmpdepfile1=$dir$base.d
|
||||||
|
tmpdepfile2=$dir.libs/$base.d
|
||||||
|
"$@" -Wc,+Maked
|
||||||
|
else
|
||||||
|
tmpdepfile1=$dir$base.d
|
||||||
|
tmpdepfile2=$dir$base.d
|
||||||
|
"$@" +Maked
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||||
|
do
|
||||||
|
test -f "$tmpdepfile" && break
|
||||||
|
done
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||||
|
# Add `dependent.h:' lines.
|
||||||
|
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||||
|
;;
|
||||||
|
|
||||||
|
tru64)
|
||||||
|
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||||
|
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||||
|
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||||
|
# dependencies in `foo.d' instead, so we check for that too.
|
||||||
|
# Subdirectories are respected.
|
||||||
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
# With Tru64 cc, shared objects can also be used to make a
|
||||||
|
# static library. This mechanism is used in libtool 1.4 series to
|
||||||
|
# handle both shared and static libraries in a single compilation.
|
||||||
|
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||||
|
#
|
||||||
|
# With libtool 1.5 this exception was removed, and libtool now
|
||||||
|
# generates 2 separate objects for the 2 libraries. These two
|
||||||
|
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||||
|
# in $dir$base.o.d. We have to check for both files, because
|
||||||
|
# one of the two compilations can be disabled. We should prefer
|
||||||
|
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||||
|
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||||
|
# the former would cause a distcleancheck panic.
|
||||||
|
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||||
|
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||||
|
"$@" -Wc,-MD
|
||||||
|
else
|
||||||
|
tmpdepfile1=$dir$base.o.d
|
||||||
|
tmpdepfile2=$dir$base.d
|
||||||
|
tmpdepfile3=$dir$base.d
|
||||||
|
tmpdepfile4=$dir$base.d
|
||||||
|
"$@" -MD
|
||||||
|
fi
|
||||||
|
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
|
do
|
||||||
|
test -f "$tmpdepfile" && break
|
||||||
|
done
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
|
# That's a tab and a space in the [].
|
||||||
|
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
#nosideeffect)
|
||||||
|
# This comment above is used by automake to tell side-effect
|
||||||
|
# dependency tracking mechanisms from slower ones.
|
||||||
|
|
||||||
|
dashmstdout)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout, regardless of -o.
|
||||||
|
"$@" || exit $?
|
||||||
|
|
||||||
|
# Remove the call to Libtool.
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove `-o $object'.
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-o)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
$object)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
test -z "$dashmflag" && dashmflag=-M
|
||||||
|
# Require at least two characters before searching for `:'
|
||||||
|
# in the target name. This is to cope with DOS-style filenames:
|
||||||
|
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||||
|
"$@" $dashmflag |
|
||||||
|
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
dashXmstdout)
|
||||||
|
# This case only exists to satisfy depend.m4. It is never actually
|
||||||
|
# run, as this mode is specially recognized in the preamble.
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
makedepend)
|
||||||
|
"$@" || exit $?
|
||||||
|
# Remove any Libtool call
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
# X makedepend
|
||||||
|
shift
|
||||||
|
cleared=no
|
||||||
|
for arg in "$@"; do
|
||||||
|
case $cleared in
|
||||||
|
no)
|
||||||
|
set ""; shift
|
||||||
|
cleared=yes ;;
|
||||||
|
esac
|
||||||
|
case "$arg" in
|
||||||
|
-D*|-I*)
|
||||||
|
set fnord "$@" "$arg"; shift ;;
|
||||||
|
# Strip any option that makedepend may not understand. Remove
|
||||||
|
# the object too, otherwise makedepend will parse it as a source file.
|
||||||
|
-*|$object)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"; shift ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||||
|
touch "$tmpdepfile"
|
||||||
|
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||||
|
' | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||||
|
;;
|
||||||
|
|
||||||
|
cpp)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout.
|
||||||
|
"$@" || exit $?
|
||||||
|
|
||||||
|
# Remove the call to Libtool.
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove `-o $object'.
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-o)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
$object)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
"$@" -E |
|
||||||
|
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||||
|
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||||
|
sed '$ s: \\$::' > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
cat < "$tmpdepfile" >> "$depfile"
|
||||||
|
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
msvisualcpp)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout, regardless of -o,
|
||||||
|
# because we must use -o when running libtool.
|
||||||
|
"$@" || exit $?
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case "$arg" in
|
||||||
|
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||||
|
set fnord "$@"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
"$@" -E |
|
||||||
|
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||||
|
echo " " >> "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
none)
|
||||||
|
exec "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unknown depmode $depmode" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
|
@ -0,0 +1,519 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
|
scriptversion=2006-12-25.00
|
||||||
|
|
||||||
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
|
# following copyright and license.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1994 X Consortium
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to
|
||||||
|
# deal in the Software without restriction, including without limitation the
|
||||||
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
# sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||||
|
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# Except as contained in this notice, the name of the X Consortium shall not
|
||||||
|
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||||
|
# ings in this Software without prior written authorization from the X Consor-
|
||||||
|
# tium.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# FSF changes to this file are in the public domain.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch.
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
IFS=" "" $nl"
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit=${DOITPROG-}
|
||||||
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put in absolute file names if you don't have them in your path;
|
||||||
|
# or use environment vars.
|
||||||
|
|
||||||
|
chgrpprog=${CHGRPPROG-chgrp}
|
||||||
|
chmodprog=${CHMODPROG-chmod}
|
||||||
|
chownprog=${CHOWNPROG-chown}
|
||||||
|
cmpprog=${CMPPROG-cmp}
|
||||||
|
cpprog=${CPPROG-cp}
|
||||||
|
mkdirprog=${MKDIRPROG-mkdir}
|
||||||
|
mvprog=${MVPROG-mv}
|
||||||
|
rmprog=${RMPROG-rm}
|
||||||
|
stripprog=${STRIPPROG-strip}
|
||||||
|
|
||||||
|
posix_glob='?'
|
||||||
|
initialize_posix_glob='
|
||||||
|
test "$posix_glob" != "?" || {
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=
|
||||||
|
else
|
||||||
|
posix_glob=:
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
|
posix_mkdir=
|
||||||
|
|
||||||
|
# Desired mode of installed file.
|
||||||
|
mode=0755
|
||||||
|
|
||||||
|
chgrpcmd=
|
||||||
|
chmodcmd=$chmodprog
|
||||||
|
chowncmd=
|
||||||
|
mvcmd=$mvprog
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
stripcmd=
|
||||||
|
|
||||||
|
src=
|
||||||
|
dst=
|
||||||
|
dir_arg=
|
||||||
|
dst_arg=
|
||||||
|
|
||||||
|
copy_on_change=false
|
||||||
|
no_target_directory=
|
||||||
|
|
||||||
|
usage="\
|
||||||
|
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
|
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||||
|
or: $0 [OPTION]... -d DIRECTORIES...
|
||||||
|
|
||||||
|
In the 1st form, copy SRCFILE to DSTFILE.
|
||||||
|
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||||
|
In the 4th, create DIRECTORIES.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--help display this help and exit.
|
||||||
|
--version display version info and exit.
|
||||||
|
|
||||||
|
-c (ignored)
|
||||||
|
-C install only if different (preserve the last data modification time)
|
||||||
|
-d create directories instead of installing files.
|
||||||
|
-g GROUP $chgrpprog installed files to GROUP.
|
||||||
|
-m MODE $chmodprog installed files to MODE.
|
||||||
|
-o USER $chownprog installed files to USER.
|
||||||
|
-s $stripprog installed files.
|
||||||
|
-t DIRECTORY install into DIRECTORY.
|
||||||
|
-T report an error if DSTFILE is a directory.
|
||||||
|
|
||||||
|
Environment variables override the default commands:
|
||||||
|
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||||
|
RMPROG STRIPPROG
|
||||||
|
"
|
||||||
|
|
||||||
|
while test $# -ne 0; do
|
||||||
|
case $1 in
|
||||||
|
-c) ;;
|
||||||
|
|
||||||
|
-C) copy_on_change=true;;
|
||||||
|
|
||||||
|
-d) dir_arg=true;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
--help) echo "$usage"; exit $?;;
|
||||||
|
|
||||||
|
-m) mode=$2
|
||||||
|
case $mode in
|
||||||
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
|
echo "$0: invalid mode: $mode" >&2
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-s) stripcmd=$stripprog;;
|
||||||
|
|
||||||
|
-t) dst_arg=$2
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-T) no_target_directory=true;;
|
||||||
|
|
||||||
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
|
--) shift
|
||||||
|
break;;
|
||||||
|
|
||||||
|
-*) echo "$0: invalid option: $1" >&2
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||||
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
|
# When -t is used, the destination is already specified.
|
||||||
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$dst_arg"; then
|
||||||
|
# $@ is not empty: it contains at least $arg.
|
||||||
|
set fnord "$@" "$dst_arg"
|
||||||
|
shift # fnord
|
||||||
|
fi
|
||||||
|
shift # arg
|
||||||
|
dst_arg=$arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
echo "$0: no input file specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# It's OK to call `install-sh -d' without argument.
|
||||||
|
# This can happen when creating conditional directories.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
|
|
||||||
|
# Set umask so as not to create temps with too-generous modes.
|
||||||
|
# However, 'strip' requires both read and write access to temps.
|
||||||
|
case $mode in
|
||||||
|
# Optimize common cases.
|
||||||
|
*644) cp_umask=133;;
|
||||||
|
*755) cp_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw='% 200'
|
||||||
|
fi
|
||||||
|
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||||
|
*)
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw=,u+rw
|
||||||
|
fi
|
||||||
|
cp_umask=$mode$u_plus_rw;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for src
|
||||||
|
do
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $src in
|
||||||
|
-*) src=./$src;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
dst=$src
|
||||||
|
dstdir=$dst
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
if test ! -f "$src" && test ! -d "$src"; then
|
||||||
|
echo "$0: $src does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dst_arg"; then
|
||||||
|
echo "$0: no destination specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dst=$dst_arg
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $dst in
|
||||||
|
-*) dst=./$dst;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; won't work
|
||||||
|
# if double slashes aren't ignored.
|
||||||
|
if test -d "$dst"; then
|
||||||
|
if test -n "$no_target_directory"; then
|
||||||
|
echo "$0: $dst_arg: Is a directory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
dstdir=$dst
|
||||||
|
dst=$dstdir/`basename "$src"`
|
||||||
|
dstdir_status=0
|
||||||
|
else
|
||||||
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
obsolete_mkdir_used=false
|
||||||
|
|
||||||
|
if test $dstdir_status != 0; then
|
||||||
|
case $posix_mkdir in
|
||||||
|
'')
|
||||||
|
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||||
|
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||||
|
umask=`umask`
|
||||||
|
case $stripcmd.$umask in
|
||||||
|
# Optimize common cases.
|
||||||
|
*[2367][2367]) mkdir_umask=$umask;;
|
||||||
|
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
mkdir_umask=`expr $umask + 22 \
|
||||||
|
- $umask % 100 % 40 + $umask % 20 \
|
||||||
|
- $umask % 10 % 4 + $umask % 2
|
||||||
|
`;;
|
||||||
|
*) mkdir_umask=$umask,go-w;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# With -d, create the new directory with the user-specified mode.
|
||||||
|
# Otherwise, rely on $mkdir_umask.
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
mkdir_mode=-m$mode
|
||||||
|
else
|
||||||
|
mkdir_mode=
|
||||||
|
fi
|
||||||
|
|
||||||
|
posix_mkdir=false
|
||||||
|
case $umask in
|
||||||
|
*[123567][0-7][0-7])
|
||||||
|
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||||
|
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||||
|
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||||
|
|
||||||
|
if (umask $mkdir_umask &&
|
||||||
|
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
if test -z "$dir_arg" || {
|
||||||
|
# Check for POSIX incompatibilities with -m.
|
||||||
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
|
case $ls_ld_tmpdir in
|
||||||
|
d????-?r-*) different_mode=700;;
|
||||||
|
d????-?--*) different_mode=755;;
|
||||||
|
*) false;;
|
||||||
|
esac &&
|
||||||
|
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||||
|
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||||
|
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
then posix_mkdir=:
|
||||||
|
fi
|
||||||
|
rmdir "$tmpdir/d" "$tmpdir"
|
||||||
|
else
|
||||||
|
# Remove any dirs left behind by ancient mkdir implementations.
|
||||||
|
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||||
|
fi
|
||||||
|
trap '' 0;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if
|
||||||
|
$posix_mkdir && (
|
||||||
|
umask $mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||||
|
)
|
||||||
|
then :
|
||||||
|
else
|
||||||
|
|
||||||
|
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||||
|
# or it failed possibly due to a race condition. Create the
|
||||||
|
# directory the slow way, step by step, checking for races as we go.
|
||||||
|
|
||||||
|
case $dstdir in
|
||||||
|
/*) prefix='/';;
|
||||||
|
-*) prefix='./';;
|
||||||
|
*) prefix='';;
|
||||||
|
esac
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob"
|
||||||
|
|
||||||
|
oIFS=$IFS
|
||||||
|
IFS=/
|
||||||
|
$posix_glob set -f
|
||||||
|
set fnord $dstdir
|
||||||
|
shift
|
||||||
|
$posix_glob set +f
|
||||||
|
IFS=$oIFS
|
||||||
|
|
||||||
|
prefixes=
|
||||||
|
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
test -z "$d" && continue
|
||||||
|
|
||||||
|
prefix=$prefix$d
|
||||||
|
if test -d "$prefix"; then
|
||||||
|
prefixes=
|
||||||
|
else
|
||||||
|
if $posix_mkdir; then
|
||||||
|
(umask=$mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
test -d "$prefix" || exit 1
|
||||||
|
else
|
||||||
|
case $prefix in
|
||||||
|
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||||
|
*) qprefix=$prefix;;
|
||||||
|
esac
|
||||||
|
prefixes="$prefixes '$qprefix'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
prefix=$prefix/
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -n "$prefixes"; then
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
(umask $mkdir_umask &&
|
||||||
|
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||||
|
test -d "$dstdir" || exit 1
|
||||||
|
obsolete_mkdir_used=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||||
|
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||||
|
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||||
|
else
|
||||||
|
|
||||||
|
# Make a couple of temp file names in the proper directory.
|
||||||
|
dsttmp=$dstdir/_inst.$$_
|
||||||
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
|
# Trap to clean up those temp files at exit.
|
||||||
|
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||||
|
|
||||||
|
# Copy the file name to the temp name.
|
||||||
|
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
|
#
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||||
|
#
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||||
|
|
||||||
|
# If -C, don't bother to copy if it wouldn't change the file.
|
||||||
|
if $copy_on_change &&
|
||||||
|
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||||
|
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob" &&
|
||||||
|
$posix_glob set -f &&
|
||||||
|
set X $old && old=:$2:$4:$5:$6 &&
|
||||||
|
set X $new && new=:$2:$4:$5:$6 &&
|
||||||
|
$posix_glob set +f &&
|
||||||
|
|
||||||
|
test "$old" = "$new" &&
|
||||||
|
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
rm -f "$dsttmp"
|
||||||
|
else
|
||||||
|
# Rename the file to the real destination.
|
||||||
|
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||||
|
|
||||||
|
# The rename failed, perhaps because mv can't rename something else
|
||||||
|
# to itself, or perhaps because mv is so ancient that it does not
|
||||||
|
# support -f.
|
||||||
|
{
|
||||||
|
# Now remove or move aside any old file at destination location.
|
||||||
|
# We try this two ways since rm can't unlink itself on some
|
||||||
|
# systems and the destination file might be busy for other
|
||||||
|
# reasons. In this case, the final cleanup might fail but the new
|
||||||
|
# file should still install successfully.
|
||||||
|
{
|
||||||
|
test ! -f "$dst" ||
|
||||||
|
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||||
|
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||||
|
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||||
|
} ||
|
||||||
|
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||||
|
(exit 1); exit 1
|
||||||
|
}
|
||||||
|
} &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
$doit $mvcmd "$dsttmp" "$dst"
|
||||||
|
}
|
||||||
|
fi || exit 1
|
||||||
|
|
||||||
|
trap '' 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,367 @@
|
||||||
|
#! /bin/sh
|
||||||
|
# Common stub for a few missing GNU programs while installing.
|
||||||
|
|
||||||
|
scriptversion=2006-05-10.23
|
||||||
|
|
||||||
|
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
run=:
|
||||||
|
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||||
|
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||||
|
|
||||||
|
# In the cases where this matters, `missing' is being run in the
|
||||||
|
# srcdir already.
|
||||||
|
if test -f configure.ac; then
|
||||||
|
configure_ac=configure.ac
|
||||||
|
else
|
||||||
|
configure_ac=configure.in
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg="missing on your system"
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--run)
|
||||||
|
# Try to run requested program, and just exit if it succeeds.
|
||||||
|
run=
|
||||||
|
shift
|
||||||
|
"$@" && exit 0
|
||||||
|
# Exit code 63 means version mismatch. This often happens
|
||||||
|
# when the user try to use an ancient version of a tool on
|
||||||
|
# a file that requires a minimum version. In this case we
|
||||||
|
# we should proceed has if the program had been absent, or
|
||||||
|
# if --run hadn't been passed.
|
||||||
|
if test $? = 63; then
|
||||||
|
run=:
|
||||||
|
msg="probably too old"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
-h|--h|--he|--hel|--help)
|
||||||
|
echo "\
|
||||||
|
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||||
|
|
||||||
|
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||||
|
error status if there is no known handling for PROGRAM.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help display this help and exit
|
||||||
|
-v, --version output version information and exit
|
||||||
|
--run try to run the given command, and emulate it if it fails
|
||||||
|
|
||||||
|
Supported PROGRAM values:
|
||||||
|
aclocal touch file \`aclocal.m4'
|
||||||
|
autoconf touch file \`configure'
|
||||||
|
autoheader touch file \`config.h.in'
|
||||||
|
autom4te touch the output file, or create a stub one
|
||||||
|
automake touch all \`Makefile.in' files
|
||||||
|
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
flex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
help2man touch the output file
|
||||||
|
lex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
makeinfo touch the output file
|
||||||
|
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||||
|
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
|
||||||
|
Send bug reports to <bug-automake@gnu.org>."
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||||
|
echo "missing $scriptversion (GNU Automake)"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*)
|
||||||
|
echo 1>&2 "$0: Unknown \`$1' option"
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Now exit if we have it, but it failed. Also exit now if we
|
||||||
|
# don't have it and --version was passed (most likely to detect
|
||||||
|
# the program).
|
||||||
|
case $1 in
|
||||||
|
lex|yacc)
|
||||||
|
# Not GNU programs, they don't have --version.
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar)
|
||||||
|
if test -n "$run"; then
|
||||||
|
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||||
|
exit 1
|
||||||
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
|
# Could not run --version or --help. This is probably someone
|
||||||
|
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||||
|
# $TOOL exists and not knowing $TOOL uses missing.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If it does not exist, or fails to run (possibly an outdated version),
|
||||||
|
# try to emulate it.
|
||||||
|
case $1 in
|
||||||
|
aclocal*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||||
|
any GNU archive site."
|
||||||
|
touch aclocal.m4
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoconf)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`${configure_ac}'. You might want to install the
|
||||||
|
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||||
|
archive site."
|
||||||
|
touch configure
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoheader)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||||
|
from any GNU archive site."
|
||||||
|
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||||
|
test -z "$files" && files="config.h"
|
||||||
|
touch_files=
|
||||||
|
for f in $files; do
|
||||||
|
case $f in
|
||||||
|
*:*) touch_files="$touch_files "`echo "$f" |
|
||||||
|
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||||
|
*) touch_files="$touch_files $f.in";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
touch $touch_files
|
||||||
|
;;
|
||||||
|
|
||||||
|
automake*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||||
|
You might want to install the \`Automake' and \`Perl' packages.
|
||||||
|
Grab them from any GNU archive site."
|
||||||
|
find . -type f -name Makefile.am -print |
|
||||||
|
sed 's/\.am$/.in/' |
|
||||||
|
while read f; do touch "$f"; done
|
||||||
|
;;
|
||||||
|
|
||||||
|
autom4te)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, but is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them.
|
||||||
|
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||||
|
archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo "#! /bin/sh"
|
||||||
|
echo "# Created by GNU Automake missing as a replacement of"
|
||||||
|
echo "# $ $@"
|
||||||
|
echo "exit 0"
|
||||||
|
chmod +x $file
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
bison|yacc)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' $msg. You should only need it if
|
||||||
|
you modified a \`.y' file. You may need the \`Bison' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Bison' from any GNU archive site."
|
||||||
|
rm -f y.tab.c y.tab.h
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.y)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.c
|
||||||
|
fi
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.h
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test ! -f y.tab.h; then
|
||||||
|
echo >y.tab.h
|
||||||
|
fi
|
||||||
|
if test ! -f y.tab.c; then
|
||||||
|
echo 'main() { return 0; }' >y.tab.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
lex|flex)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.l' file. You may need the \`Flex' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Flex' from any GNU archive site."
|
||||||
|
rm -f lex.yy.c
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.l)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test ! -f lex.yy.c; then
|
||||||
|
echo 'main() { return 0; }' >lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
help2man)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a dependency of a manual page. You may need the
|
||||||
|
\`Help2man' package in order for those modifications to take
|
||||||
|
effect. You can get \`Help2man' from any GNU archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo ".ab help2man is required to generate this page"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
makeinfo)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||||
|
indirectly affecting the aspect of the manual. The spurious
|
||||||
|
call might also be the consequence of using a buggy \`make' (AIX,
|
||||||
|
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||||
|
the \`GNU make' package. Grab either from any GNU archive site."
|
||||||
|
# The file to touch is that specified with -o ...
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -z "$file"; then
|
||||||
|
# ... or it is the one specified with @setfilename ...
|
||||||
|
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||||
|
file=`sed -n '
|
||||||
|
/^@setfilename/{
|
||||||
|
s/.* \([^ ]*\) *$/\1/
|
||||||
|
p
|
||||||
|
q
|
||||||
|
}' $infile`
|
||||||
|
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||||
|
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||||
|
fi
|
||||||
|
# If the file does not exist, the user really needs makeinfo;
|
||||||
|
# let's fail without touching anything.
|
||||||
|
test -f $file || exit 1
|
||||||
|
touch $file
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar)
|
||||||
|
shift
|
||||||
|
|
||||||
|
# We have already tried tar in the generic part.
|
||||||
|
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||||
|
# messages.
|
||||||
|
if (gnutar --version > /dev/null 2>&1); then
|
||||||
|
gnutar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
if (gtar --version > /dev/null 2>&1); then
|
||||||
|
gtar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
firstarg="$1"
|
||||||
|
if shift; then
|
||||||
|
case $firstarg in
|
||||||
|
*o*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/o//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case $firstarg in
|
||||||
|
*h*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/h//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||||
|
You may want to install GNU tar or Free paxutils, or check the
|
||||||
|
command line arguments."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, and is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them. Check the \`README' file,
|
||||||
|
it often tells you about the needed prerequisites for installing
|
||||||
|
this package. You may also peek at any GNU archive site, in case
|
||||||
|
some other package would contain this missing \`$1' program."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,155 @@
|
||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
AC_INIT(Makefile.am)
|
||||||
|
|
||||||
|
# autoconf 2.50 or higher to rebuild aclocal.m4, because the
|
||||||
|
# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
|
||||||
|
AC_PREREQ(2.50)
|
||||||
|
|
||||||
|
# Making releases:
|
||||||
|
# CPPUNIT_MICRO_VERSION += 1;
|
||||||
|
# CPPUNIT_INTERFACE_AGE += 1;
|
||||||
|
# CPPUNIT_BINARY_AGE += 1;
|
||||||
|
# if any functions have been added, set CPPUNIT_INTERFACE_AGE to 0.
|
||||||
|
# if backwards compatibility has been broken,
|
||||||
|
# set CPPUNIT_BINARY_AGE and CPPUNIT_INTERFACE_AGE to 0.
|
||||||
|
#
|
||||||
|
CPPUNIT_MAJOR_VERSION=1
|
||||||
|
CPPUNIT_MINOR_VERSION=12
|
||||||
|
CPPUNIT_MICRO_VERSION=1
|
||||||
|
CPPUNIT_INTERFACE_AGE=0
|
||||||
|
CPPUNIT_BINARY_AGE=0
|
||||||
|
CPPUNIT_VERSION=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION.$CPPUNIT_MICRO_VERSION
|
||||||
|
AC_SUBST(CPPUNIT_MAJOR_VERSION)
|
||||||
|
AC_SUBST(CPPUNIT_MINOR_VERSION)
|
||||||
|
AC_SUBST(CPPUNIT_MICRO_VERSION)
|
||||||
|
AC_SUBST(CPPUNIT_INTERFACE_AGE)
|
||||||
|
AC_SUBST(CPPUNIT_BINARY_AGE)
|
||||||
|
AC_SUBST(CPPUNIT_VERSION)
|
||||||
|
|
||||||
|
# libtool versioning
|
||||||
|
LT_RELEASE=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION
|
||||||
|
LT_CURRENT=`expr $CPPUNIT_MICRO_VERSION - $CPPUNIT_INTERFACE_AGE`
|
||||||
|
LT_REVISION=$CPPUNIT_INTERFACE_AGE
|
||||||
|
LT_AGE=`expr $CPPUNIT_BINARY_AGE - $CPPUNIT_INTERFACE_AGE`
|
||||||
|
AC_SUBST(LT_RELEASE)
|
||||||
|
AC_SUBST(LT_CURRENT)
|
||||||
|
AC_SUBST(LT_REVISION)
|
||||||
|
AC_SUBST(LT_AGE)
|
||||||
|
|
||||||
|
AC_CONFIG_AUX_DIR(config)
|
||||||
|
AM_CONFIG_HEADER(config/config.h)
|
||||||
|
AM_INIT_AUTOMAKE(cppunit, $CPPUNIT_VERSION)
|
||||||
|
|
||||||
|
# General "with" options
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
dnl Checks for programs.
|
||||||
|
|
||||||
|
AC_PROG_MAKE_SET
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
|
||||||
|
# The libtool macro AC_PROG_LIBTOOL checks for the C preprocessor.
|
||||||
|
# Configure gets confused if we try to check for a C preprocessor
|
||||||
|
# without first checking for the C compiler
|
||||||
|
# (see http://sources.redhat.com/ml/autoconf/2001-07/msg00036.html),
|
||||||
|
# so we invoke AC_PROG_CC explicitly.
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_CXX
|
||||||
|
AC_LANG(C++)
|
||||||
|
|
||||||
|
AC_LIBTOOL_WIN32_DLL
|
||||||
|
AC_PROG_LIBTOOL
|
||||||
|
|
||||||
|
# check for dlopen,dlsym... or shl_load, shl_findsym...
|
||||||
|
AC_LTDL_DLLIB
|
||||||
|
|
||||||
|
# check for doxygen
|
||||||
|
BB_ENABLE_DOXYGEN
|
||||||
|
|
||||||
|
|
||||||
|
# Check for headers
|
||||||
|
# Note that the fourth argument to AC_CHECK_HEADERS is non-empty to force
|
||||||
|
# the configure probe to try compiling "#include <header>". See autoconf docs.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(cmath,[],[],[/**/])
|
||||||
|
|
||||||
|
# Check for compiler characteristics
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
AC_CXX_RTTI
|
||||||
|
AX_CXX_GCC_ABI_DEMANGLE
|
||||||
|
AC_CXX_STRING_COMPARE_STRING_FIRST
|
||||||
|
|
||||||
|
|
||||||
|
# Check for library functions
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
AC_CXX_HAVE_SSTREAM
|
||||||
|
AC_CXX_HAVE_STRSTREAM
|
||||||
|
AX_CXX_HAVE_ISFINITE
|
||||||
|
AC_CHECK_FUNCS(finite)
|
||||||
|
|
||||||
|
cppunit_val='CPPUNIT_HAVE_RTTI'
|
||||||
|
AC_ARG_ENABLE(typeinfo-name,
|
||||||
|
[ --disable-typeinfo-name disable use of RTTI for class names],
|
||||||
|
[
|
||||||
|
test x$enableval = 'xno' && cppunit_val='0'
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED(USE_TYPEINFO_NAME,$cppunit_val,
|
||||||
|
[Define to 1 to use type_info::name() for class names])
|
||||||
|
|
||||||
|
|
||||||
|
# Doesn't work. It's supposed to add "#define CPPUNIT_NO_TESTPLUGIN" if
|
||||||
|
# --disable-test-plugin was used on the command line.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#AC_ARG_ENABLE(test-plugin,
|
||||||
|
#[ --disable-test-plugin disable support for test plug-ins],
|
||||||
|
#[
|
||||||
|
# if test -n "$enable_test_plugin"; then
|
||||||
|
# enable_test_plugin=${enable_test_plugin_default-yes}
|
||||||
|
# fi
|
||||||
|
# if test "$enable_test_plugin" = no; then
|
||||||
|
#echo "test-plug in disabled"
|
||||||
|
# fi
|
||||||
|
#])
|
||||||
|
#
|
||||||
|
#testplugin_val=1
|
||||||
|
#AC_DEFINE_UNQUOTED(NO_TESTPLUGIN,$testplugin_val,
|
||||||
|
#[defined to disable TestPlugIn])
|
||||||
|
|
||||||
|
|
||||||
|
AC_OUTPUT([
|
||||||
|
Makefile
|
||||||
|
cppunit.pc
|
||||||
|
cppunit.spec
|
||||||
|
cppunit-config
|
||||||
|
src/Makefile
|
||||||
|
src/DllPlugInTester/Makefile
|
||||||
|
src/cppunit/Makefile
|
||||||
|
include/Makefile
|
||||||
|
include/cppunit/Makefile
|
||||||
|
include/cppunit/config/Makefile
|
||||||
|
include/cppunit/extensions/Makefile
|
||||||
|
include/cppunit/plugin/Makefile
|
||||||
|
include/cppunit/portability/Makefile
|
||||||
|
include/cppunit/tools/Makefile
|
||||||
|
include/cppunit/ui/Makefile
|
||||||
|
include/cppunit/ui/mfc/Makefile
|
||||||
|
include/cppunit/ui/qt/Makefile
|
||||||
|
include/cppunit/ui/text/Makefile
|
||||||
|
doc/Makefile
|
||||||
|
doc/Doxyfile
|
||||||
|
examples/Makefile
|
||||||
|
examples/simple/Makefile
|
||||||
|
examples/hierarchy/Makefile
|
||||||
|
examples/cppunittest/Makefile
|
||||||
|
examples/ClockerPlugIn/Makefile
|
||||||
|
examples/DumperPlugIn/Makefile
|
||||||
|
examples/money/Makefile
|
||||||
|
],[chmod a+x cppunit-config])
|
||||||
|
|
||||||
|
AC_CREATE_PREFIX_CONFIG_H([include/cppunit/config-auto.h],
|
||||||
|
$PACKAGE, [config/config.h])
|
Binary file not shown.
|
@ -0,0 +1,170 @@
|
||||||
|
'Made by bloodchen
|
||||||
|
'bloodchen@hotmail.com
|
||||||
|
Sub NewTestClass
|
||||||
|
On Error Resume Next
|
||||||
|
dim proj_path,ext,pos,proj_dir,MyCppFile,MyCppName,MyHFile,MyHName,ClassName,HText,CPPText
|
||||||
|
proj_path = ActiveProject.fullname
|
||||||
|
ext = ""
|
||||||
|
pos = len (proj_path)
|
||||||
|
Do While ext <> "\"
|
||||||
|
ext = Mid(proj_path, pos, 1)
|
||||||
|
pos = pos -1
|
||||||
|
Loop
|
||||||
|
proj_dir = left(proj_path, pos+1)
|
||||||
|
ClassName=InputBox("Enter the class name:", "Class Name")
|
||||||
|
if ActiveProject.Type <> "Build" then
|
||||||
|
MsgBox "This project is not valid. Ending macro."
|
||||||
|
Exit Sub
|
||||||
|
end if
|
||||||
|
if (len(ClassName) <= 0) then
|
||||||
|
MsgBox "Invalid class name. Ending macro."
|
||||||
|
Exit Sub
|
||||||
|
end if
|
||||||
|
|
||||||
|
' ClassName="CTest"
|
||||||
|
MyCppName=proj_dir+ClassName+".cpp"
|
||||||
|
MyHName=proj_dir+ClassName+".h"
|
||||||
|
ActiveProject.AddFile MyCppName
|
||||||
|
ActiveProject.AddFile MyHName
|
||||||
|
Documents.Add "Text"
|
||||||
|
ActiveDocument.Selection.StartOfDocument
|
||||||
|
|
||||||
|
HText= "#ifndef "+ClassName+"DEF"+VbCrLf& _
|
||||||
|
"#define "+ClassName+"DEF"+VbCrLf& _
|
||||||
|
""+VbCrLf& _
|
||||||
|
"#include <cppunit\testcase.h>"+VbCrLf& _
|
||||||
|
"#include <cppunit\extensions\HelperMacros.h>"+VbCrLf& _
|
||||||
|
"class "+ClassName+":public CppUnit::TestCase"+VbCrLf& _
|
||||||
|
"{"+VbCrLf& _
|
||||||
|
" CPPUNIT_TEST_SUITE( "+ClassName+" );"+VbCrLf& _
|
||||||
|
" CPPUNIT_TEST_SUITE_END();"+VbCrLf& _
|
||||||
|
"public:"+VbCrLf& _
|
||||||
|
" "+ClassName+"();"+VbCrLf& _
|
||||||
|
" virtual ~"+ClassName+"();"+VbCrLf& _
|
||||||
|
"};"+VbCrLf& _
|
||||||
|
"#endif"+VbCrLf
|
||||||
|
ActiveDocument.Selection = HText
|
||||||
|
ActiveDocument.Save MyHName
|
||||||
|
' WriteFile MyHName,HText
|
||||||
|
Documents.Add "Text"
|
||||||
|
ActiveDocument.Selection.StartOfDocument
|
||||||
|
CPPText = "#include "+chr(34)+"stdafx.h"+chr(34)+VbCrLf& _
|
||||||
|
"#include "+chr(34)+ClassName+".h"+chr(34)+VbCrLf& _
|
||||||
|
""+VbCrLf& _
|
||||||
|
""+VbCrLf& _
|
||||||
|
"CPPUNIT_TEST_SUITE_REGISTRATION( "+ClassName+ " );"+VbCrLf& _
|
||||||
|
""+VbCrLf& _
|
||||||
|
""+VbCrLf& _
|
||||||
|
ClassName+"::"+ClassName+"()"+VbCrLf& _
|
||||||
|
"{"+VbCrLf& _
|
||||||
|
"}"+VbCrLf& _
|
||||||
|
""+VbCrLf& _
|
||||||
|
""+VbCrLf& _
|
||||||
|
ClassName+"::~"+ClassName+"()"+VbCrLf& _
|
||||||
|
"{"+VbCrLf& _
|
||||||
|
"}"
|
||||||
|
' WriteFile MyCppName,CPPText
|
||||||
|
ActiveDocument.Selection = CPPText
|
||||||
|
ActiveDocument.Save MyCppName
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Sub ToggleHandCPP()
|
||||||
|
'DESCRIPTION: Opens the .cpp or .h file for the current document.
|
||||||
|
'Toggles between the .cpp & .h file
|
||||||
|
ext = ActiveDocument.FullName
|
||||||
|
If ext = "" Then
|
||||||
|
msgbox ("Error, not a .cpp or .h file")
|
||||||
|
exit sub
|
||||||
|
End If
|
||||||
|
DocName = UCase(ext)
|
||||||
|
|
||||||
|
If Right(DocName,4) = ".CPP" Then
|
||||||
|
fn = left(DocName, Len(DocName)-3) & "h"
|
||||||
|
ElseIf Right(DocName,2) = ".H" Then
|
||||||
|
fn = Left(DocName, Len(DocName)-1) & "cpp"
|
||||||
|
Else
|
||||||
|
msgbox ("Error, not a .cpp or a .h file")
|
||||||
|
exit sub
|
||||||
|
End If
|
||||||
|
'msgbox (fn)
|
||||||
|
on error resume next
|
||||||
|
Documents.Open (fn)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub ADDTestMethod()
|
||||||
|
strHpt = ActiveDocument.FullName
|
||||||
|
if right(strHpt,3) = "CPP" Or right (strHpt,3) = "cpp" Then
|
||||||
|
ActiveDocument.Selection.SelectLine
|
||||||
|
strText = ActiveDocument.Selection.Text
|
||||||
|
if (Instr(strText, "::" ) = 0) Then
|
||||||
|
MsgBox("Line not valid !!")
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
else exit sub
|
||||||
|
end if
|
||||||
|
|
||||||
|
pos = Instr(strText, "::")
|
||||||
|
strName = Right(strText, (Len(strText) - (pos+1)))
|
||||||
|
pos = Instr(strName,"(")
|
||||||
|
strName = Left(strName,pos-1)
|
||||||
|
strClass = Left(strText,pos - 1)
|
||||||
|
while (instr(strClass, " ") > 0)
|
||||||
|
pos = instr(strClass, " ")
|
||||||
|
strTyp = strTyp & Left(strClass, pos)
|
||||||
|
strClass = Right(strClass, Len(strClass) - (pos) )
|
||||||
|
wend
|
||||||
|
ToggleHandCPP
|
||||||
|
|
||||||
|
ActiveDocument.Selection.SelectAll
|
||||||
|
strHead = ActiveDocument.Selection.Text
|
||||||
|
|
||||||
|
if (instr(strHead,strClass) = 0) Then
|
||||||
|
MsgBox(" Can't find class " & strClass & " !!")
|
||||||
|
ToggleHandCPP
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
ActiveDocument.Selection.EndOfDocument
|
||||||
|
lineBottom = ActiveDocument.Selection.CurrentLine
|
||||||
|
|
||||||
|
ActiveDocument.Selection.StartOfDocument
|
||||||
|
ActiveDocument.Selection.StartOfLine
|
||||||
|
ActiveDocument.Selection.SelectLine
|
||||||
|
strLine = ActiveDocument.Selection.Text
|
||||||
|
while (instr(strLine, strName) = 0 And ActiveDocument.Selection.CurrentLine <> lineBottom)
|
||||||
|
ActiveDocument.Selection.StartOfLine
|
||||||
|
ActiveDocument.Selection.LineDown dsMove
|
||||||
|
ActiveDocument.Selection.SelectLine
|
||||||
|
strLine = ActiveDocument.Selection.Text
|
||||||
|
Wend
|
||||||
|
if (ActiveDocument.Selection.CurrentLine < lineBottom) Then
|
||||||
|
if( instr(strLine, "CPPUNIT_TEST" ) <> 0 )Then
|
||||||
|
ToggleHandCPP
|
||||||
|
Exit Sub
|
||||||
|
end if
|
||||||
|
End If
|
||||||
|
|
||||||
|
ActiveDocument.Selection.StartOfDocument
|
||||||
|
ActiveDocument.Selection.StartOfLine
|
||||||
|
ActiveDocument.Selection.SelectLine
|
||||||
|
strLine = ActiveDocument.Selection.Text
|
||||||
|
while (instr(strLine, " CPPUNIT_TEST_SUITE_END();" ) = 0 And ActiveDocument.Selection.CurrentLine <> lineBottom)
|
||||||
|
ActiveDocument.Selection.StartOfLine
|
||||||
|
ActiveDocument.Selection.LineDown dsMove
|
||||||
|
ActiveDocument.Selection.SelectLine
|
||||||
|
strLine = ActiveDocument.Selection.Text
|
||||||
|
Wend
|
||||||
|
if (ActiveDocument.Selection.CurrentLine < lineBottom) Then
|
||||||
|
ActiveDocument.Selection.EndOfLine
|
||||||
|
ActiveDocument.Selection.LineUp
|
||||||
|
ActiveDocument.Selection.EndOfLine
|
||||||
|
ActiveDocument.Selection.NewLine
|
||||||
|
ActiveDocument.Selection = "CPPUNIT_TEST( "&strName&" );"
|
||||||
|
else
|
||||||
|
MsgBox("CPPUNIT_TEST_SUITE_END not found")
|
||||||
|
end if
|
||||||
|
ToggleHandCPP
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
|
@ -0,0 +1,486 @@
|
||||||
|
Baptiste Lepilleur's template file.
|
||||||
|
(@)Copyright 2001, Baptiste Lepilleur <gaiacrtn@free.fr>.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[-ExtractPath]
|
||||||
|
!!Memo
|
||||||
|
Extract the path from a full filename.
|
||||||
|
path is the filename we need to extract the path from.
|
||||||
|
returns: extracted path.
|
||||||
|
Algo: we iterates the filename from the end until we found a character '\'.
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Params
|
||||||
|
path @@(ProjectPath)@@
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Code
|
||||||
|
Input path: "@@path@@"
|
||||||
|
!!Set index @@(Strlen @@path@@)@@
|
||||||
|
!!//
|
||||||
|
!!Set finalpath
|
||||||
|
!!Label LoopExtractPath
|
||||||
|
!!Sub index 1
|
||||||
|
!!If @@index@@ < 0
|
||||||
|
!!Goto EndExtractPath
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!Set lastchar @@(StrSub @@path@@ @@index@@ 1)@@
|
||||||
|
!!If @@lastchar@@ != "\"
|
||||||
|
!!Goto LoopExtractPath
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!Add index 1
|
||||||
|
!!Set finalpath @@(StrSub @@path@@ 0 @@index@@)@@
|
||||||
|
!!//
|
||||||
|
!!Label EndExtractPath
|
||||||
|
!!Return @@finalpath@@
|
||||||
|
!!End
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
[+01 Create Class in file]
|
||||||
|
!!Memo
|
||||||
|
Creates a new class in new files (.h/.cpp) and adds them to the project.
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Params
|
||||||
|
classname Ttr
|
||||||
|
parentclassname =
|
||||||
|
classdesc This class represents
|
||||||
|
objectkind Reference Object
|
||||||
|
hasserialize 0
|
||||||
|
isrefobj 0
|
||||||
|
inlinectordtor 0
|
||||||
|
createfile 1
|
||||||
|
isunittest 0
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Dialog
|
||||||
|
<html><body>
|
||||||
|
Class name: <input type=text id=classname size=40><br>
|
||||||
|
Brief description: <input type=text id=classdesc size=68><br>
|
||||||
|
Object Kind:
|
||||||
|
<select name="Object Kind" id=objectkind>
|
||||||
|
<option>Default Value Object</option>
|
||||||
|
<option>Explicit Value Object</option>
|
||||||
|
<option>Reference Object</option>
|
||||||
|
</select><br>
|
||||||
|
|
||||||
|
Parent class name: <input type=text id=parentclassname size=40><br>
|
||||||
|
|
||||||
|
<input type=checkbox id=createfile>
|
||||||
|
Create a new file ? (otherwise Insert in current file).<br>
|
||||||
|
<br>
|
||||||
|
<input type=checkbox id=hasserialize>
|
||||||
|
Has: virtual void Serialize( CArchive &ar )<br>
|
||||||
|
<input type=checkbox id=isrefobj>
|
||||||
|
Is a reference counted object (inherit ERefObj)<br>
|
||||||
|
<input type=checkbox id=inlinectordtor>
|
||||||
|
Inline ctor/dtor, copy ctor/operator.<br>
|
||||||
|
<input type=checkbox id=isunittest>
|
||||||
|
Is a CppUnit unit test.<br>
|
||||||
|
|
||||||
|
<!--Base filename: <input type=text id=classbasepath size=64><br> -->
|
||||||
|
|
||||||
|
|
||||||
|
<!--<p>Filename: <input type=file id=classhfn accept="*.h" size=40></p> -->
|
||||||
|
<!--<p>Filename: <input type=file id=classcppfn accept="*.h" size=40></p> -->
|
||||||
|
</body></html>
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Code
|
||||||
|
!!// Set variable that indicates the kind of object we are working on.
|
||||||
|
!!Set defvalobject 0
|
||||||
|
!!If @@objectkind@@ == "Default Value Object"
|
||||||
|
!!Set defvalobject 1
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!Set valobject 0
|
||||||
|
!!If @@objectkind@@ == "Explicit Value Object"
|
||||||
|
!!Set valobject 1
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!Set refobject 0
|
||||||
|
!!If @@objectkind@@ == "Reference Object"
|
||||||
|
!!Set refobject 1
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!// Set class filename (relative to dsp)
|
||||||
|
!!Set headerfn @@classname@@.h
|
||||||
|
!!Set implfn @@classname@@.cpp
|
||||||
|
!!Set headerdefine @@(String @@(Call -MakeHeaderDefined fn @@headerfn@@)@@:U)@@
|
||||||
|
!!//
|
||||||
|
!!// hasparentclass indicates if a parent class has been defined.
|
||||||
|
!!Set hasparentclass 0
|
||||||
|
!!If @@parentclassname@@ != =
|
||||||
|
!!Set hasparentclass 1
|
||||||
|
!!Else
|
||||||
|
!!If @@isunittest@@
|
||||||
|
!!Set parentclassname CppUnit::TestFixture
|
||||||
|
!!Set hasparentclass 1
|
||||||
|
!!Endif
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!// hasparent is set to 1 if the class has some parent (ERefObj or parentclass).
|
||||||
|
!!Set hasparent @@hasparentclass@@
|
||||||
|
!!If @@isrefobj@@
|
||||||
|
!!Set hasparent 1
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!// All variables are set, we can now generates the class.
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!// ----------------------------------------------------------------------------
|
||||||
|
!!// ------------------------------ header file ---------------------------------
|
||||||
|
!!// ----------------------------------------------------------------------------
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!If @@createfile@@
|
||||||
|
!!FileNew @@headerfn@@ dsp
|
||||||
|
!!Set headerpath @@(FilePath)@@
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
// Header file @@headerfn@@ for class @@classname@@
|
||||||
|
// (c)Copyright 2000, Baptiste Lepilleur.
|
||||||
|
// Created: @@(Date "yyyy/MM/dd")@@
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
#ifndef @@headerdefine@@
|
||||||
|
#define @@headerdefine@@
|
||||||
|
!!Else
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
// Definition of class @@classname@@
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
!!Endif
|
||||||
|
!!If @@hasparentclass@@
|
||||||
|
|
||||||
|
!!If @@isunittest@@
|
||||||
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
!!Else
|
||||||
|
#include "@@parentclassname@@.h"
|
||||||
|
!!Endif
|
||||||
|
!!Endif
|
||||||
|
|
||||||
|
|
||||||
|
!!If @@isrefobj@@
|
||||||
|
/*! Declare @@classname@@Ref as a reference pointer on @@classname@@.
|
||||||
|
*/
|
||||||
|
EDECL_REF( @@classname@@ );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
/*! \class @@classname@@
|
||||||
|
* \brief @@classdesc@@
|
||||||
|
*/
|
||||||
|
class @@classname@@@@\
|
||||||
|
!!// Write inherited class list (parent class first, then ERefObj if inherited).
|
||||||
|
!!If @@hasparent@@
|
||||||
|
: @@\
|
||||||
|
!!// xpos contains the indentation level for inheritance declarations...
|
||||||
|
!!GetPos xpos ypos
|
||||||
|
!!Sub xpos 1
|
||||||
|
public @@\
|
||||||
|
!!Else
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
!!If @@hasparentclass@@
|
||||||
|
@@parentclassname@@@@\
|
||||||
|
!!If @@isrefobj@@
|
||||||
|
,
|
||||||
|
@@(Call -MakeFiller filler " " count @@xpos@@)@@@@\
|
||||||
|
public @@\
|
||||||
|
!!Else
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
!!Endif
|
||||||
|
!!If @@isrefobj@@
|
||||||
|
ERefObj
|
||||||
|
!!Endif
|
||||||
|
{
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!// ------------ Done with inheritance, declare the class body... ----------
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!If @@isunittest@@
|
||||||
|
CPPUNIT_TEST_SUITE( @@classname@@ );
|
||||||
|
CPPUNIT_TEST( putTestMethodNameHere );
|
||||||
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
public:
|
||||||
|
!!If !@@defvalobject@@
|
||||||
|
/*! Constructs a @@classname@@ object.
|
||||||
|
*/
|
||||||
|
@@classname@@();
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
!!If @@valobject@@
|
||||||
|
/*! Copy constructor.
|
||||||
|
* @param copy Object to copy.
|
||||||
|
*/
|
||||||
|
@@classname@@( const @@classname@@ © );
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~@@classname@@();
|
||||||
|
!!If @@valobject@@
|
||||||
|
|
||||||
|
/*! Copy operator.
|
||||||
|
* @param copy Object to copy.
|
||||||
|
* @return Reference on this object.
|
||||||
|
*/
|
||||||
|
@@classname@@ &operator =( const @@classname@@ © );
|
||||||
|
!!Endif
|
||||||
|
!!If @@isunittest@@
|
||||||
|
|
||||||
|
void setUp();
|
||||||
|
void tearDown();
|
||||||
|
!!Endif
|
||||||
|
!!// Private for methods
|
||||||
|
!!If @@refobject@@
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Prevents the use of the copy constructor.
|
||||||
|
@@classname@@( const @@classname@@ © );
|
||||||
|
|
||||||
|
/// Prevents the use of the copy operator.
|
||||||
|
void operator =( const @@classname@@ © );
|
||||||
|
!!Endif
|
||||||
|
!!// Private for member datas
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
!!If @@createfile@@
|
||||||
|
// Inlines methods for @@classname@@:@@\
|
||||||
|
!!GetPos xpos ypos
|
||||||
|
!!Sub xpos 4
|
||||||
|
|
||||||
|
// @@(Call -MakeFiller filler - count @@xpos@@)@@
|
||||||
|
!!Endif //@@createfile@@
|
||||||
|
!!If @@inlinectordtor@@
|
||||||
|
!!If !@@defvalobject@@
|
||||||
|
|
||||||
|
|
||||||
|
inline
|
||||||
|
@@classname@@::@@classname@@()@@\
|
||||||
|
!!If @@hasparentclass@@
|
||||||
|
:
|
||||||
|
@@parentclassname@@()
|
||||||
|
!!Else
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
{
|
||||||
|
}
|
||||||
|
!!Endif //!@@defvalobject@@
|
||||||
|
!!If @@valobject@@
|
||||||
|
|
||||||
|
|
||||||
|
inline
|
||||||
|
@@classname@@::@@classname@@( const @@classname@@ © )@@\
|
||||||
|
!!If @@hasparentclass@@
|
||||||
|
:
|
||||||
|
@@parentclassname@@( copy )
|
||||||
|
!!Else
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
!!Endif //@@valobject@@
|
||||||
|
|
||||||
|
|
||||||
|
inline
|
||||||
|
@@classname@@::~@@classname@@()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
!!If @@valobject@@
|
||||||
|
|
||||||
|
|
||||||
|
inline @@classname@@ &
|
||||||
|
@@classname@@::operator =( const @@classname@@ © )
|
||||||
|
{
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
!!Endif //@@valobject@@
|
||||||
|
!!Endif //@@inlinectordtor@@
|
||||||
|
|
||||||
|
|
||||||
|
!!If @@createfile@@
|
||||||
|
|
||||||
|
#endif // @@headerdefine@@
|
||||||
|
!!FileSave
|
||||||
|
!!ProjectFileAdd
|
||||||
|
!!Endif
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!// ----------------------------------------------------------------------------
|
||||||
|
!!// -------------------------- Implementation file -----------------------------
|
||||||
|
!!// ----------------------------------------------------------------------------
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!//
|
||||||
|
!!If @@createfile@@
|
||||||
|
!!FileNew @@implfn@@ dsp
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
// Implementation file @@implfn@@ for class @@classname@@
|
||||||
|
// (c)Copyright 2000, Baptiste Lepilleur.
|
||||||
|
// Created: @@(Date "yyyy/MM/dd")@@
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "StdAfx.h"
|
||||||
|
#include "@@headerfn@@"
|
||||||
|
!!Else
|
||||||
|
|
||||||
|
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
// Implementation of class @@classname@@
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
!!Endif
|
||||||
|
!!If @@isunittest@@
|
||||||
|
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION( @@classname@@ );
|
||||||
|
!!Endif
|
||||||
|
!!If !@@inlinectordtor@@
|
||||||
|
!!If !@@defvalobject@@
|
||||||
|
|
||||||
|
|
||||||
|
@@classname@@::@@classname@@()@@\
|
||||||
|
!!If @@hasparentclass@@
|
||||||
|
:
|
||||||
|
@@parentclassname@@()
|
||||||
|
!!Else
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
{
|
||||||
|
}
|
||||||
|
!!Endif
|
||||||
|
!!If @@valobject@@
|
||||||
|
|
||||||
|
|
||||||
|
@@classname@@::@@classname@@( const @@classname@@ © )@@\
|
||||||
|
!!If @@hasparentclass@@
|
||||||
|
:
|
||||||
|
@@parentclassname@@( copy )
|
||||||
|
!!Else
|
||||||
|
|
||||||
|
!!Endif
|
||||||
|
{
|
||||||
|
}
|
||||||
|
!!Endif
|
||||||
|
|
||||||
|
|
||||||
|
@@classname@@::~@@classname@@()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
!!If @@valobject@@
|
||||||
|
|
||||||
|
|
||||||
|
@@classname@@ &
|
||||||
|
@@classname@@::operator =( const @@classname@@ © )
|
||||||
|
{
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
!!Endif
|
||||||
|
!!Endif
|
||||||
|
!!If @@isunittest@@
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
@@classname@@::setUp()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
@@classname@@::tearDown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
!!Endif
|
||||||
|
|
||||||
|
!!If @@createfile@@
|
||||||
|
!!FileSave
|
||||||
|
!!ProjectFileAdd
|
||||||
|
!!//ExecuteCommand FileOpen "@@headerpath@@"
|
||||||
|
!!Endif
|
||||||
|
!!End
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
[-Dummy]
|
||||||
|
!!Code
|
||||||
|
!!End
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
------------------------ [-MakeHeaderDefined] -------------------------------
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
[-MakeHeaderDefined]
|
||||||
|
!!Memo
|
||||||
|
This template replace all occurences of '.' in the specified filename "fn" by '_'.
|
||||||
|
This is typically used to make the #ifndef at the beginning of header files.
|
||||||
|
Parameters: "fn" filename in which each occurence of '.' is replaced by '_'.
|
||||||
|
Returns: Transformed filename.
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Params
|
||||||
|
fn TestDoIt
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Code
|
||||||
|
!!Set result @@fn@@
|
||||||
|
!!Label LoopMakeHeaderDefined
|
||||||
|
!!Set fn @@result@@
|
||||||
|
!!// Check if there is any occurence left of '.'
|
||||||
|
!!Set index @@(StrFind @@fn@@ ".")@@
|
||||||
|
!!If @@index@@ < 0
|
||||||
|
!!Goto EndMakeHeaderDefined
|
||||||
|
!!Endif
|
||||||
|
!!// Replace occurences of '.' in fb by '_' and set to result.
|
||||||
|
!!Set result @@(StrSub @@fn@@ 0 @@index@@ )@@_
|
||||||
|
!!Add index 1
|
||||||
|
!!Set result @@result@@@@(StrSub @@fn@@ @@index@@)@@
|
||||||
|
!!Goto LoopMakeHeaderDefined
|
||||||
|
!!Label EndMakeHeaderDefined
|
||||||
|
!!Return @@result@@
|
||||||
|
!!End
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
---------------------------- [-MakeFiller] ----------------------------------
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
[-MakeFiller]
|
||||||
|
!!Memo
|
||||||
|
Make a string that contains "count" occurrence of "filler".
|
||||||
|
Parameters: "filler" String that is repeated.
|
||||||
|
"count" Number of times the "filler" is repeated.
|
||||||
|
Returns: A string that contains "count" times the string "filler".
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Params
|
||||||
|
filler -
|
||||||
|
count 10
|
||||||
|
!!End
|
||||||
|
|
||||||
|
!!Code
|
||||||
|
!!Set result
|
||||||
|
!!Label LoopMakerFiller
|
||||||
|
!!If @@count@@ > 0
|
||||||
|
!!Set result @@result@@@@filler@@
|
||||||
|
!!Sub count 1
|
||||||
|
!!Goto LoopMakerFiller
|
||||||
|
!!Endif
|
||||||
|
!!Return @@result@@
|
||||||
|
!!End
|
|
@ -0,0 +1,10 @@
|
||||||
|
What's in those files:
|
||||||
|
|
||||||
|
* CppUnit.WWTpl: a template Workspace Whiz! which create a new class
|
||||||
|
and add the new files to the project. You can specify that the class is a
|
||||||
|
CppUnit testcase and all the macro will be defined to register the test case
|
||||||
|
and declare the test suite. Workspace Whiz! is an add-ins for VC++. It can
|
||||||
|
be found at: http://www.workspacewhiz.com/.
|
||||||
|
|
||||||
|
* AddingUnitTestMethod.dsm: a set of VC++ macro to add unit test
|
||||||
|
using helper macros.
|
|
@ -0,0 +1,125 @@
|
||||||
|
<?xml version="1.0" encoding='shift_jis' standalone='yes' ?>
|
||||||
|
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xml:lang="ja">
|
||||||
|
|
||||||
|
<xsl:template match="/">
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<TITLE>Test Report</TITLE>
|
||||||
|
<STYLE>
|
||||||
|
TABLE { color:#222222; font-size:10pt; font-family:'MS ゴシック' 'sanserif'; }
|
||||||
|
TH { font-weight:normal; color:#FFFFFF; background-color:#888888; }
|
||||||
|
TR.check { background-color:#EEEEEE }
|
||||||
|
TD.check { background-color:#EEEEEE }
|
||||||
|
H1 { color:#111111; font-family:'Times New Roman' 'MS P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:3px; border-bottom-color:#444488; }
|
||||||
|
H2 { color:#222222; font-family:'Times New Roman' 'MS P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:2px; border-bottom-color:#444488; }
|
||||||
|
H3 { color:#333333; font-family:'Times New Roman' 'MS P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#444488; margin-bottom:8px; }
|
||||||
|
H4 { color:#444444; font-family:'Times New Roman' 'MS P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#CCCCDD; margin-bottom:8px; }
|
||||||
|
H5 { color:#555555; font-family:'Times New Roman' 'MS P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#EEEEFF; margin-bottom:8px; }
|
||||||
|
H6 { color:#666666; font-family:'Times New Roman' 'MS P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#F8F8FF; margin-bottom:8px; }
|
||||||
|
|
||||||
|
SPAN.good { color:#006666; font-weight:bold; }
|
||||||
|
SPAN.critical { color:#880000; font-weight:bold; }
|
||||||
|
</STYLE>
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<H1>Test Report</H1>
|
||||||
|
<xsl:apply-templates select="/TestRun/*"/>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="FailedTests">
|
||||||
|
<H2>FailedTests</H2>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="FailedTest">
|
||||||
|
<TABLE>
|
||||||
|
<TR>
|
||||||
|
<TH>id</TH>
|
||||||
|
<TH>Name</TH>
|
||||||
|
<TH>FailureType</TH>
|
||||||
|
<TH>Location</TH>
|
||||||
|
<TH>Message</TH>
|
||||||
|
</TR>
|
||||||
|
<xsl:apply-templates select="FailedTest"/>
|
||||||
|
</TABLE>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<SPAN class="good">No failed test.</SPAN>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="FailedTest">
|
||||||
|
<TR>
|
||||||
|
<TD align="right" valign='top'><xsl:value-of select="@id"/></TD>
|
||||||
|
<TD valign='top'><xsl:apply-templates select="Name"/></TD>
|
||||||
|
<TD valign='top'><xsl:apply-templates select="FailureType"/></TD>
|
||||||
|
<TD valign='top'><xsl:apply-templates select="Location"/></TD>
|
||||||
|
<TD valign='top'><pre><xsl:apply-templates select="Message"/></pre></TD>
|
||||||
|
</TR>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="Name|FailureType|Message"><xsl:value-of select="."/></xsl:template>
|
||||||
|
<xsl:template match="Location">
|
||||||
|
<xsl:if test=".">
|
||||||
|
line #<xsl:value-of select="Line"/> in <xsl:value-of select="File"/>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="SuccessfulTests">
|
||||||
|
<H2>SuccessfulTests</H2>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="Test">
|
||||||
|
<TABLE>
|
||||||
|
<TR>
|
||||||
|
<TH>id</TH>
|
||||||
|
<TH>Name</TH>
|
||||||
|
</TR>
|
||||||
|
<xsl:apply-templates select="Test"/>
|
||||||
|
</TABLE>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<SPAN class="critical">No sucessful test.</SPAN>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="Test">
|
||||||
|
<TR>
|
||||||
|
<TD align="right"><xsl:value-of select="@id"/></TD>
|
||||||
|
<TD><xsl:apply-templates select="Name"/></TD>
|
||||||
|
</TR>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="Statistics">
|
||||||
|
<H2>Statistics</H2>
|
||||||
|
<TABLE>
|
||||||
|
<TR>
|
||||||
|
<TH>Status</TH>
|
||||||
|
<TH>Number</TH>
|
||||||
|
</TR>
|
||||||
|
|
||||||
|
<TR>
|
||||||
|
<TD>Tests</TD>
|
||||||
|
<TD align="right"><xsl:value-of select="Tests"/></TD>
|
||||||
|
</TR>
|
||||||
|
|
||||||
|
<TR>
|
||||||
|
<TD>FailuresTotal</TD>
|
||||||
|
<TD align="right"><xsl:value-of select="FailuresTotal"/></TD>
|
||||||
|
</TR>
|
||||||
|
|
||||||
|
<TR>
|
||||||
|
<TD>Errors</TD>
|
||||||
|
<TD align="right"><xsl:value-of select="Errors"/></TD>
|
||||||
|
</TR>
|
||||||
|
|
||||||
|
<TR>
|
||||||
|
<TD>Failures</TD>
|
||||||
|
<TD align="right"><xsl:value-of select="Failures"/></TD>
|
||||||
|
</TR>
|
||||||
|
|
||||||
|
</TABLE>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?xml version="1.0" encoding='ISO-8859-1' standalone='yes' ?>
|
||||||
|
<?xml-stylesheet type="text/xsl" href="report.xsl"?>
|
||||||
|
<TestRun>
|
||||||
|
<FailedTests>
|
||||||
|
<FailedTest id="1">
|
||||||
|
<Name>ExampleTestCase.example</Name>
|
||||||
|
<FailureType>Assertion</FailureType>
|
||||||
|
<Location>
|
||||||
|
<File>exampletestcase.cpp</File>
|
||||||
|
<Line>7</Line>
|
||||||
|
</Location>
|
||||||
|
<Message>- Expected : { 0; 7; 8; 9; 10; 11; 1; 2; 3; 4; 5; 6; 12; 13; 14; 15; 16; 17; 18; 19 }
|
||||||
|
- Actual : { 0; 1; 2; 3; 4; 5; 7; 8; 9; 10; 11; 6; 12; 13; 14; 15; 16; 17; 18; 19 }
|
||||||
|
- Difference at index 1
|
||||||
|
->Expected : { 7; 8; 9; 10; 11; 1; 2; 3; 4; 5; 6; 12; 13; 14; 15; 16; 17; 18; 19 }
|
||||||
|
->Actual : { 1; 2; 3; 4; 5; 7; 8; 9; 10; 11; 6; 12; 13; 14; 15; 16; 17; 18; 19 }</Message>
|
||||||
|
</FailedTest>
|
||||||
|
<FailedTest id="2">
|
||||||
|
<Name>ExampleTestCase.anotherExample</Name>
|
||||||
|
<FailureType>Assertion</FailureType>
|
||||||
|
<Location>
|
||||||
|
<File>exampletestcase.cpp</File>
|
||||||
|
<Line>15</Line>
|
||||||
|
</Location>
|
||||||
|
<Message>1 == 2</Message>
|
||||||
|
</FailedTest>
|
||||||
|
<FailedTest id="3">
|
||||||
|
<Name>ExampleTestCase.testAdd</Name>
|
||||||
|
<FailureType>Assertion</FailureType>
|
||||||
|
<Location>
|
||||||
|
<File>exampletestcase.cpp</File>
|
||||||
|
<Line>27</Line>
|
||||||
|
</Location>
|
||||||
|
<Message>result == 6.0</Message>
|
||||||
|
</FailedTest>
|
||||||
|
<FailedTest id="4">
|
||||||
|
<Name>ExampleTestCase.testDivideByZero</Name>
|
||||||
|
<FailureType>Error</FailureType>
|
||||||
|
<Message>caught unknown exception</Message>
|
||||||
|
</FailedTest>
|
||||||
|
<FailedTest id="5">
|
||||||
|
<Name>ExampleTestCase.testEquals</Name>
|
||||||
|
<FailureType>Assertion</FailureType>
|
||||||
|
<Location>
|
||||||
|
<File>exampletestcase.cpp</File>
|
||||||
|
<Line>48</Line>
|
||||||
|
</Location>
|
||||||
|
<Message>Expected: 12, but was: 13.</Message>
|
||||||
|
</FailedTest>
|
||||||
|
</FailedTests>
|
||||||
|
<SuccessfulTests></SuccessfulTests>
|
||||||
|
<Statistics>
|
||||||
|
<Tests>5</Tests>
|
||||||
|
<FailuresTotal>5</FailuresTotal>
|
||||||
|
<Errors>1</Errors>
|
||||||
|
<Failures>4</Failures>
|
||||||
|
</Statistics>
|
||||||
|
</TestRun>
|
|
@ -0,0 +1,67 @@
|
||||||
|
.TH cppunit 1 "September 2001"
|
||||||
|
.SH NAME
|
||||||
|
cppunit-config - script to get information about the installed version of cppunit
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B cppunit-config
|
||||||
|
[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cflags]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.PP
|
||||||
|
\fIcppunit-config\fP is a tool that is used to configure to determine
|
||||||
|
the compiler and linker flags that should be used to compile and link
|
||||||
|
programs that use \fIcppunit\fP. It is also used internally to the .m4
|
||||||
|
macros for GNU autoconf that are included with \fIcppunit\fP.
|
||||||
|
.
|
||||||
|
.SH OPTIONS
|
||||||
|
.l
|
||||||
|
\fIcppunit-config\fP accepts the following options:
|
||||||
|
.TP 8
|
||||||
|
.B \-\-version
|
||||||
|
Print the currently installed version of \fIcppunit\fP on the standard
|
||||||
|
output.
|
||||||
|
.TP 8
|
||||||
|
.B \-\-libs
|
||||||
|
Print the linker flags that are necessary to link a \fIcppunit\fP
|
||||||
|
program.
|
||||||
|
.TP 8
|
||||||
|
.B \-\-cflags
|
||||||
|
Print the compiler flags that are necessary to compile a \fIcppunit\fP
|
||||||
|
program.
|
||||||
|
.TP 8
|
||||||
|
.B \-\-prefix
|
||||||
|
Print the prefix with which \fIcppunit\fP was compiled.
|
||||||
|
.TP 8
|
||||||
|
.B \-\-prefix=PREFIX
|
||||||
|
If specified, use PREFIX instead of the installation prefix that
|
||||||
|
\fIcppunit\fP was built with when computing the output for the
|
||||||
|
\-\-cflags and \-\-libs options. This option is also used for the exec
|
||||||
|
prefix if \-\-exec\-prefix was not specified. This option must be
|
||||||
|
specified before any \-\-libs or \-\-cflags options.
|
||||||
|
.TP 8
|
||||||
|
.B \-\-exec\-prefix
|
||||||
|
Print the exec\-prefix with which \fIcppunit\fP was compiled.
|
||||||
|
.TP 8
|
||||||
|
.B \-\-exec\-prefix=PREFIX
|
||||||
|
If specified, use PREFIX instead of the installation exec prefix that
|
||||||
|
\fIcppunit\fP was built with when computing the output for the
|
||||||
|
\-\-cflags and \-\-libs options. This option must be specified before
|
||||||
|
any \-\-libs or \-\-cflags options.
|
||||||
|
.SH COPYRIGHT
|
||||||
|
cppunit Copyright \(co 1996-2000 by Michael Feathers <mfeathers@objectmentor.com>
|
||||||
|
.PP
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or (at
|
||||||
|
your option) any later version.
|
||||||
|
.PP
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
.PP
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
.SH AUTHOR
|
||||||
|
This manpage is an almost word-for-word copy of the gtk-config
|
||||||
|
manpage, written by Owen Taylor. It was modified by E. Sommerlade
|
||||||
|
<eric@sommerla.de>.
|
|
@ -0,0 +1,98 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
exec_prefix_set=no
|
||||||
|
includedir=@includedir@
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
cat <<EOF
|
||||||
|
Usage: cppunit-config [OPTION] ...
|
||||||
|
|
||||||
|
Generic options
|
||||||
|
--version output CppUnit version information.
|
||||||
|
--help display this help and exit.
|
||||||
|
|
||||||
|
Compilation support options
|
||||||
|
--cflags print pre-processor and compiler flags
|
||||||
|
--libs print library linking information
|
||||||
|
|
||||||
|
Install directories CppUnit was configured to
|
||||||
|
--prefix[=DIR]
|
||||||
|
--exec-prefix[=DIR]
|
||||||
|
|
||||||
|
EOF
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
usage 1 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
while test $# -gt 0; do
|
||||||
|
case "$1" in
|
||||||
|
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||||
|
*) optarg= ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--prefix=*)
|
||||||
|
prefix=$optarg
|
||||||
|
if test $exec_prefix_set = no ; then
|
||||||
|
exec_prefix=$optarg
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--prefix)
|
||||||
|
echo_prefix=yes
|
||||||
|
;;
|
||||||
|
--exec-prefix=*)
|
||||||
|
exec_prefix=$optarg
|
||||||
|
exec_prefix_set=yes
|
||||||
|
;;
|
||||||
|
--exec-prefix)
|
||||||
|
echo_exec_prefix=yes
|
||||||
|
;;
|
||||||
|
--version)
|
||||||
|
echo @CPPUNIT_VERSION@
|
||||||
|
;;
|
||||||
|
--help)
|
||||||
|
usage 0
|
||||||
|
;;
|
||||||
|
--cflags)
|
||||||
|
echo_cflags=yes
|
||||||
|
;;
|
||||||
|
--libs)
|
||||||
|
echo_libs=yes
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage 1 1>&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test "$echo_prefix" = "yes"; then
|
||||||
|
echo $prefix
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$echo_exec_prefix" = "yes"; then
|
||||||
|
echo $exec_prefix
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$echo_cflags" = "yes"; then
|
||||||
|
if test "$includedir" != "/usr/include" ; then
|
||||||
|
echo -I$includedir
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$echo_libs" = "yes"; then
|
||||||
|
if test @libdir@ != /usr/lib ; then
|
||||||
|
my_linker_flags="-L@libdir@"
|
||||||
|
fi
|
||||||
|
echo ${my_linker_flags} -lcppunit @LIBADD_DL@
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
dnl
|
||||||
|
dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AM_PATH_CPPUNIT],
|
||||||
|
[
|
||||||
|
|
||||||
|
AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
|
||||||
|
cppunit_config_prefix="$withval", cppunit_config_prefix="")
|
||||||
|
AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
|
||||||
|
cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
|
||||||
|
|
||||||
|
if test x$cppunit_config_exec_prefix != x ; then
|
||||||
|
cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
|
||||||
|
if test x${CPPUNIT_CONFIG+set} != xset ; then
|
||||||
|
CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test x$cppunit_config_prefix != x ; then
|
||||||
|
cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
|
||||||
|
if test x${CPPUNIT_CONFIG+set} != xset ; then
|
||||||
|
CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
|
||||||
|
cppunit_version_min=$1
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
|
||||||
|
no_cppunit=""
|
||||||
|
if test "$CPPUNIT_CONFIG" = "no" ; then
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
no_cppunit=yes
|
||||||
|
else
|
||||||
|
CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
|
||||||
|
CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
|
||||||
|
cppunit_version=`$CPPUNIT_CONFIG --version`
|
||||||
|
|
||||||
|
cppunit_major_version=`echo $cppunit_version | \
|
||||||
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||||
|
cppunit_minor_version=`echo $cppunit_version | \
|
||||||
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||||
|
cppunit_micro_version=`echo $cppunit_version | \
|
||||||
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||||
|
|
||||||
|
cppunit_major_min=`echo $cppunit_version_min | \
|
||||||
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||||
|
if test "x${cppunit_major_min}" = "x" ; then
|
||||||
|
cppunit_major_min=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cppunit_minor_min=`echo $cppunit_version_min | \
|
||||||
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||||
|
if test "x${cppunit_minor_min}" = "x" ; then
|
||||||
|
cppunit_minor_min=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cppunit_micro_min=`echo $cppunit_version_min | \
|
||||||
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||||
|
if test "x${cppunit_micro_min}" = "x" ; then
|
||||||
|
cppunit_micro_min=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cppunit_version_proper=`expr \
|
||||||
|
$cppunit_major_version \> $cppunit_major_min \| \
|
||||||
|
$cppunit_major_version \= $cppunit_major_min \& \
|
||||||
|
$cppunit_minor_version \> $cppunit_minor_min \| \
|
||||||
|
$cppunit_major_version \= $cppunit_major_min \& \
|
||||||
|
$cppunit_minor_version \= $cppunit_minor_min \& \
|
||||||
|
$cppunit_micro_version \>= $cppunit_micro_min `
|
||||||
|
|
||||||
|
if test "$cppunit_version_proper" = "1" ; then
|
||||||
|
AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
no_cppunit=yes
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$no_cppunit" = x ; then
|
||||||
|
ifelse([$2], , :, [$2])
|
||||||
|
else
|
||||||
|
CPPUNIT_CFLAGS=""
|
||||||
|
CPPUNIT_LIBS=""
|
||||||
|
ifelse([$3], , :, [$3])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(CPPUNIT_CFLAGS)
|
||||||
|
AC_SUBST(CPPUNIT_LIBS)
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
libdir=@libdir@
|
||||||
|
includedir=@includedir@
|
||||||
|
|
||||||
|
Name: CppUnit
|
||||||
|
Description: The C++ Unit Test Library
|
||||||
|
Version: @CPPUNIT_VERSION@
|
||||||
|
Libs: -L${libdir} -lcppunit
|
||||||
|
Libs.private: @LIBADD_DL@
|
||||||
|
Cflags: -I${includedir}
|
|
@ -0,0 +1,65 @@
|
||||||
|
Name: cppunit
|
||||||
|
Version: 1.12.1
|
||||||
|
Release: 2
|
||||||
|
|
||||||
|
Summary: C++ Port of JUnit Testing Framework
|
||||||
|
License: LGPL
|
||||||
|
Group: Development/Libraries
|
||||||
|
Url: http://cppunit.sourceforge.net/
|
||||||
|
Source: ftp://download.sourceforge.net/pub/sourceforge/cppunit/cppunit-%version.tar.gz
|
||||||
|
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
|
%description
|
||||||
|
CppUnit is the C++ port of the famous JUnit framework for unit testing.
|
||||||
|
Test output is in XML for automatic testing and GUI based for supervised tests.
|
||||||
|
|
||||||
|
%package doc
|
||||||
|
Summary: HTML formatted API documention for Log for C++
|
||||||
|
Group: Development/Libraries
|
||||||
|
Requires: %name = %version
|
||||||
|
|
||||||
|
%description doc
|
||||||
|
The %name-doc package contains HTML formatted API documention generated by
|
||||||
|
the popular doxygen documentation generation tool.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure --enable-doxygen
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
|
||||||
|
rm -rf $RPM_BUILD_ROOT/%{_datadir}/cppunit
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%{_bindir}/cppunit-config
|
||||||
|
%{_bindir}/DllPlugInTester
|
||||||
|
%{_includedir}/cppunit/*
|
||||||
|
%{_mandir}/man1/*
|
||||||
|
%{_datadir}/aclocal/*
|
||||||
|
%{_libdir}/libcppunit*.so.*
|
||||||
|
%{_libdir}/libcppunit.so
|
||||||
|
%{_libdir}/libcppunit.a
|
||||||
|
%doc AUTHORS COPYING INSTALL NEWS README THANKS ChangeLog TODO BUGS doc/FAQ
|
||||||
|
|
||||||
|
%post -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%files doc
|
||||||
|
%doc doc/html/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Jul 4 2005 Patrice Dumas <dumas@centre-cired.fr>
|
||||||
|
- update using the fedora template
|
||||||
|
* Sat Apr 14 2001 Bastiaan Bakker <bastiaan.bakker@lifeline.nl>
|
||||||
|
- Initial release
|
|
@ -0,0 +1,65 @@
|
||||||
|
Name: cppunit
|
||||||
|
Version: @VERSION@
|
||||||
|
Release: 2
|
||||||
|
|
||||||
|
Summary: C++ Port of JUnit Testing Framework
|
||||||
|
License: LGPL
|
||||||
|
Group: Development/Libraries
|
||||||
|
Url: http://cppunit.sourceforge.net/
|
||||||
|
Source: ftp://download.sourceforge.net/pub/sourceforge/cppunit/cppunit-%version.tar.gz
|
||||||
|
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
|
%description
|
||||||
|
CppUnit is the C++ port of the famous JUnit framework for unit testing.
|
||||||
|
Test output is in XML for automatic testing and GUI based for supervised tests.
|
||||||
|
|
||||||
|
%package doc
|
||||||
|
Summary: HTML formatted API documention for Log for C++
|
||||||
|
Group: Development/Libraries
|
||||||
|
Requires: %name = %version
|
||||||
|
|
||||||
|
%description doc
|
||||||
|
The %name-doc package contains HTML formatted API documention generated by
|
||||||
|
the popular doxygen documentation generation tool.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure --enable-doxygen
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
|
||||||
|
rm -rf $RPM_BUILD_ROOT/%{_datadir}/cppunit
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%{_bindir}/cppunit-config
|
||||||
|
%{_bindir}/DllPlugInTester
|
||||||
|
%{_includedir}/cppunit/*
|
||||||
|
%{_mandir}/man1/*
|
||||||
|
%{_datadir}/aclocal/*
|
||||||
|
%{_libdir}/libcppunit*.so.*
|
||||||
|
%{_libdir}/libcppunit.so
|
||||||
|
%{_libdir}/libcppunit.a
|
||||||
|
%doc AUTHORS COPYING INSTALL NEWS README THANKS ChangeLog TODO BUGS doc/FAQ
|
||||||
|
|
||||||
|
%post -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%files doc
|
||||||
|
%doc doc/html/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Jul 4 2005 Patrice Dumas <dumas@centre-cired.fr>
|
||||||
|
- update using the fedora template
|
||||||
|
* Sat Apr 14 2001 Bastiaan Bakker <bastiaan.bakker@lifeline.nl>
|
||||||
|
- Initial release
|
|
@ -0,0 +1,604 @@
|
||||||
|
# Doxyfile 1.1.4
|
||||||
|
|
||||||
|
# This file describes the settings to be used by doxygen for a project
|
||||||
|
#
|
||||||
|
# All text after a hash (#) is considered a comment and will be ignored
|
||||||
|
# The format is:
|
||||||
|
# TAG = value [value, ...]
|
||||||
|
# Values that contain spaces should be placed between quotes (" ")
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# General configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||||
|
# by quotes) that should identify the project.
|
||||||
|
|
||||||
|
PROJECT_NAME = CppUnit
|
||||||
|
|
||||||
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||||
|
# This could be handy for archiving the generated documentation or
|
||||||
|
# if some version control system is used.
|
||||||
|
|
||||||
|
PROJECT_NUMBER = "Version @VERSION@"
|
||||||
|
|
||||||
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
|
# base path where the generated documentation will be put.
|
||||||
|
# If a relative path is entered, it will be relative to the location
|
||||||
|
# where doxygen was started. If left blank the current directory will be used.
|
||||||
|
|
||||||
|
OUTPUT_DIRECTORY = .
|
||||||
|
|
||||||
|
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
||||||
|
# documentation generated by doxygen is written. Doxygen will use this
|
||||||
|
# information to generate all constant output in the proper language.
|
||||||
|
# The default language is English, other supported languages are:
|
||||||
|
# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
|
||||||
|
# Spanish and Russian
|
||||||
|
|
||||||
|
OUTPUT_LANGUAGE = English
|
||||||
|
|
||||||
|
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
|
||||||
|
# top of each HTML page. The value NO (the default) enables the index and
|
||||||
|
# the value YES disables it.
|
||||||
|
|
||||||
|
DISABLE_INDEX = NO
|
||||||
|
|
||||||
|
# If the EXTRACT_ALL tag is set to YES all classes and functions will be
|
||||||
|
# included in the documentation, even if no documentation was available.
|
||||||
|
|
||||||
|
EXTRACT_ALL = YES
|
||||||
|
|
||||||
|
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
|
||||||
|
# will be included in the documentation.
|
||||||
|
|
||||||
|
EXTRACT_PRIVATE = YES
|
||||||
|
|
||||||
|
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
||||||
|
# undocumented members inside documented classes or files.
|
||||||
|
|
||||||
|
HIDE_UNDOC_MEMBERS = NO
|
||||||
|
|
||||||
|
# If the HIDE_UNDOC_CLASSESS tag is set to YES, Doxygen will hide all
|
||||||
|
# undocumented classes.
|
||||||
|
|
||||||
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
|
||||||
|
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
|
||||||
|
# include brief member descriptions after the members that are listed in
|
||||||
|
# the file and class documentation (similar to JavaDoc).
|
||||||
|
# Set to NO to disable this.
|
||||||
|
|
||||||
|
BRIEF_MEMBER_DESC = YES
|
||||||
|
|
||||||
|
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
|
||||||
|
# the brief description of a member or function before the detailed description.
|
||||||
|
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
|
||||||
|
# brief descriptions will be completely suppressed.
|
||||||
|
|
||||||
|
REPEAT_BRIEF = YES
|
||||||
|
|
||||||
|
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
|
||||||
|
# Doxygen will generate a detailed section even if there is only a brief
|
||||||
|
# description.
|
||||||
|
|
||||||
|
ALWAYS_DETAILED_SEC = NO
|
||||||
|
|
||||||
|
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
|
||||||
|
# path before files name in the file list and in the header files. If set
|
||||||
|
# to NO the shortest path that makes the file name unique will be used.
|
||||||
|
|
||||||
|
FULL_PATH_NAMES = NO
|
||||||
|
|
||||||
|
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
|
||||||
|
# can be used to strip a user defined part of the path. Stripping is
|
||||||
|
# only done if one of the specified strings matches the left-hand part of
|
||||||
|
# the path.
|
||||||
|
|
||||||
|
STRIP_FROM_PATH =
|
||||||
|
|
||||||
|
# The INTERNAL_DOCS tag determines if documentation
|
||||||
|
# that is typed after a \internal command is included. If the tag is set
|
||||||
|
# to NO (the default) then the documentation will be excluded.
|
||||||
|
# Set it to YES to include the internal documentation.
|
||||||
|
|
||||||
|
INTERNAL_DOCS = NO
|
||||||
|
|
||||||
|
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
|
||||||
|
# generate a class diagram (in Html and LaTeX) for classes with base or
|
||||||
|
# super classes. Setting the tag to NO turns the diagrams off.
|
||||||
|
|
||||||
|
CLASS_DIAGRAMS = YES
|
||||||
|
|
||||||
|
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
|
||||||
|
# be generated. Documented entities will be cross-referenced with these sources.
|
||||||
|
|
||||||
|
SOURCE_BROWSER = NO
|
||||||
|
|
||||||
|
# Setting the INLINE_SOURCES tag to YES will include the body
|
||||||
|
# of functions and classes directly in the documentation.
|
||||||
|
|
||||||
|
INLINE_SOURCES = NO
|
||||||
|
|
||||||
|
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
|
||||||
|
# doxygen to hide any special comment blocks from generated source code
|
||||||
|
# fragments. Normal C and C++ comments will always remain visible.
|
||||||
|
|
||||||
|
STRIP_CODE_COMMENTS = YES
|
||||||
|
|
||||||
|
# If the CASE_SENSE_NAMES tag is set to NO (the default) then Doxygen
|
||||||
|
# will only generate file names in lower case letters. If set to
|
||||||
|
# YES upper case letters are also allowed. This is useful if you have
|
||||||
|
# classes or files whose names only differ in case and if your file system
|
||||||
|
# supports case sensitive file names.
|
||||||
|
|
||||||
|
CASE_SENSE_NAMES = NO
|
||||||
|
|
||||||
|
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
|
||||||
|
# will generate a verbatim copy of the header file for each class for
|
||||||
|
# which an include is specified. Set to NO to disable this.
|
||||||
|
|
||||||
|
VERBATIM_HEADERS = YES
|
||||||
|
|
||||||
|
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
|
||||||
|
# will put list of the files that are included by a file in the documentation
|
||||||
|
# of that file.
|
||||||
|
|
||||||
|
SHOW_INCLUDE_FILES = YES
|
||||||
|
|
||||||
|
# If the JAVADOC_AUTOBRIEF tag is set to YES (the default) then Doxygen
|
||||||
|
# will interpret the first line (until the first dot) of a JavaDoc-style
|
||||||
|
# comment as the brief description. If set to NO, the Javadoc-style will
|
||||||
|
# behave just like the Qt-style comments.
|
||||||
|
|
||||||
|
JAVADOC_AUTOBRIEF = YES
|
||||||
|
|
||||||
|
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
|
||||||
|
# member inherits the documentation from any documented member that it
|
||||||
|
# reimplements.
|
||||||
|
|
||||||
|
INHERIT_DOCS = YES
|
||||||
|
|
||||||
|
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
|
||||||
|
# is inserted in the documentation for inline members.
|
||||||
|
|
||||||
|
INLINE_INFO = YES
|
||||||
|
|
||||||
|
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
|
||||||
|
# will sort the (detailed) documentation of file and class members
|
||||||
|
# alphabetically by member name. If set to NO the members will appear in
|
||||||
|
# declaration order.
|
||||||
|
|
||||||
|
SORT_MEMBER_DOCS = YES
|
||||||
|
|
||||||
|
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
|
||||||
|
# Doxygen uses this value to replace tabs by spaces in code fragments.
|
||||||
|
|
||||||
|
TAB_SIZE = 8
|
||||||
|
|
||||||
|
# The ENABLE_SECTIONS tag can be used to enable conditional
|
||||||
|
# documentation sections, marked by \if sectionname ... \endif.
|
||||||
|
|
||||||
|
ENABLED_SECTIONS =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to warning and progress messages
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The QUIET tag can be used to turn on/off the messages that are generated
|
||||||
|
# by doxygen. Possible values are YES and NO. If left blank NO is used.
|
||||||
|
|
||||||
|
QUIET = NO
|
||||||
|
|
||||||
|
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
||||||
|
# generated by doxygen. Possible values are YES and NO. If left blank
|
||||||
|
# NO is used.
|
||||||
|
|
||||||
|
WARNINGS = YES
|
||||||
|
|
||||||
|
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
|
||||||
|
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
|
||||||
|
# automatically be disabled.
|
||||||
|
|
||||||
|
WARN_IF_UNDOCUMENTED = YES
|
||||||
|
|
||||||
|
# The WARN_FORMAT tag determines the format of the warning messages that
|
||||||
|
# doxygen can produce. The string should contain the $file, $line, and $text
|
||||||
|
# tags, which will be replaced by the file and line number from which the
|
||||||
|
# warning originated and the warning text.
|
||||||
|
|
||||||
|
WARN_FORMAT = "$file:$line: $text"
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the input files
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The INPUT tag can be used to specify the files and/or directories that contain
|
||||||
|
# documented source files. You may enter file names like "myfile.cpp" or
|
||||||
|
# directories like "/usr/src/myproject". Separate the files or directories
|
||||||
|
# with spaces.
|
||||||
|
|
||||||
|
INPUT = @top_srcdir@/include @top_srcdir@/src/cppunit @srcdir@/other_documentation.dox @srcdir@/cookbook.dox @srcdir@/Money.dox
|
||||||
|
|
||||||
|
# If the value of the INPUT tag contains directories, you can use the
|
||||||
|
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||||
|
# and *.h) to filter out the source-files in the directories. If left
|
||||||
|
# blank all files are included.
|
||||||
|
|
||||||
|
FILE_PATTERNS = *.cpp *.h
|
||||||
|
|
||||||
|
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
||||||
|
# should be searched for input files as well. Possible values are YES and NO.
|
||||||
|
# If left blank NO is used.
|
||||||
|
|
||||||
|
RECURSIVE = YES
|
||||||
|
|
||||||
|
# The EXCLUDE tag can be used to specify files and/or directories that should
|
||||||
|
# excluded from the INPUT source files. This way you can easily exclude a
|
||||||
|
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||||
|
|
||||||
|
EXCLUDE =
|
||||||
|
|
||||||
|
# If the value of the INPUT tag contains directories, you can use the
|
||||||
|
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
||||||
|
# certain files from those directories.
|
||||||
|
|
||||||
|
EXCLUDE_PATTERNS = config-*.h
|
||||||
|
|
||||||
|
# The EXAMPLE_PATH tag can be used to specify one or more files or
|
||||||
|
# directories that contain example code fragments that are included (see
|
||||||
|
# the \include command).
|
||||||
|
|
||||||
|
EXAMPLE_PATH = ../examples
|
||||||
|
|
||||||
|
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||||
|
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||||
|
# and *.h) to filter out the source-files in the directories. If left
|
||||||
|
# blank all files are included.
|
||||||
|
|
||||||
|
EXAMPLE_PATTERNS = *.cpp *.h
|
||||||
|
|
||||||
|
# The IMAGE_PATH tag can be used to specify one or more files or
|
||||||
|
# directories that contain image that are included in the documentation (see
|
||||||
|
# the \image command).
|
||||||
|
|
||||||
|
IMAGE_PATH =
|
||||||
|
|
||||||
|
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||||
|
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||||
|
# by executing (via popen()) the command <filter> <input-file>, where <filter>
|
||||||
|
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
|
||||||
|
# input file. Doxygen will then use the output that the filter program writes
|
||||||
|
# to standard output.
|
||||||
|
|
||||||
|
INPUT_FILTER =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the alphabetical class index
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
|
||||||
|
# of all compounds will be generated. Enable this if the project
|
||||||
|
# contains a lot of classes, structs, unions or interfaces.
|
||||||
|
|
||||||
|
ALPHABETICAL_INDEX = YES
|
||||||
|
|
||||||
|
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
|
||||||
|
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
||||||
|
# in which this list will be split (can be a number in the range [1..20])
|
||||||
|
|
||||||
|
COLS_IN_ALPHA_INDEX = 5
|
||||||
|
|
||||||
|
# In case all classes in a project start with a common prefix, all
|
||||||
|
# classes will be put under the same header in the alphabetical index.
|
||||||
|
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
|
||||||
|
# should be ignored while generating the index headers.
|
||||||
|
|
||||||
|
IGNORE_PREFIX =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the HTML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
|
||||||
|
# generate HTML output.
|
||||||
|
|
||||||
|
GENERATE_HTML = @enable_html_docs@
|
||||||
|
|
||||||
|
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
|
||||||
|
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||||
|
# put in front of it. If left blank `html' will be used as the default path.
|
||||||
|
|
||||||
|
HTML_OUTPUT = html
|
||||||
|
|
||||||
|
# The HTML_HEADER tag can be used to specify a personal HTML header for
|
||||||
|
# each generated HTML page. If it is left blank doxygen will generate a
|
||||||
|
# standard header.
|
||||||
|
|
||||||
|
HTML_HEADER = @srcdir@/header.html
|
||||||
|
|
||||||
|
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
|
||||||
|
# each generated HTML page. If it is left blank doxygen will generate a
|
||||||
|
# standard footer.
|
||||||
|
|
||||||
|
HTML_FOOTER = @srcdir@/footer.html
|
||||||
|
|
||||||
|
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
|
||||||
|
# style sheet that is used by each HTML page. It can be used to
|
||||||
|
# fine-tune the look of the HTML output. If the tag is left blank doxygen
|
||||||
|
# will generate a default style sheet
|
||||||
|
|
||||||
|
HTML_STYLESHEET =
|
||||||
|
|
||||||
|
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
|
||||||
|
# files or namespaces will be aligned in HTML using tables. If set to
|
||||||
|
# NO a bullet list will be used.
|
||||||
|
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
|
|
||||||
|
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
||||||
|
# will be generated that can be used as input for tools like the
|
||||||
|
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
|
||||||
|
# of the generated HTML documentation.
|
||||||
|
|
||||||
|
GENERATE_HTMLHELP = NO
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the LaTeX output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
|
||||||
|
# generate Latex output.
|
||||||
|
|
||||||
|
GENERATE_LATEX = @enable_latex_docs@
|
||||||
|
|
||||||
|
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
|
||||||
|
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||||
|
# put in front of it. If left blank `latex' will be used as the default path.
|
||||||
|
|
||||||
|
LATEX_OUTPUT = latex
|
||||||
|
|
||||||
|
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
|
||||||
|
# LaTeX documents. This may be useful for small projects and may help to
|
||||||
|
# save some trees in general.
|
||||||
|
|
||||||
|
COMPACT_LATEX = NO
|
||||||
|
|
||||||
|
# The PAPER_TYPE tag can be used to set the paper type that is used
|
||||||
|
# by the printer. Possible values are: a4, a4wide, letter, legal and
|
||||||
|
# executive. If left blank a4wide will be used.
|
||||||
|
|
||||||
|
PAPER_TYPE = a4wide
|
||||||
|
|
||||||
|
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
|
||||||
|
# packages that should be included in the LaTeX output.
|
||||||
|
|
||||||
|
EXTRA_PACKAGES =
|
||||||
|
|
||||||
|
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
|
||||||
|
# the generated latex document. The header should contain everything until
|
||||||
|
# the first chapter. If it is left blank doxygen will generate a
|
||||||
|
# standard header. Notice: only use this tag if you know what you are doing!
|
||||||
|
|
||||||
|
LATEX_HEADER =
|
||||||
|
|
||||||
|
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
|
||||||
|
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
|
||||||
|
# contain links (just like the HTML output) instead of page references
|
||||||
|
# This makes the output suitable for online browsing using a pdf viewer.
|
||||||
|
|
||||||
|
PDF_HYPERLINKS = NO
|
||||||
|
|
||||||
|
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
|
||||||
|
# command to the generated LaTeX files. This will instruct LaTeX to keep
|
||||||
|
# running if errors occur, instead of asking the user for help.
|
||||||
|
# This option is also used when generating formulas in HTML.
|
||||||
|
|
||||||
|
LATEX_BATCHMODE = NO
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the RTF output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
|
||||||
|
# For now this is experimental and is disabled by default. The RTF output
|
||||||
|
# is optimised for Word 97 and may not look too pretty with other readers
|
||||||
|
# or editors.
|
||||||
|
|
||||||
|
GENERATE_RTF = NO
|
||||||
|
|
||||||
|
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
|
||||||
|
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||||
|
# put in front of it. If left blank `rtf' will be used as the default path.
|
||||||
|
|
||||||
|
RTF_OUTPUT = rtf
|
||||||
|
|
||||||
|
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
|
||||||
|
# RTF documents. This may be useful for small projects and may help to
|
||||||
|
# save some trees in general.
|
||||||
|
|
||||||
|
COMPACT_RTF = NO
|
||||||
|
|
||||||
|
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
|
||||||
|
# will contain hyperlink fields. The RTF file will
|
||||||
|
# contain links (just like the HTML output) instead of page references.
|
||||||
|
# This makes the output suitable for online browsing using a WORD or other.
|
||||||
|
# programs which support those fields.
|
||||||
|
# Note: wordpad (write) and others do not support links.
|
||||||
|
|
||||||
|
RTF_HYPERLINKS = NO
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the man page output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
|
||||||
|
# generate man pages
|
||||||
|
|
||||||
|
GENERATE_MAN = NO
|
||||||
|
|
||||||
|
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
|
||||||
|
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||||
|
# put in front of it. If left blank `man' will be used as the default path.
|
||||||
|
|
||||||
|
MAN_OUTPUT = man
|
||||||
|
|
||||||
|
# The MAN_EXTENSION tag determines the extension that is added to
|
||||||
|
# the generated man pages (default is the subroutine's section .3)
|
||||||
|
|
||||||
|
MAN_EXTENSION = .3
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the preprocessor
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
|
||||||
|
# evaluate all C-preprocessor directives found in the sources and include
|
||||||
|
# files.
|
||||||
|
|
||||||
|
ENABLE_PREPROCESSING = YES
|
||||||
|
|
||||||
|
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
|
||||||
|
# names in the source code. If set to NO (the default) only conditional
|
||||||
|
# compilation will be performed.
|
||||||
|
|
||||||
|
MACRO_EXPANSION = NO
|
||||||
|
|
||||||
|
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
|
||||||
|
# in the INCLUDE_PATH (see below) will be search if a #include is found.
|
||||||
|
|
||||||
|
SEARCH_INCLUDES = YES
|
||||||
|
|
||||||
|
# The INCLUDE_PATH tag can be used to specify one or more directories that
|
||||||
|
# contain include files that are not input files but should be processed by
|
||||||
|
# the preprocessor.
|
||||||
|
|
||||||
|
INCLUDE_PATH =
|
||||||
|
|
||||||
|
# The PREDEFINED tag can be used to specify one or more macro names that
|
||||||
|
# are defined before the preprocessor is started (similar to the -D option of
|
||||||
|
# gcc). The argument of the tag is a list of macros of the form: name
|
||||||
|
# or name=definition (no spaces). If the definition and the = are
|
||||||
|
# omitted =1 is assumed.
|
||||||
|
|
||||||
|
PREDEFINED = CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION \
|
||||||
|
CPPUNIT_HAVE_NAMESPACES=1 \
|
||||||
|
CPPUNIT_NS_BEGIN="namespace CppUnit {" \
|
||||||
|
CPPUNIT_NS_END=} \
|
||||||
|
CPPUNIT_NS=CppUnit
|
||||||
|
|
||||||
|
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
|
||||||
|
# then the macro expansion is limited to the macros specified with the
|
||||||
|
# PREDEFINED tag.
|
||||||
|
|
||||||
|
EXPAND_ONLY_PREDEF = YES
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::addtions related to external references
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The TAGFILES tag can be used to specify one or more tagfiles.
|
||||||
|
|
||||||
|
TAGFILES =
|
||||||
|
|
||||||
|
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
|
||||||
|
# a tag file that is based on the input files it reads.
|
||||||
|
|
||||||
|
GENERATE_TAGFILE =
|
||||||
|
|
||||||
|
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
|
||||||
|
# in the class index. If set to NO only the inherited external classes
|
||||||
|
# will be listed.
|
||||||
|
|
||||||
|
ALLEXTERNALS = NO
|
||||||
|
|
||||||
|
# The PERL_PATH should be the absolute path and name of the perl script
|
||||||
|
# interpreter (i.e. the result of `which perl').
|
||||||
|
|
||||||
|
PERL_PATH = /usr/bin/perl
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the dot tool
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
|
||||||
|
# available from the path. This tool is part of Graphviz, a graph visualization
|
||||||
|
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
|
||||||
|
# have no effect if this option is set to NO (the default)
|
||||||
|
|
||||||
|
HAVE_DOT = @enable_dot@
|
||||||
|
|
||||||
|
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||||
|
# will generate a graph for each documented class showing the direct and
|
||||||
|
# indirect inheritance relations. Setting this tag to YES will force the
|
||||||
|
# the CLASS_DIAGRAMS tag to NO.
|
||||||
|
|
||||||
|
CLASS_GRAPH = YES
|
||||||
|
|
||||||
|
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||||
|
# will generate a graph for each documented class showing the direct and
|
||||||
|
# indirect implementation dependencies (inheritance, containment, and
|
||||||
|
# class references variables) of the class with other documented classes.
|
||||||
|
|
||||||
|
COLLABORATION_GRAPH = YES
|
||||||
|
|
||||||
|
# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
|
||||||
|
# YES then doxygen will generate a graph for each documented file showing
|
||||||
|
# the direct and indirect include dependencies of the file with other
|
||||||
|
# documented files.
|
||||||
|
|
||||||
|
INCLUDE_GRAPH = YES
|
||||||
|
|
||||||
|
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
|
||||||
|
# will graphical hierarchy of all classes instead of a textual one.
|
||||||
|
|
||||||
|
GRAPHICAL_HIERARCHY = YES
|
||||||
|
|
||||||
|
# This tag can be used to specify the path where the dot tool can be found.
|
||||||
|
# If left blank, it is assumed the dot tool can be found on the path.
|
||||||
|
|
||||||
|
DOT_PATH =
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::addtions related to the search engine
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The SEARCHENGINE tag specifies whether or not a search engine should be
|
||||||
|
# used. If set to NO the values of all tags below this one will be ignored.
|
||||||
|
|
||||||
|
SEARCHENGINE = NO
|
||||||
|
|
||||||
|
# The CGI_NAME tag should be the name of the CGI script that
|
||||||
|
# starts the search engine (doxysearch) with the correct parameters.
|
||||||
|
# A script with this name will be generated by doxygen.
|
||||||
|
|
||||||
|
CGI_NAME = search.cgi
|
||||||
|
|
||||||
|
# The CGI_URL tag should be the absolute URL to the directory where the
|
||||||
|
# cgi binaries are located. See the documentation of your http daemon for
|
||||||
|
# details.
|
||||||
|
|
||||||
|
CGI_URL =
|
||||||
|
|
||||||
|
# The DOC_URL tag should be the absolute URL to the directory where the
|
||||||
|
# documentation is located. If left blank the absolute path to the
|
||||||
|
# documentation, with file:// prepended to it, will be used.
|
||||||
|
|
||||||
|
DOC_URL =
|
||||||
|
|
||||||
|
# The DOC_ABSPATH tag should be the absolute path to the directory where the
|
||||||
|
# documentation is located. If left blank the directory on the local machine
|
||||||
|
# will be used.
|
||||||
|
|
||||||
|
DOC_ABSPATH =
|
||||||
|
|
||||||
|
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
|
||||||
|
# is installed.
|
||||||
|
|
||||||
|
BIN_ABSPATH = /usr/local/bin/
|
||||||
|
|
||||||
|
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
|
||||||
|
# documentation generated for other projects. This allows doxysearch to search
|
||||||
|
# the documentation for these projects as well.
|
||||||
|
|
||||||
|
EXT_DOC_PATHS =
|
|
@ -0,0 +1,31 @@
|
||||||
|
Frequently Asked Questions:
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
1) Questions relating to CppUnit
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
1.1) Isn't there an easier way to write unit tests than using TestCaller ?
|
||||||
|
|
||||||
|
Yes, there is. Macros have been created to take care of the repetitive
|
||||||
|
work. Look up include/extensions/HelperMacros.h in CppUnit documentation.
|
||||||
|
Most of CppUnit test suite is also written that way since they remain
|
||||||
|
compatible as CppUnit evolve. They also use RTTI if available.
|
||||||
|
|
||||||
|
|
||||||
|
2) Questions related to Microsoft Visual VC++
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
2.1) Why does the compiler report an error when linking with CppUnit library?
|
||||||
|
|
||||||
|
You most likely are not using the same C-RunTime library as CppUnit.
|
||||||
|
In Release configuration, CppUnit use "Mulithreaded DLL".
|
||||||
|
In Debug configurations, CppUnit use "Debug Multihreaded DLL".
|
||||||
|
Check that Projects/Settings.../C++/Code Generation is indeed using
|
||||||
|
the correct library.
|
||||||
|
|
||||||
|
2.2) Why does CppUnit generate warning 4786:... when compiling ?
|
||||||
|
|
||||||
|
I really don't have a clue. All CppUnit's headers starts by either
|
||||||
|
including Portability.h or another CppUnit's header. Portability.h includes
|
||||||
|
config-msvc6.h which disable that specific warning. The warning is generated
|
||||||
|
by TestFactoryRegistry::m_factories. A solution to this problem is welcome.
|
|
@ -0,0 +1,67 @@
|
||||||
|
EXTRA_DIST = $(doxygen_input) $(static_pages)
|
||||||
|
|
||||||
|
doxygen_input = cookbook.dox other_documentation.dox header.html footer.html Money.dox
|
||||||
|
static_pages = FAQ
|
||||||
|
|
||||||
|
|
||||||
|
# DOC is defined if installer requests doc generation.
|
||||||
|
# For now, we only install HTML documentation. We could install manpages
|
||||||
|
# using the following
|
||||||
|
# man_MANS = man/man3/CppUnit.3
|
||||||
|
# man/man3/CppUnit.3: dox
|
||||||
|
# and an extra copy or two in the install-data-hook.
|
||||||
|
# However, the manpages do not appear to be tremendously useful, so
|
||||||
|
# let's not bother.
|
||||||
|
|
||||||
|
if DOC
|
||||||
|
|
||||||
|
htmldir = $(pkgdatadir)/html
|
||||||
|
html_DATA = $(static_pages) html/index.html
|
||||||
|
|
||||||
|
install-data-hook:
|
||||||
|
cp -pR html/* $(DESTDIR)$(htmldir)
|
||||||
|
|
||||||
|
# Automake's "distcheck" is sensitive to having files left over
|
||||||
|
# after "make uninstall", so we have to clean up the install hook.
|
||||||
|
uninstall-local:
|
||||||
|
rm -rf $(DESTDIR)$(htmldir)
|
||||||
|
|
||||||
|
dox: html/index.html
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# We repeat the three targets in both the "if" and "else" clauses
|
||||||
|
# of the conditional, because the generated makefile will contain
|
||||||
|
# references to the targets (target "install" depends on target
|
||||||
|
# "install-datahook", for example), and some make programs get upset
|
||||||
|
# if no target exists.
|
||||||
|
|
||||||
|
install-data-hook:
|
||||||
|
uninstall-local:
|
||||||
|
dox:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
all-local: dox
|
||||||
|
|
||||||
|
|
||||||
|
html/index.html: Doxyfile $(doxygen_input)
|
||||||
|
"@DOXYGEN@"
|
||||||
|
|
||||||
|
|
||||||
|
# Make tarfile to distribute the HTML documentation.
|
||||||
|
doc-dist: dox
|
||||||
|
cp $(static_pages) html
|
||||||
|
tar -czf $(PACKAGE)-docs-$(VERSION).tar.gz -C html .
|
||||||
|
|
||||||
|
pdf: @PACKAGE@.pdf
|
||||||
|
@PACKAGE@.pdf:
|
||||||
|
$(MAKE) -C ./latex pdf
|
||||||
|
ln -s ./latex/refman.ps @PACKAGE@.ps
|
||||||
|
ln -s ./latex/refman.pdf @PACKAGE@.pdf
|
||||||
|
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
$(RM) -r latex
|
||||||
|
$(RM) -r html man @PACKAGE@.ps @PACKAGE@.pdf
|
|
@ -0,0 +1,441 @@
|
||||||
|
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
VPATH = @srcdir@
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
install_sh_DATA = $(install_sh) -c -m 644
|
||||||
|
install_sh_PROGRAM = $(install_sh) -c
|
||||||
|
install_sh_SCRIPT = $(install_sh) -c
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = $(program_transform_name)
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
build_triplet = @build@
|
||||||
|
host_triplet = @host@
|
||||||
|
subdir = doc
|
||||||
|
DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \
|
||||||
|
$(srcdir)/Makefile.in
|
||||||
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
|
am__aclocal_m4_deps = \
|
||||||
|
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_rtti.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_string_compare_string_first.m4 \
|
||||||
|
$(top_srcdir)/config/ac_dll.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_gcc_abi_demangle.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_have_isfinite.m4 \
|
||||||
|
$(top_srcdir)/config/bb_enable_doxygen.m4 \
|
||||||
|
$(top_srcdir)/configure.in
|
||||||
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
|
$(ACLOCAL_M4)
|
||||||
|
mkinstalldirs = $(install_sh) -d
|
||||||
|
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||||
|
CONFIG_CLEAN_FILES = Doxyfile
|
||||||
|
SOURCES =
|
||||||
|
DIST_SOURCES =
|
||||||
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
|
am__vpath_adj = case $$p in \
|
||||||
|
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||||
|
*) f=$$p;; \
|
||||||
|
esac;
|
||||||
|
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||||
|
am__installdirs = "$(DESTDIR)$(htmldir)"
|
||||||
|
htmlDATA_INSTALL = $(INSTALL_DATA)
|
||||||
|
DATA = $(html_DATA)
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AR = @AR@
|
||||||
|
AS = @AS@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AWK = @AWK@
|
||||||
|
CC = @CC@
|
||||||
|
CCDEPMODE = @CCDEPMODE@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
CPP = @CPP@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_BINARY_AGE = @CPPUNIT_BINARY_AGE@
|
||||||
|
CPPUNIT_INTERFACE_AGE = @CPPUNIT_INTERFACE_AGE@
|
||||||
|
CPPUNIT_MAJOR_VERSION = @CPPUNIT_MAJOR_VERSION@
|
||||||
|
CPPUNIT_MICRO_VERSION = @CPPUNIT_MICRO_VERSION@
|
||||||
|
CPPUNIT_MINOR_VERSION = @CPPUNIT_MINOR_VERSION@
|
||||||
|
CPPUNIT_VERSION = @CPPUNIT_VERSION@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
|
CYGPATH_W = @CYGPATH_W@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
DLLTOOL = @DLLTOOL@
|
||||||
|
DOT = @DOT@
|
||||||
|
DOXYGEN = @DOXYGEN@
|
||||||
|
DSYMUTIL = @DSYMUTIL@
|
||||||
|
ECHO = @ECHO@
|
||||||
|
ECHO_C = @ECHO_C@
|
||||||
|
ECHO_N = @ECHO_N@
|
||||||
|
ECHO_T = @ECHO_T@
|
||||||
|
EGREP = @EGREP@
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
F77 = @F77@
|
||||||
|
FFLAGS = @FFLAGS@
|
||||||
|
GREP = @GREP@
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
LIBADD_DL = @LIBADD_DL@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LN_S = @LN_S@
|
||||||
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_AGE = @LT_AGE@
|
||||||
|
LT_CURRENT = @LT_CURRENT@
|
||||||
|
LT_RELEASE = @LT_RELEASE@
|
||||||
|
LT_REVISION = @LT_REVISION@
|
||||||
|
MAKEINFO = @MAKEINFO@
|
||||||
|
MKDIR_P = @MKDIR_P@
|
||||||
|
NMEDIT = @NMEDIT@
|
||||||
|
OBJDUMP = @OBJDUMP@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||||
|
PACKAGE_NAME = @PACKAGE_NAME@
|
||||||
|
PACKAGE_STRING = @PACKAGE_STRING@
|
||||||
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
SED = @SED@
|
||||||
|
SET_MAKE = @SET_MAKE@
|
||||||
|
SHELL = @SHELL@
|
||||||
|
STRIP = @STRIP@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
abs_builddir = @abs_builddir@
|
||||||
|
abs_srcdir = @abs_srcdir@
|
||||||
|
abs_top_builddir = @abs_top_builddir@
|
||||||
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
|
ac_ct_F77 = @ac_ct_F77@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__leading_dot = @am__leading_dot@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
am__tar = @am__tar@
|
||||||
|
am__untar = @am__untar@
|
||||||
|
bindir = @bindir@
|
||||||
|
build = @build@
|
||||||
|
build_alias = @build_alias@
|
||||||
|
build_cpu = @build_cpu@
|
||||||
|
build_os = @build_os@
|
||||||
|
build_vendor = @build_vendor@
|
||||||
|
builddir = @builddir@
|
||||||
|
datadir = @datadir@
|
||||||
|
datarootdir = @datarootdir@
|
||||||
|
docdir = @docdir@
|
||||||
|
dvidir = @dvidir@
|
||||||
|
enable_dot = @enable_dot@
|
||||||
|
enable_html_docs = @enable_html_docs@
|
||||||
|
enable_latex_docs = @enable_latex_docs@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
host = @host@
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_cpu = @host_cpu@
|
||||||
|
host_os = @host_os@
|
||||||
|
host_vendor = @host_vendor@
|
||||||
|
|
||||||
|
# DOC is defined if installer requests doc generation.
|
||||||
|
# For now, we only install HTML documentation. We could install manpages
|
||||||
|
# using the following
|
||||||
|
# man_MANS = man/man3/CppUnit.3
|
||||||
|
# man/man3/CppUnit.3: dox
|
||||||
|
# and an extra copy or two in the install-data-hook.
|
||||||
|
# However, the manpages do not appear to be tremendously useful, so
|
||||||
|
# let's not bother.
|
||||||
|
@DOC_TRUE@htmldir = $(pkgdatadir)/html
|
||||||
|
htmldir = @htmldir@
|
||||||
|
includedir = @includedir@
|
||||||
|
infodir = @infodir@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
libdir = @libdir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
localedir = @localedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
mandir = @mandir@
|
||||||
|
mkdir_p = @mkdir_p@
|
||||||
|
oldincludedir = @oldincludedir@
|
||||||
|
pdfdir = @pdfdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
program_transform_name = @program_transform_name@
|
||||||
|
psdir = @psdir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
target_alias = @target_alias@
|
||||||
|
top_builddir = @top_builddir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
EXTRA_DIST = $(doxygen_input) $(static_pages)
|
||||||
|
doxygen_input = cookbook.dox other_documentation.dox header.html footer.html Money.dox
|
||||||
|
static_pages = FAQ
|
||||||
|
@DOC_TRUE@html_DATA = $(static_pages) html/index.html
|
||||||
|
all: all-am
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
|
@for dep in $?; do \
|
||||||
|
case '$(am__configure_deps)' in \
|
||||||
|
*$$dep*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||||
|
&& exit 0; \
|
||||||
|
exit 1;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
|
||||||
|
cd $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu doc/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
@case '$?' in \
|
||||||
|
*config.status*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
|
*) \
|
||||||
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
|
esac;
|
||||||
|
|
||||||
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
|
$(top_srcdir)/configure: $(am__configure_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||||
|
|
||||||
|
mostlyclean-libtool:
|
||||||
|
-rm -f *.lo
|
||||||
|
|
||||||
|
clean-libtool:
|
||||||
|
-rm -rf .libs _libs
|
||||||
|
install-htmlDATA: $(html_DATA)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
|
||||||
|
@list='$(html_DATA)'; for p in $$list; do \
|
||||||
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " $(htmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||||
|
$(htmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-htmlDATA:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(html_DATA)'; for p in $$list; do \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " rm -f '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||||
|
rm -f "$(DESTDIR)$(htmldir)/$$f"; \
|
||||||
|
done
|
||||||
|
tags: TAGS
|
||||||
|
TAGS:
|
||||||
|
|
||||||
|
ctags: CTAGS
|
||||||
|
CTAGS:
|
||||||
|
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
list='$(DISTFILES)'; \
|
||||||
|
dist_files=`for file in $$list; do echo $$file; done | \
|
||||||
|
sed -e "s|^$$srcdirstrip/||;t" \
|
||||||
|
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||||
|
case $$dist_files in \
|
||||||
|
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||||
|
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||||
|
sort -u` ;; \
|
||||||
|
esac; \
|
||||||
|
for file in $$dist_files; do \
|
||||||
|
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||||
|
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
fi; \
|
||||||
|
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
else \
|
||||||
|
test -f $(distdir)/$$file \
|
||||||
|
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
check-am: all-am
|
||||||
|
check: check-am
|
||||||
|
all-am: Makefile $(DATA) all-local
|
||||||
|
installdirs:
|
||||||
|
for dir in "$(DESTDIR)$(htmldir)"; do \
|
||||||
|
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||||
|
done
|
||||||
|
install: install-am
|
||||||
|
install-exec: install-exec-am
|
||||||
|
install-data: install-data-am
|
||||||
|
uninstall: uninstall-am
|
||||||
|
|
||||||
|
install-am: all-am
|
||||||
|
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||||
|
|
||||||
|
installcheck: installcheck-am
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
`test -z '$(STRIP)' || \
|
||||||
|
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
@echo "This command is intended for maintainers to use"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
clean: clean-am
|
||||||
|
|
||||||
|
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-am
|
||||||
|
-rm -f Makefile
|
||||||
|
distclean-am: clean-am distclean-generic
|
||||||
|
|
||||||
|
dvi: dvi-am
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
html: html-am
|
||||||
|
|
||||||
|
info: info-am
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am: install-htmlDATA
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
|
||||||
|
|
||||||
|
install-dvi: install-dvi-am
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-html: install-html-am
|
||||||
|
|
||||||
|
install-info: install-info-am
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
|
||||||
|
install-pdf: install-pdf-am
|
||||||
|
|
||||||
|
install-ps: install-ps-am
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-am
|
||||||
|
-rm -f Makefile
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-am
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||||
|
|
||||||
|
pdf-am:
|
||||||
|
|
||||||
|
ps: ps-am
|
||||||
|
|
||||||
|
ps-am:
|
||||||
|
|
||||||
|
uninstall-am: uninstall-htmlDATA uninstall-local
|
||||||
|
|
||||||
|
.MAKE: install-am install-data-am install-strip
|
||||||
|
|
||||||
|
.PHONY: all all-am all-local check check-am clean clean-generic \
|
||||||
|
clean-libtool clean-local distclean distclean-generic \
|
||||||
|
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||||
|
install install-am install-data install-data-am \
|
||||||
|
install-data-hook install-dvi install-dvi-am install-exec \
|
||||||
|
install-exec-am install-html install-html-am install-htmlDATA \
|
||||||
|
install-info install-info-am install-man install-pdf \
|
||||||
|
install-pdf-am install-ps install-ps-am install-strip \
|
||||||
|
installcheck installcheck-am installdirs maintainer-clean \
|
||||||
|
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||||
|
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||||
|
uninstall-htmlDATA uninstall-local
|
||||||
|
|
||||||
|
|
||||||
|
@DOC_TRUE@install-data-hook:
|
||||||
|
@DOC_TRUE@ cp -pR html/* $(DESTDIR)$(htmldir)
|
||||||
|
|
||||||
|
# Automake's "distcheck" is sensitive to having files left over
|
||||||
|
# after "make uninstall", so we have to clean up the install hook.
|
||||||
|
@DOC_TRUE@uninstall-local:
|
||||||
|
@DOC_TRUE@ rm -rf $(DESTDIR)$(htmldir)
|
||||||
|
|
||||||
|
@DOC_TRUE@dox: html/index.html
|
||||||
|
|
||||||
|
# We repeat the three targets in both the "if" and "else" clauses
|
||||||
|
# of the conditional, because the generated makefile will contain
|
||||||
|
# references to the targets (target "install" depends on target
|
||||||
|
# "install-datahook", for example), and some make programs get upset
|
||||||
|
# if no target exists.
|
||||||
|
|
||||||
|
@DOC_FALSE@install-data-hook:
|
||||||
|
@DOC_FALSE@uninstall-local:
|
||||||
|
@DOC_FALSE@dox:
|
||||||
|
|
||||||
|
all-local: dox
|
||||||
|
|
||||||
|
html/index.html: Doxyfile $(doxygen_input)
|
||||||
|
"@DOXYGEN@"
|
||||||
|
|
||||||
|
# Make tarfile to distribute the HTML documentation.
|
||||||
|
doc-dist: dox
|
||||||
|
cp $(static_pages) html
|
||||||
|
tar -czf $(PACKAGE)-docs-$(VERSION).tar.gz -C html .
|
||||||
|
|
||||||
|
pdf: @PACKAGE@.pdf
|
||||||
|
@PACKAGE@.pdf:
|
||||||
|
$(MAKE) -C ./latex pdf
|
||||||
|
ln -s ./latex/refman.ps @PACKAGE@.ps
|
||||||
|
ln -s ./latex/refman.pdf @PACKAGE@.pdf
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
$(RM) -r latex
|
||||||
|
$(RM) -r html man @PACKAGE@.ps @PACKAGE@.pdf
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
|
@ -0,0 +1,558 @@
|
||||||
|
/*! \page money_example Money, a step by step example
|
||||||
|
|
||||||
|
\section Table of contents
|
||||||
|
|
||||||
|
- \ref sec_setting_vc
|
||||||
|
- \ref sec_setting_unix
|
||||||
|
- \ref sec_running_test
|
||||||
|
- \ref sec_adding_testfixture
|
||||||
|
- \ref sec_first_tests
|
||||||
|
- \ref sec_more_tests
|
||||||
|
- \ref sec_credits
|
||||||
|
|
||||||
|
The example explored in this article can be found in \c examples/Money/.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section sec_setting_vc Setting up your project (VC++)
|
||||||
|
|
||||||
|
\subsection sec_install Compiling and installing CppUnit libaries
|
||||||
|
|
||||||
|
In the following document, $CPPUNIT is the directory where you unpacked %CppUnit:
|
||||||
|
$CPPUNIT/:
|
||||||
|
include/
|
||||||
|
lib/
|
||||||
|
src/
|
||||||
|
cppunit/
|
||||||
|
|
||||||
|
First, you need to compile %CppUnit libraries:
|
||||||
|
- Open the $CPPUNIT/src/CppUnitLibraries.dsw workspace in VC++.
|
||||||
|
- In the 'Build' menu, select 'Batch Build...'
|
||||||
|
- In the batch build dialog, select all projects and press the build button.
|
||||||
|
- The resulting libraries can be found in the $CPPUNIT/lib/ directory.
|
||||||
|
|
||||||
|
Once it is done, you need to tell VC++ where are the includes and libraries
|
||||||
|
to use them in other projects. Open the 'Tools/Options...' dialog, and in the
|
||||||
|
'Directories' tab, select 'include files' in the combo. Add a new entry that
|
||||||
|
points to $CPPUNIT/include/. Change to 'libraries files' in the combo and
|
||||||
|
add a new entry for $CPPUNIT/lib/. Repeat the process with 'source files'
|
||||||
|
and add $CPPUNIT/src/cppunit/.
|
||||||
|
|
||||||
|
\subsection sec_getting_started Getting started
|
||||||
|
|
||||||
|
Creates a new console application ('a simple application' template will do).
|
||||||
|
Let's link %CppUnit library to our project. In the project settings:
|
||||||
|
- In tab 'C++', combo 'Code generation', set the combo to 'Multithreaded DLL'
|
||||||
|
for the release configuration, and 'Debug Multithreaded DLL' for the debug
|
||||||
|
configure,
|
||||||
|
- In tab 'C++', combo 'C++ langage', for All Configurations, check
|
||||||
|
'enable Run-Time Type Information (RTTI)',
|
||||||
|
- In tab 'Link', in the 'Object/library modules' field, add cppunitd.lib for
|
||||||
|
the debug configuration, and cppunit.lib for the release configuration.
|
||||||
|
|
||||||
|
We're done !
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section sec_setting_unix Setting up your project (Unix)
|
||||||
|
We'll use \c autoconf and \c automake to make it simple to
|
||||||
|
create our build environment. Create a directory somewhere to
|
||||||
|
hold the code we're going to build. Create \c configure.in and
|
||||||
|
\c Makefile.am in that directory to get started.
|
||||||
|
|
||||||
|
<tt>configure.in</tt>
|
||||||
|
\verbatim
|
||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
AC_INIT(Makefile.am)
|
||||||
|
AM_INIT_AUTOMAKE(money,0.1)
|
||||||
|
AM_PATH_CPPUNIT(1.9.6)
|
||||||
|
AC_PROG_CXX
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
AC_OUTPUT(Makefile)\endverbatim
|
||||||
|
|
||||||
|
<tt>Makefile.am</tt>
|
||||||
|
\verbatim
|
||||||
|
# Rules for the test code (use `make check` to execute)
|
||||||
|
TESTS = MoneyApp
|
||||||
|
check_PROGRAMS = $(TESTS)
|
||||||
|
MoneyApp_SOURCES = Money.h MoneyTest.h MoneyTest.cpp MoneyApp.cpp
|
||||||
|
MoneyApp_CXXFLAGS = $(CPPUNIT_CFLAGS)
|
||||||
|
MoneyApp_LDFLAGS = $(CPPUNIT_LIBS) -ldl\endverbatim
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section sec_running_test Running our tests
|
||||||
|
|
||||||
|
We have a main that doesn't do anything. Let's start by adding the mechanics
|
||||||
|
to run our tests (remember, test before you code ;-) ). For this example,
|
||||||
|
we will use a TextTestRunner with the CompilerOutputter for post-build
|
||||||
|
testing:
|
||||||
|
|
||||||
|
<tt>MoneyApp.cpp</tt>
|
||||||
|
\code
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||||
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
// Get the top level suite from the registry
|
||||||
|
CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
|
||||||
|
|
||||||
|
// Adds the test to the list of test to run
|
||||||
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
runner.addTest( suite );
|
||||||
|
|
||||||
|
// Change the default outputter to a compiler error format outputter
|
||||||
|
runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
|
||||||
|
std::cerr ) );
|
||||||
|
// Run the tests.
|
||||||
|
bool wasSucessful = runner.run();
|
||||||
|
|
||||||
|
// Return error code 1 if the one of test failed.
|
||||||
|
return wasSucessful ? 0 : 1;
|
||||||
|
}\endcode
|
||||||
|
|
||||||
|
VC++: Compile and run (Ctrl+F5).
|
||||||
|
|
||||||
|
Unix: First build. Since we don't have all the file yet, let's create them
|
||||||
|
and build our application for the first time:
|
||||||
|
\verbatim
|
||||||
|
touch Money.h MoneyTest.h MoneyTest.cpp
|
||||||
|
aclocal -I /usr/local/share/aclocal
|
||||||
|
autoconf
|
||||||
|
automake -a
|
||||||
|
touch NEWS README AUTHORS ChangeLog # To make automake happy
|
||||||
|
./configure
|
||||||
|
make check\endverbatim
|
||||||
|
|
||||||
|
Our application will report that everything
|
||||||
|
is fine and no test were run. So let's add some tests...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\subsection sec_post_build Setting up automated post-build testing (VC++)
|
||||||
|
|
||||||
|
What does post-build testing means? It means that each time you compile,
|
||||||
|
the test are automatically run when the build finish. This is very
|
||||||
|
useful, if you compile often you can know that you just 'broke' something,
|
||||||
|
or that everything is still working fine.
|
||||||
|
|
||||||
|
Let's adds that to our project, In the project settings, in the
|
||||||
|
'post-build step' tab:
|
||||||
|
- Select 'All configurations' (upper left combo)
|
||||||
|
- In the 'Post-build description', enter 'Unit testing...'
|
||||||
|
- In 'post-build command(s)', add a new line: <tt>\$(TargetPath)</tt>
|
||||||
|
|
||||||
|
<tt>\$(TargetPath)</tt> expands into the name of your application:
|
||||||
|
Debug\\MoneyApp.exe in debug configuration and Release\\MoneyApp.exe in release
|
||||||
|
configuration.
|
||||||
|
|
||||||
|
What we are doing is say to VC++ to run our application for each build.
|
||||||
|
Notices the last line of \c main(), it returns a different error code,
|
||||||
|
depending on weither or not a test failed. If the code returned by
|
||||||
|
an application is not 0 in post-build step, it tell VC++ that the build
|
||||||
|
step failed.
|
||||||
|
|
||||||
|
Compile. Notice that the application's output is now in the build window.
|
||||||
|
How convenient!
|
||||||
|
|
||||||
|
(Unix: tips to integrate make check into various IDE?)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section sec_adding_testfixture Adding the TestFixture
|
||||||
|
|
||||||
|
For this example, we are going to write a simple money class. Money
|
||||||
|
has an amount and a currency. Let's begin by creating a fixture where
|
||||||
|
we can put our tests, and add single test to test Money constructor:
|
||||||
|
|
||||||
|
<tt>MoneyTest.h:</tt>
|
||||||
|
\code
|
||||||
|
#ifndef MONEYTEST_H
|
||||||
|
#define MONEYTEST_H
|
||||||
|
|
||||||
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
|
class MoneyTest : public CppUnit::TestFixture
|
||||||
|
{
|
||||||
|
CPPUNIT_TEST_SUITE( MoneyTest );
|
||||||
|
CPPUNIT_TEST( testConstructor );
|
||||||
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setUp();
|
||||||
|
void tearDown();
|
||||||
|
|
||||||
|
void testConstructor();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MONEYTEST_H\endcode
|
||||||
|
|
||||||
|
- CPPUNIT_TEST_SUITE declares that our Fixture's test suite.
|
||||||
|
- CPPUNIT_TEST adds a test to our test suite. The test is implemented
|
||||||
|
by a method named testConstructor().
|
||||||
|
- setUp() and tearDown() are use to setUp/tearDown some fixtures. We are
|
||||||
|
not using any for now.
|
||||||
|
|
||||||
|
<tt>MoneyTest.cpp</tt>
|
||||||
|
\code
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "MoneyTest.h"
|
||||||
|
|
||||||
|
// Registers the fixture into the 'registry'
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION( MoneyTest );
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MoneyTest::setUp()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MoneyTest::tearDown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MoneyTest::testConstructor()
|
||||||
|
{
|
||||||
|
CPPUNIT_FAIL( "not implemented" );
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Compile. As expected, it reports that a test failed. Press the \c F4 key
|
||||||
|
(Go to next Error). VC++ jump right to our failed assertion CPPUNIT_FAIL.
|
||||||
|
We can not ask better in term of integration!
|
||||||
|
\verbatim
|
||||||
|
Compiling...
|
||||||
|
MoneyTest.cpp
|
||||||
|
Linking...
|
||||||
|
Unit testing...
|
||||||
|
.F
|
||||||
|
G:\prg\vc\Lib\cppunit\examples\money\MoneyTest.cpp(26):Assertion
|
||||||
|
Test name: MoneyTest.testConstructor
|
||||||
|
not implemented
|
||||||
|
Failures !!!
|
||||||
|
Run: 1 Failure total: 1 Failures: 1 Errors: 0
|
||||||
|
Error executing d:\winnt\system32\cmd.exe.
|
||||||
|
|
||||||
|
moneyappd.exe - 1 error(s), 0 warning(s)
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
Well, we have everything set up, let's start doing some real testing.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section sec_first_tests Our first tests
|
||||||
|
|
||||||
|
Let's write our first real test. A test is usually decomposed in three parts:
|
||||||
|
- setting up datas used by the test
|
||||||
|
- doing some processing based on those datas
|
||||||
|
- checking the result of the processing
|
||||||
|
|
||||||
|
\code
|
||||||
|
void
|
||||||
|
MoneyTest::testConstructor()
|
||||||
|
{
|
||||||
|
// Set up
|
||||||
|
const std::string currencyFF( "FF" );
|
||||||
|
const double longNumber = 12345678.90123;
|
||||||
|
|
||||||
|
// Process
|
||||||
|
Money money( longNumber, currencyFF );
|
||||||
|
|
||||||
|
// Check
|
||||||
|
CPPUNIT_ASSERT_EQUAL( longNumber, money.getAmount() );
|
||||||
|
CPPUNIT_ASSERT_EQUAL( currencyFF, money.getCurrency() );
|
||||||
|
}\endcode
|
||||||
|
|
||||||
|
Well, we finally have a good start of what our Money class will
|
||||||
|
look like. Let's start implementing...
|
||||||
|
|
||||||
|
<tt>Money.h</tt>
|
||||||
|
\code
|
||||||
|
#ifndef MONEY_H
|
||||||
|
#define MONEY_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class Money
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Money( double amount, std::string currency )
|
||||||
|
: m_amount( amount )
|
||||||
|
, m_currency( currency )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
double getAmount() const
|
||||||
|
{
|
||||||
|
return m_amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getCurrency() const
|
||||||
|
{
|
||||||
|
return m_currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
double m_amount;
|
||||||
|
std::string m_currency;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif\endcode
|
||||||
|
|
||||||
|
Include <tt>Money.h</tt> in MoneyTest.cpp and compile.
|
||||||
|
|
||||||
|
Hum, an assertion failed! Press F4, and we jump to the assertion
|
||||||
|
that checks the currency of the constructed money object. The report
|
||||||
|
indicates that string is not equal to expected value. There is only
|
||||||
|
two ways for this to happen: the member was badly initialized or we
|
||||||
|
returned the wrong value. After a quick check, we find out it is the former.
|
||||||
|
Let's fix that:
|
||||||
|
|
||||||
|
<tt>Money.h</tt>
|
||||||
|
\code
|
||||||
|
Money( double amount, std::string currency )
|
||||||
|
: m_amount( amount )
|
||||||
|
, m_currency( currency )
|
||||||
|
{
|
||||||
|
}\endcode
|
||||||
|
|
||||||
|
Compile. Our test finally pass!
|
||||||
|
Let's add some functionnality to our Money class.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section sec_more_tests Adding more tests
|
||||||
|
|
||||||
|
\subsection sec_equal Testing for equality
|
||||||
|
|
||||||
|
We want to check if to Money object are equal. Let's start by adding
|
||||||
|
a new test to the suite, then add our method:
|
||||||
|
|
||||||
|
<tt>MoneyTest.h</tt>
|
||||||
|
\code
|
||||||
|
CPPUNIT_TEST_SUITE( MoneyTest );
|
||||||
|
CPPUNIT_TEST( testConstructor );
|
||||||
|
CPPUNIT_TEST( testEqual );
|
||||||
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
public:
|
||||||
|
...
|
||||||
|
void testEqual();
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
<tt>MoneyTest.cpp</tt>
|
||||||
|
\code
|
||||||
|
void
|
||||||
|
MoneyTest::testEqual()
|
||||||
|
{
|
||||||
|
// Set up
|
||||||
|
const Money money123FF( 123, "FF" );
|
||||||
|
const Money money123USD( 123, "USD" );
|
||||||
|
const Money money12FF( 12, "FF" );
|
||||||
|
const Money money12USD( 12, "USD" );
|
||||||
|
|
||||||
|
// Process & Check
|
||||||
|
CPPUNIT_ASSERT( money123FF == money123FF ); // ==
|
||||||
|
CPPUNIT_ASSERT( money12FF != money123FF ); // != amount
|
||||||
|
CPPUNIT_ASSERT( money123USD != money123FF ); // != currency
|
||||||
|
CPPUNIT_ASSERT( money12USD != money123FF ); // != currency and != amount
|
||||||
|
}\endcode
|
||||||
|
|
||||||
|
Let's implements \c operator \c == and \c operator \c != in Money.h:
|
||||||
|
|
||||||
|
<tt>Money.h</tt>
|
||||||
|
\code
|
||||||
|
class Money
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
...
|
||||||
|
bool operator ==( const Money &other ) const
|
||||||
|
{
|
||||||
|
return m_amount == other.m_amount &&
|
||||||
|
m_currency == other.m_currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator !=( const Money &other ) const
|
||||||
|
{
|
||||||
|
return (*this == other);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Compile, run... Ooops... Press F4, it seems we're having trouble
|
||||||
|
with \c operator \c !=. Let's fix that:
|
||||||
|
\code
|
||||||
|
bool operator !=( const Money &other ) const
|
||||||
|
{
|
||||||
|
return !(*this == other);
|
||||||
|
}\endcode
|
||||||
|
|
||||||
|
Compile, run. Finally got it working!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\subsection sec_opadd Adding moneys
|
||||||
|
|
||||||
|
Let's add our test 'testAdd' to MoneyTest. You know the routine...
|
||||||
|
|
||||||
|
<tt>MoneyTest.cpp</tt>
|
||||||
|
\code
|
||||||
|
void
|
||||||
|
MoneyTest::testAdd()
|
||||||
|
{
|
||||||
|
// Set up
|
||||||
|
const Money money12FF( 12, "FF" );
|
||||||
|
const Money expectedMoney( 135, "FF" );
|
||||||
|
|
||||||
|
// Process
|
||||||
|
Money money( 123, "FF" );
|
||||||
|
money += money12FF;
|
||||||
|
|
||||||
|
// Check
|
||||||
|
CPPUNIT_ASSERT( expectedMoney == money ); // add works
|
||||||
|
CPPUNIT_ASSERT( &money == &(money += money12FF) ); // add returns ref. on 'this'.
|
||||||
|
}\endcode
|
||||||
|
|
||||||
|
While writing that test case, you ask yourself, what is the result of
|
||||||
|
adding money of currencies. Obviously this is an error and it should be
|
||||||
|
reported, say let throw an exception, say \c IncompatibleMoneyError,
|
||||||
|
when the currencies are not equal. We will write another test case
|
||||||
|
for this later. For now let get our testAdd() case working:
|
||||||
|
|
||||||
|
<tt>Money.h</tt>
|
||||||
|
\code
|
||||||
|
class Money
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
...
|
||||||
|
Money &operator +=( const Money &other )
|
||||||
|
{
|
||||||
|
m_amount += other.m_amount;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
}; \endcode
|
||||||
|
|
||||||
|
Compile, run. Miracle, everything is fine! Just to be sure the test is indeed
|
||||||
|
working, in the above code, change \c m_amount \c += to \c -=. Build and
|
||||||
|
check that it fails (always be suspicious of test that work the first
|
||||||
|
time: you may have forgotten to add it to the suite for example)!
|
||||||
|
Change the code back so that all the tests are working.
|
||||||
|
|
||||||
|
Let's the incompatible money test case before we forget about it...
|
||||||
|
That test case expect an \c IncompatibleMoneyError exception to be thrown.
|
||||||
|
%CppUnit can test that for us, you need to specify that the test case
|
||||||
|
expect an exception when you add it to the suite:
|
||||||
|
|
||||||
|
<tt>MoneyTest.h</tt>
|
||||||
|
\code
|
||||||
|
class MoneyTest : public CppUnit::TestFixture
|
||||||
|
{
|
||||||
|
CPPUNIT_TEST_SUITE( MoneyTest );
|
||||||
|
CPPUNIT_TEST( testConstructor );
|
||||||
|
CPPUNIT_TEST( testEqual );
|
||||||
|
CPPUNIT_TEST( testAdd );
|
||||||
|
CPPUNIT_TEST_EXCEPTION( testAddThrow, IncompatibleMoneyError );
|
||||||
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
public:
|
||||||
|
...
|
||||||
|
void testAddThrow();
|
||||||
|
};\endcode
|
||||||
|
|
||||||
|
By convention, you end the name of such tests with \c 'Throw', that way, you
|
||||||
|
know that the test expect an exception to be thrown. Let's write our test case:
|
||||||
|
|
||||||
|
<tt>MoneyTest.cpp</tt>
|
||||||
|
\code
|
||||||
|
void
|
||||||
|
MoneyTest::testAddThrow()
|
||||||
|
{
|
||||||
|
// Set up
|
||||||
|
const Money money123FF( 123, "FF" );
|
||||||
|
|
||||||
|
// Process
|
||||||
|
Money money( 123, "USD" );
|
||||||
|
money += money123FF; // should throw an exception
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Compile... Ooops, forgot to declare the exception class. Let's do that:
|
||||||
|
|
||||||
|
<tt>Money.h</tt>
|
||||||
|
\code
|
||||||
|
#include <string>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
class IncompatibleMoneyError : public std::runtime_error
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IncompatibleMoneyError() : runtime_error( "Incompatible moneys" )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Compile. As expected testAddThrow() fail... Let's fix that:
|
||||||
|
|
||||||
|
<tt>Money.h</tt>
|
||||||
|
\code
|
||||||
|
Money &operator +=( const Money &other )
|
||||||
|
{
|
||||||
|
if ( m_currency != other.m_currency )
|
||||||
|
throw IncompatibleMoneyError();
|
||||||
|
|
||||||
|
m_amount += other.m_amount;
|
||||||
|
return *this;
|
||||||
|
}\endcode
|
||||||
|
|
||||||
|
Compile. Our test finaly passes!
|
||||||
|
|
||||||
|
TODO:
|
||||||
|
- How to use CPPUNIT_ASSERT_EQUALS with Money
|
||||||
|
- Copy constructor/Assignment operator
|
||||||
|
- Introducing fixtures
|
||||||
|
- ?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section sec_credits Credits
|
||||||
|
This article was written by Baptiste Lepilleur. Unix configuration & set up
|
||||||
|
by Phil Verghese. Inspired from many others (JUnit, Phil's cookbook...),
|
||||||
|
and all the newbies around that keep asking me for the
|
||||||
|
'Hello world' example ;-)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
|
@ -0,0 +1,523 @@
|
||||||
|
/*! \page cppunit_cookbook CppUnit Cookbook
|
||||||
|
Here is a short cookbook to help you get started.
|
||||||
|
|
||||||
|
|
||||||
|
\section simple_test_case Simple Test Case
|
||||||
|
You want to know whether your code is working.
|
||||||
|
|
||||||
|
How do you do it?
|
||||||
|
|
||||||
|
There are many ways. Stepping through a debugger or
|
||||||
|
littering your code with stream output calls are two of
|
||||||
|
the simpler ways, but they both have drawbacks.
|
||||||
|
Stepping through your code is a good idea, but it
|
||||||
|
is not automatic. You have to do it every time you
|
||||||
|
make changes. Streaming out text is also fine,
|
||||||
|
but it makes code ugly and it generates far more
|
||||||
|
information than you need most of the time.
|
||||||
|
|
||||||
|
Tests in %CppUnit can be run automatically.
|
||||||
|
They are easy to set up and once you have
|
||||||
|
written them, they are always there to help
|
||||||
|
you keep confidence in the quality of your code.
|
||||||
|
|
||||||
|
To make a simple test, here is what you do:
|
||||||
|
|
||||||
|
Subclass the \link CppUnit::TestCase TestCase \endlink class.
|
||||||
|
Override the method \link CppUnit::TestCase::runTest() runTest()\endlink.
|
||||||
|
When you want to check a value, call
|
||||||
|
\link CPPUNIT_ASSERT() CPPUNIT_ASSERT(bool) \endlink
|
||||||
|
and pass in an expression that is true if the
|
||||||
|
test succeeds.
|
||||||
|
|
||||||
|
For example, to test the equality comparison
|
||||||
|
for a Complex number class, write:
|
||||||
|
|
||||||
|
\code
|
||||||
|
class ComplexNumberTest : public CppUnit::TestCase {
|
||||||
|
public:
|
||||||
|
ComplexNumberTest( std::string name ) : CppUnit::TestCase( name ) {}
|
||||||
|
|
||||||
|
void runTest() {
|
||||||
|
CPPUNIT_ASSERT( Complex (10, 1) == Complex (10, 1) );
|
||||||
|
CPPUNIT_ASSERT( !(Complex (1, 1) == Complex (2, 2)) );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
That was a very simple test. Ordinarily,
|
||||||
|
you'll have many little test cases that you'll
|
||||||
|
want to run on the same set of objects. To do
|
||||||
|
this, use a fixture.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section fixture Fixture
|
||||||
|
A fixture is a known set of objects that
|
||||||
|
serves as a base for a set of test cases.
|
||||||
|
Fixtures come in very handy when you are
|
||||||
|
testing as you develop.
|
||||||
|
|
||||||
|
Let's try out this style of development and
|
||||||
|
learn about fixtures along the away. Suppose
|
||||||
|
that we are really developing a complex
|
||||||
|
number class. Let's start by defining a
|
||||||
|
empty class named Complex.
|
||||||
|
|
||||||
|
\code
|
||||||
|
class Complex {};
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Now create an instance of ComplexNumberTest
|
||||||
|
above, compile the code and see what happens.
|
||||||
|
The first thing we notice is a few compiler
|
||||||
|
errors. The test uses <tt>operator ==</tt>, but it is
|
||||||
|
not defined. Let's fix that.
|
||||||
|
|
||||||
|
\code
|
||||||
|
bool operator==( const Complex &a, const Complex &b)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Now compile the test, and run it. This time it
|
||||||
|
compiles but the test fails.
|
||||||
|
We need a bit more to get an <tt>operator ==</tt>working
|
||||||
|
correctly, so we revisit the code.
|
||||||
|
|
||||||
|
\code
|
||||||
|
class Complex {
|
||||||
|
friend bool operator ==(const Complex& a, const Complex& b);
|
||||||
|
double real, imaginary;
|
||||||
|
public:
|
||||||
|
Complex( double r, double i = 0 )
|
||||||
|
: real(r)
|
||||||
|
, imaginary(i)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool operator ==( const Complex &a, const Complex &b )
|
||||||
|
{
|
||||||
|
return a.real == b.real && a.imaginary == b.imaginary;
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
If we compile now and run our test it will pass.
|
||||||
|
|
||||||
|
Now we are ready to add new operations and
|
||||||
|
new tests. At this point a fixture would be
|
||||||
|
handy. We would probably be better off when
|
||||||
|
doing our tests if we decided to instantiate
|
||||||
|
three or four complex numbers and reuse them
|
||||||
|
across our tests.
|
||||||
|
|
||||||
|
Here is how we do it:
|
||||||
|
- Add member variables for each part of the
|
||||||
|
\link CppUnit::TestFixture fixture \endlink
|
||||||
|
- Override \link CppUnit::TestFixture::setUp() setUp() \endlink
|
||||||
|
to initialize the variables
|
||||||
|
- Override \link CppUnit::TestFixture::tearDown() tearDown() \endlink
|
||||||
|
to release any permanent resources you allocated in
|
||||||
|
\link CppUnit::TestFixture::setUp() setUp() \endlink
|
||||||
|
|
||||||
|
\code
|
||||||
|
class ComplexNumberTest : public CppUnit::TestFixture {
|
||||||
|
private:
|
||||||
|
Complex *m_10_1, *m_1_1, *m_11_2;
|
||||||
|
public:
|
||||||
|
void setUp()
|
||||||
|
{
|
||||||
|
m_10_1 = new Complex( 10, 1 );
|
||||||
|
m_1_1 = new Complex( 1, 1 );
|
||||||
|
m_11_2 = new Complex( 11, 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void tearDown()
|
||||||
|
{
|
||||||
|
delete m_10_1;
|
||||||
|
delete m_1_1;
|
||||||
|
delete m_11_2;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Once we have this fixture, we can add the complex
|
||||||
|
addition test case and any others that we need
|
||||||
|
over the course of our development.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section test_case Test Case
|
||||||
|
|
||||||
|
How do you write and invoke individual tests using a fixture?
|
||||||
|
|
||||||
|
There are two steps to this process:
|
||||||
|
- Write the test case as a method in the fixture class
|
||||||
|
- Create a TestCaller which runs that particular method
|
||||||
|
|
||||||
|
Here is our test case class with a few extra case methods:
|
||||||
|
|
||||||
|
\code
|
||||||
|
class ComplexNumberTest : public CppUnit::TestFixture {
|
||||||
|
private:
|
||||||
|
Complex *m_10_1, *m_1_1, *m_11_2;
|
||||||
|
public:
|
||||||
|
void setUp()
|
||||||
|
{
|
||||||
|
m_10_1 = new Complex( 10, 1 );
|
||||||
|
m_1_1 = new Complex( 1, 1 );
|
||||||
|
m_11_2 = new Complex( 11, 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void tearDown()
|
||||||
|
{
|
||||||
|
delete m_10_1;
|
||||||
|
delete m_1_1;
|
||||||
|
delete m_11_2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void testEquality()
|
||||||
|
{
|
||||||
|
CPPUNIT_ASSERT( *m_10_1 == *m_10_1 );
|
||||||
|
CPPUNIT_ASSERT( !(*m_10_1 == *m_11_2) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void testAddition()
|
||||||
|
{
|
||||||
|
CPPUNIT_ASSERT( *m_10_1 + *m_1_1 == *m_11_2 );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
One may create and run instances for each test case like this:
|
||||||
|
|
||||||
|
\code
|
||||||
|
CppUnit::TestCaller<ComplexNumberTest> test( "testEquality",
|
||||||
|
&ComplexNumberTest::testEquality );
|
||||||
|
CppUnit::TestResult result;
|
||||||
|
test.run( &result );
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
The second argument to the test caller constructor is the address of
|
||||||
|
a method on ComplexNumberTest. When the test caller is run,
|
||||||
|
that specific method will be run. This is not a useful thing to do,
|
||||||
|
however, as no diagnostics will be displayed.
|
||||||
|
One will normally use a \link ExecutingTest TestRunner \endlink (see below)
|
||||||
|
to display the results.
|
||||||
|
|
||||||
|
Once you have several tests, organize them into a suite.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section suite Suite
|
||||||
|
|
||||||
|
How do you set up your tests so that you can run them all at once?
|
||||||
|
|
||||||
|
%CppUnit provides a \link CppUnit::TestSuite TestSuite \endlink class
|
||||||
|
that runs any number of TestCases together.
|
||||||
|
|
||||||
|
We saw, above, how to run a single test case.
|
||||||
|
|
||||||
|
To create a suite of two or more tests, you do the following:
|
||||||
|
|
||||||
|
\code
|
||||||
|
CppUnit::TestSuite suite;
|
||||||
|
CppUnit::TestResult result;
|
||||||
|
suite.addTest( new CppUnit::TestCaller<ComplexNumberTest>(
|
||||||
|
"testEquality",
|
||||||
|
&ComplexNumberTest::testEquality ) );
|
||||||
|
suite.addTest( new CppUnit::TestCaller<ComplexNumberTest>(
|
||||||
|
"testAddition",
|
||||||
|
&ComplexNumberTest::testAddition ) );
|
||||||
|
suite.run( &result );
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\link CppUnit::TestSuite TestSuites \endlink don't only have to
|
||||||
|
contain callers for TestCases. They can contain any object
|
||||||
|
that implements the \link CppUnit::Test Test \endlink interface.
|
||||||
|
For example, you can create a
|
||||||
|
\link CppUnit::TestSuite TestSuite \endlink in your code and
|
||||||
|
I can create one in mine, and we can run them together
|
||||||
|
by creating a \link CppUnit::TestSuite TestSuite \endlink
|
||||||
|
that contains both:
|
||||||
|
|
||||||
|
\code
|
||||||
|
CppUnit::TestSuite suite;
|
||||||
|
CppUnit::TestResult result;
|
||||||
|
suite.addTest( ComplexNumberTest::suite() );
|
||||||
|
suite.addTest( SurrealNumberTest::suite() );
|
||||||
|
suite.run( &result );
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section test_runner TestRunner
|
||||||
|
|
||||||
|
How do you run your tests and collect their results?
|
||||||
|
|
||||||
|
Once you have a test suite, you'll want to run it. %CppUnit provides tools
|
||||||
|
to define the suite to be run and to display its results.
|
||||||
|
You make your suite accessible to a \link ExecutingTest TestRunner \endlink
|
||||||
|
program with a static method <I>suite</I> that returns a test suite.
|
||||||
|
|
||||||
|
For example, to make a ComplexNumberTest suite available to a
|
||||||
|
\link ExecutingTest TestRunner \endlink, add the following code to
|
||||||
|
ComplexNumberTest:
|
||||||
|
|
||||||
|
\code
|
||||||
|
public:
|
||||||
|
static CppUnit::TestSuite *suite()
|
||||||
|
{
|
||||||
|
CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite( "ComplexNumberTest" );
|
||||||
|
suiteOfTests->addTest( new CppUnit::TestCaller<ComplexNumberTest>(
|
||||||
|
"testEquality",
|
||||||
|
&ComplexNumberTest::testEquality ) );
|
||||||
|
suiteOfTests->addTest( new CppUnit::TestCaller<ComplexNumberTest>(
|
||||||
|
"testAddition",
|
||||||
|
&ComplexNumberTest::testAddition ) );
|
||||||
|
return suiteOfTests;
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\anchor test_runner_code
|
||||||
|
To use the text version, include the header files for the tests in Main.cpp:
|
||||||
|
|
||||||
|
\code
|
||||||
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
|
#include "ExampleTestCase.h"
|
||||||
|
#include "ComplexNumberTest.h"
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
And add a call to
|
||||||
|
\link ::CppUnit::TextUi::TestRunner::addTest addTest(CppUnit::Test *) \endlink
|
||||||
|
in the <tt>main()</tt> function:
|
||||||
|
|
||||||
|
\code
|
||||||
|
int main( int argc, char **argv)
|
||||||
|
{
|
||||||
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
runner.addTest( ExampleTestCase::suite() );
|
||||||
|
runner.addTest( ComplexNumberTest::suite() );
|
||||||
|
runner.run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
The \link ExecutingTest TestRunner \endlink will run the tests.
|
||||||
|
If all the tests pass, you'll get an informative message.
|
||||||
|
If any fail, you'll get the following information:
|
||||||
|
|
||||||
|
- The name of the test case that failed
|
||||||
|
- The name of the source file that contains the test
|
||||||
|
- The line number where the failure occurred
|
||||||
|
- All of the text inside the call to CPPUNIT_ASSERT() which detected the failure
|
||||||
|
|
||||||
|
%CppUnit distinguishes between <I>failures</I> and <I>errors</I>. A failure is
|
||||||
|
anticipated and checked for with assertions. Errors are unanticipated problems
|
||||||
|
like division by zero and other exceptions thrown by the C++ runtime or your code.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section helper_macros Helper Macros
|
||||||
|
|
||||||
|
As you might have noticed, implementing the fixture static <tt>suite()</tt>
|
||||||
|
method is a repetitive and error prone task. A \ref WritingTestFixture set of
|
||||||
|
macros have been created to automatically implements the
|
||||||
|
static <tt>suite()</tt> method.
|
||||||
|
|
||||||
|
The following code is a rewrite of ComplexNumberTest using those macros:
|
||||||
|
|
||||||
|
\code
|
||||||
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
|
class ComplexNumberTest : public CppUnit::TestFixture {
|
||||||
|
\endcode
|
||||||
|
First, we declare the suite, passing the class name to the macro:
|
||||||
|
\code
|
||||||
|
CPPUNIT_TEST_SUITE( ComplexNumberTest );
|
||||||
|
\endcode
|
||||||
|
The suite created by the static <tt>suite()</tt> method is named after
|
||||||
|
the class name.
|
||||||
|
Then, we declare each test case of the fixture:
|
||||||
|
\code
|
||||||
|
CPPUNIT_TEST( testEquality );
|
||||||
|
CPPUNIT_TEST( testAddition );
|
||||||
|
\endcode
|
||||||
|
Finally, we end the suite declaration:
|
||||||
|
\code
|
||||||
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
\endcode
|
||||||
|
At this point, a method with the following signature has been implemented:
|
||||||
|
\code
|
||||||
|
static CppUnit::TestSuite *suite();
|
||||||
|
\endcode
|
||||||
|
The rest of the fixture is left unchanged:
|
||||||
|
\code
|
||||||
|
private:
|
||||||
|
Complex *m_10_1, *m_1_1, *m_11_2;
|
||||||
|
public:
|
||||||
|
void setUp()
|
||||||
|
{
|
||||||
|
m_10_1 = new Complex( 10, 1 );
|
||||||
|
m_1_1 = new Complex( 1, 1 );
|
||||||
|
m_11_2 = new Complex( 11, 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void tearDown()
|
||||||
|
{
|
||||||
|
delete m_10_1;
|
||||||
|
delete m_1_1;
|
||||||
|
delete m_11_2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void testEquality()
|
||||||
|
{
|
||||||
|
CPPUNIT_ASSERT( *m_10_1 == *m_10_1 );
|
||||||
|
CPPUNIT_ASSERT( !(*m_10_1 == *m_11_2) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void testAddition()
|
||||||
|
{
|
||||||
|
CPPUNIT_ASSERT( *m_10_1 + *m_1_1 == *m_11_2 );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
The name of the \link CppUnit::TestCaller TestCaller \endlink added to the
|
||||||
|
suite are a composition of the fixture name and the method name.
|
||||||
|
|
||||||
|
In the present case, the names would be:
|
||||||
|
"ComplexNumberTest.testEquality" and "ComplexNumberTest.testAddition".
|
||||||
|
|
||||||
|
The \link WritingTestFixture helper macros \endlink help you write comon assertion.
|
||||||
|
For example, to check that ComplexNumber throws a MathException when dividing
|
||||||
|
a number by 0:
|
||||||
|
- add the test to the suite using CPPUNIT_TEST_EXCEPTION, specifying the expected
|
||||||
|
exception type.
|
||||||
|
- write the test case method
|
||||||
|
|
||||||
|
\code
|
||||||
|
CPPUNIT_TEST_SUITE( ComplexNumberTest );
|
||||||
|
// [...]
|
||||||
|
CPPUNIT_TEST_EXCEPTION( testDivideByZeroThrows, MathException );
|
||||||
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
|
// [...]
|
||||||
|
|
||||||
|
void testDivideByZeroThrows()
|
||||||
|
{
|
||||||
|
// The following line should throw a MathException.
|
||||||
|
*m_10_1 / ComplexNumber(0);
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
If the expected exception is not thrown, then a assertion failure is reported.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section test_factory_registry TestFactoryRegistry
|
||||||
|
|
||||||
|
The TestFactoryRegistry was created to solve two pitfalls:
|
||||||
|
- forgetting to add your fixture suite to the test runner (since it is in
|
||||||
|
another file, it is easy to forget)
|
||||||
|
- compilation bottleneck caused by the inclusion of all test case headers
|
||||||
|
(see \ref test_runner_code "previous example")
|
||||||
|
|
||||||
|
The TestFactoryRegistry is a place where suites can be registered at initialization
|
||||||
|
time.
|
||||||
|
|
||||||
|
To register the ComplexNumber suite, in the .cpp file, you add:
|
||||||
|
|
||||||
|
\code
|
||||||
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION( ComplexNumberTest );
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Behind the scene, a static variable type of
|
||||||
|
\link CppUnit::AutoRegisterSuite AutoRegisterSuite \endlink is declared.
|
||||||
|
On construction, it will
|
||||||
|
\link CppUnit::TestFactoryRegistry::registerFactory(TestFactory*) register \endlink
|
||||||
|
a \link CppUnit::TestSuiteFactory TestSuiteFactory \endlink into the
|
||||||
|
\link CppUnit::TestFactoryRegistry TestFactoryRegistry \endlink.
|
||||||
|
The \link CppUnit::TestSuiteFactory TestSuiteFactory \endlink returns
|
||||||
|
the \link CppUnit::TestSuite TestSuite \endlink returned by ComplexNumber::suite().
|
||||||
|
|
||||||
|
To run the tests, using the text test runner, we don't need to include the fixture
|
||||||
|
anymore:
|
||||||
|
|
||||||
|
\code
|
||||||
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||||
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
|
|
||||||
|
int main( int argc, char **argv)
|
||||||
|
{
|
||||||
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
\endcode
|
||||||
|
First, we retreive the instance of the
|
||||||
|
\link CppUnit::TestFactoryRegistry TestFactoryRegistry \endlink:
|
||||||
|
\code
|
||||||
|
CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
|
||||||
|
\endcode
|
||||||
|
Then, we obtain and add a new \link CppUnit::TestSuite TestSuite \endlink created
|
||||||
|
by the \link CppUnit::TestFactoryRegistry TestFactoryRegistry \endlink that
|
||||||
|
contains all the test suite registered using CPPUNIT_TEST_SUITE_REGISTRATION().
|
||||||
|
\code
|
||||||
|
runner.addTest( registry.makeTest() );
|
||||||
|
runner.run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\section post_build_check Post-build check
|
||||||
|
|
||||||
|
Well, now that we have our unit tests running, how about integrating unit
|
||||||
|
testing to our build process ?
|
||||||
|
|
||||||
|
To do that, the application must returns a value different than 0 to indicate that
|
||||||
|
there was an error.
|
||||||
|
|
||||||
|
\link CppUnit::TextUi::TestRunner::run() TestRunner::run() \endlink returns
|
||||||
|
a boolean indicating if the run was successful.
|
||||||
|
|
||||||
|
Updating our main programm, we obtains:
|
||||||
|
\code
|
||||||
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||||
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
|
|
||||||
|
int main( int argc, char **argv)
|
||||||
|
{
|
||||||
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
|
||||||
|
runner.addTest( registry.makeTest() );
|
||||||
|
bool wasSuccessful = runner.run( "", false );
|
||||||
|
return !wasSuccessful;
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Now, you need to run your application after compilation.
|
||||||
|
|
||||||
|
With Visual C++, this is done in <em>Project Settings/Post-Build step</em>,
|
||||||
|
by adding the following command: <tt>"$(TargetPath)"</tt>. It is expanded to
|
||||||
|
the application executable path. Look up the project
|
||||||
|
<tt>examples/cppunittest/CppUnitTestMain.dsp</tt> which
|
||||||
|
use that technic.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Original version by Michael Feathers.
|
||||||
|
Doxygen conversion and update by Baptiste Lepilleur.
|
||||||
|
*/
|
|
@ -0,0 +1,23 @@
|
||||||
|
<hr>
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
<td width="10%" align="left" valign="center">
|
||||||
|
<a href="http://sourceforge.net">
|
||||||
|
<img
|
||||||
|
src="http://sourceforge.net/sflogo.php?group_id=11795"
|
||||||
|
width="88" height="31" border="0" alt="SourceForge Logo"></a>
|
||||||
|
</td>
|
||||||
|
<td width="20%" align="left" valign="center">
|
||||||
|
hosts this site.
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td align="right" valign="center">
|
||||||
|
Send comments to:<br>
|
||||||
|
<a href="mailto:cppunit-devel@lists.sourceforge.net">CppUnit Developers</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>
|
||||||
|
CppUnit - The Unit Testing Library
|
||||||
|
</title>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="#ffffff">
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
<td width="40%" align="left" valign="center">
|
||||||
|
<a href="http://sourceforge.net/projects/cppunit">
|
||||||
|
CppUnit project page
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="FAQ">FAQ</a>
|
||||||
|
</td>
|
||||||
|
<td width="40%" align="right" valign="center">
|
||||||
|
<a href="http://cppunit.sourceforge.net">CppUnit home page</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<hr>
|
|
@ -0,0 +1,147 @@
|
||||||
|
/**
|
||||||
|
\mainpage
|
||||||
|
|
||||||
|
\section _history History
|
||||||
|
The first port of JUnit to C++ was done
|
||||||
|
by Michael Feathers. His versions
|
||||||
|
can be found on the
|
||||||
|
<a href="http://www.xprogramming.com/software.htm">
|
||||||
|
XProgramming software page</a>. They are os-specific,
|
||||||
|
so Jerome Lacoste provided a port to Unix/Solaris.
|
||||||
|
His version can be found on the same page.
|
||||||
|
The %CppUnit project has combined and built on this work.
|
||||||
|
|
||||||
|
\section _usage Usage
|
||||||
|
Take a look into the \ref cppunit_cookbook.
|
||||||
|
It gives a quick start into using this
|
||||||
|
testing framework. <a href="modules.html">Modules</a> give
|
||||||
|
you a organized view of %CppUnit classes.
|
||||||
|
|
||||||
|
(Notes to newbies, you may want to check out \ref money_example,
|
||||||
|
a work in progress, but the project is provided with %CppUnit).
|
||||||
|
|
||||||
|
For a discussion on %CppUnit, check
|
||||||
|
<a href="http://c2.com/cgi/wiki?CppUnit">
|
||||||
|
the WikiWiki Pages on CppUnit</a>. There you can also
|
||||||
|
find the original versions and various ports to other
|
||||||
|
OSses and languages.
|
||||||
|
|
||||||
|
\section _license License
|
||||||
|
This library is released under
|
||||||
|
the GNU
|
||||||
|
<a href="http://www.gnu.org/copyleft/lesser.html">
|
||||||
|
Lesser General Public License</a>.
|
||||||
|
|
||||||
|
\author Eric Sommerlade (sommerlade@gmx.net)
|
||||||
|
\author Michael Feathers (mfeathers@objectmentor.com)
|
||||||
|
\author Jerome Lacoste (lacostej@altern.org)
|
||||||
|
\author Baptiste Lepilleur <blep@users.sourceforge.net>
|
||||||
|
\author Bastiaan Bakker <bastiaan.bakker@lifeline.nl>
|
||||||
|
\author Steve Robbins <smr99@sourceforge.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*! \defgroup WritingTestFixture Writing test fixture
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup Assertions Making assertions
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup CreatingTestSuite Creating TestSuite
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup ExecutingTest Executing test
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup TrackingTestExecution Tracking test execution
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup WritingTestResult Writing test result
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup BrowsingCollectedTestResult Browsing collected test result
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup CreatingNewAssertions Creating custom assertions
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \defgroup WritingTestPlugIn Writing Test Plug-in
|
||||||
|
*
|
||||||
|
* Creating a test plug-in is really simple:
|
||||||
|
* - make your project a dynamic library (with VC++, choose Win32 Dynamic Library in
|
||||||
|
* the project wizard), and link against the dynamic library version of %CppUnit
|
||||||
|
* (cppunit*_dll.lib for VC++).
|
||||||
|
* - in a cpp file, include TestPlugIn.h, and use the macro CPPUNIT_PLUGIN_IMPLEMENT()
|
||||||
|
* to declare the test plug-in.
|
||||||
|
* - That's it, you're done! All the tests registered using the TestFactoryRegistry,
|
||||||
|
* CPPUNIT_TEST_SUITE_NAMED_REGISTRATION, or CPPUNIT_TEST_SUITE_REGISTRATION will
|
||||||
|
* be visible to other plug-in and to the DllPlugInRunner.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* \code
|
||||||
|
* #include <cppunit/include/plugin/TestPlugIn.h>
|
||||||
|
*
|
||||||
|
* CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* The interface CppUnitTestPlugIn is automatically implemented by the previous
|
||||||
|
* macro. You can define your own implementation.
|
||||||
|
*
|
||||||
|
* To provide your custom implementation of the plug-in interface, you must:
|
||||||
|
* - create a class that implements the CppUnitTestPlugIn interface
|
||||||
|
* - use CPPUNIT_PLUGIN_EXPORTED_FUNCTION_IMPL() with your class to export
|
||||||
|
* the plug-in interface
|
||||||
|
* - implements the 'main' function with CPPUNIT_PLUGIN_IMPLEMENT_MAIN().
|
||||||
|
*
|
||||||
|
* Some of the reason you may want to do this:
|
||||||
|
* - You do not use the TestFactoryRegistry to register your test.
|
||||||
|
* - You want to create a custom listener to use with DllPlugInRunner.
|
||||||
|
* - You want to do initialize some globale resources before running the test
|
||||||
|
* (setting up COM for example).
|
||||||
|
*
|
||||||
|
* See CppUnitTestPlugIn for further detail on how to do this.
|
||||||
|
*
|
||||||
|
* Creating your own test plug-in with VC++:
|
||||||
|
* - Create a new "Win32 Dynamic Library" project, choose the empty template
|
||||||
|
* - For the Debug Configuration, add cppunitd_dll.lib to
|
||||||
|
* 'Project Settings/Link/Object/Libariries modules', and for the Release
|
||||||
|
* Configuration, add cppunit_dll.lib.
|
||||||
|
* - For All Configuration, in 'C++/Preprocessor/Preprocessors definitions',
|
||||||
|
* add the symbol 'CPPUNIT_DLL' at the end of the line (it means that
|
||||||
|
* you are linking against cppunit dll).
|
||||||
|
* - Create a 'main' file that contains:
|
||||||
|
\verbatim
|
||||||
|
#include <cppunit/plugin/TestPlugIn.h>
|
||||||
|
|
||||||
|
CPPUNIT_PLUGIN_IMPLEMENT();\endverbatim
|
||||||
|
* - Add your tests
|
||||||
|
* - You're done !
|
||||||
|
*
|
||||||
|
* See examples/simple/simple_plugin.dsp for an example.
|
||||||
|
*
|
||||||
|
* Notes to VC++ users:
|
||||||
|
* - you can run a post-build check on the plug-in. Add the following line to your
|
||||||
|
* post-build tab: "DllPlugInTesterd_dll.exe $(TargetPath)". DllPlugInTesterd_dll.exe
|
||||||
|
* need to be some place were it can be found (path, ...), or you need to
|
||||||
|
* indicate the correct path.
|
||||||
|
* $(TargetPath) is the filename of your plug-in.
|
||||||
|
* - you can debug your DLL, set the executable for debug session to the plug-in
|
||||||
|
* runner, and the name of the DLL in the program arguments ($(xxx) won't work
|
||||||
|
* this time).
|
||||||
|
*
|
||||||
|
* How does it works ?
|
||||||
|
*
|
||||||
|
* When %CppUnit is linked as a DLL, the singleton used for the TestFactoryRegistry
|
||||||
|
* is the same for the plug-in runner (also linked against %CppUnit DLL). This means
|
||||||
|
* that the tests registered with the macros (at static initialization) are
|
||||||
|
* registered in the same registry. As soon as a DLL is loaded by the PlugInManager,
|
||||||
|
* the DLL static variable are constructed and the test registered to the
|
||||||
|
* TestFactoryRegistry.
|
||||||
|
*
|
||||||
|
* After loading the DLL, the PlugInManager look-up a specific function exported by
|
||||||
|
* the DLL. That function returns a pointer on the plug-in interface, which is later
|
||||||
|
* used by the PlugInManager.
|
||||||
|
*
|
||||||
|
* \see CreatingTestSuite.
|
||||||
|
*/
|
|
@ -0,0 +1,4 @@
|
||||||
|
SUBDIRS = cppunit
|
||||||
|
|
||||||
|
# already handled by toplevel dist-hook.
|
||||||
|
# DIST_SUBDIRS = msvc6
|
|
@ -0,0 +1,514 @@
|
||||||
|
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
install_sh_DATA = $(install_sh) -c -m 644
|
||||||
|
install_sh_PROGRAM = $(install_sh) -c
|
||||||
|
install_sh_SCRIPT = $(install_sh) -c
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = $(program_transform_name)
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
build_triplet = @build@
|
||||||
|
host_triplet = @host@
|
||||||
|
subdir = include
|
||||||
|
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||||
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
|
am__aclocal_m4_deps = \
|
||||||
|
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_rtti.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_string_compare_string_first.m4 \
|
||||||
|
$(top_srcdir)/config/ac_dll.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_gcc_abi_demangle.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_have_isfinite.m4 \
|
||||||
|
$(top_srcdir)/config/bb_enable_doxygen.m4 \
|
||||||
|
$(top_srcdir)/configure.in
|
||||||
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
|
$(ACLOCAL_M4)
|
||||||
|
mkinstalldirs = $(install_sh) -d
|
||||||
|
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||||
|
CONFIG_CLEAN_FILES =
|
||||||
|
SOURCES =
|
||||||
|
DIST_SOURCES =
|
||||||
|
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||||
|
html-recursive info-recursive install-data-recursive \
|
||||||
|
install-dvi-recursive install-exec-recursive \
|
||||||
|
install-html-recursive install-info-recursive \
|
||||||
|
install-pdf-recursive install-ps-recursive install-recursive \
|
||||||
|
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||||
|
ps-recursive uninstall-recursive
|
||||||
|
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||||
|
distclean-recursive maintainer-clean-recursive
|
||||||
|
ETAGS = etags
|
||||||
|
CTAGS = ctags
|
||||||
|
DIST_SUBDIRS = $(SUBDIRS)
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AR = @AR@
|
||||||
|
AS = @AS@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AWK = @AWK@
|
||||||
|
CC = @CC@
|
||||||
|
CCDEPMODE = @CCDEPMODE@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
CPP = @CPP@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_BINARY_AGE = @CPPUNIT_BINARY_AGE@
|
||||||
|
CPPUNIT_INTERFACE_AGE = @CPPUNIT_INTERFACE_AGE@
|
||||||
|
CPPUNIT_MAJOR_VERSION = @CPPUNIT_MAJOR_VERSION@
|
||||||
|
CPPUNIT_MICRO_VERSION = @CPPUNIT_MICRO_VERSION@
|
||||||
|
CPPUNIT_MINOR_VERSION = @CPPUNIT_MINOR_VERSION@
|
||||||
|
CPPUNIT_VERSION = @CPPUNIT_VERSION@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
|
CYGPATH_W = @CYGPATH_W@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
DLLTOOL = @DLLTOOL@
|
||||||
|
DOT = @DOT@
|
||||||
|
DOXYGEN = @DOXYGEN@
|
||||||
|
DSYMUTIL = @DSYMUTIL@
|
||||||
|
ECHO = @ECHO@
|
||||||
|
ECHO_C = @ECHO_C@
|
||||||
|
ECHO_N = @ECHO_N@
|
||||||
|
ECHO_T = @ECHO_T@
|
||||||
|
EGREP = @EGREP@
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
F77 = @F77@
|
||||||
|
FFLAGS = @FFLAGS@
|
||||||
|
GREP = @GREP@
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
LIBADD_DL = @LIBADD_DL@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LN_S = @LN_S@
|
||||||
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_AGE = @LT_AGE@
|
||||||
|
LT_CURRENT = @LT_CURRENT@
|
||||||
|
LT_RELEASE = @LT_RELEASE@
|
||||||
|
LT_REVISION = @LT_REVISION@
|
||||||
|
MAKEINFO = @MAKEINFO@
|
||||||
|
MKDIR_P = @MKDIR_P@
|
||||||
|
NMEDIT = @NMEDIT@
|
||||||
|
OBJDUMP = @OBJDUMP@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||||
|
PACKAGE_NAME = @PACKAGE_NAME@
|
||||||
|
PACKAGE_STRING = @PACKAGE_STRING@
|
||||||
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
SED = @SED@
|
||||||
|
SET_MAKE = @SET_MAKE@
|
||||||
|
SHELL = @SHELL@
|
||||||
|
STRIP = @STRIP@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
abs_builddir = @abs_builddir@
|
||||||
|
abs_srcdir = @abs_srcdir@
|
||||||
|
abs_top_builddir = @abs_top_builddir@
|
||||||
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
|
ac_ct_F77 = @ac_ct_F77@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__leading_dot = @am__leading_dot@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
am__tar = @am__tar@
|
||||||
|
am__untar = @am__untar@
|
||||||
|
bindir = @bindir@
|
||||||
|
build = @build@
|
||||||
|
build_alias = @build_alias@
|
||||||
|
build_cpu = @build_cpu@
|
||||||
|
build_os = @build_os@
|
||||||
|
build_vendor = @build_vendor@
|
||||||
|
builddir = @builddir@
|
||||||
|
datadir = @datadir@
|
||||||
|
datarootdir = @datarootdir@
|
||||||
|
docdir = @docdir@
|
||||||
|
dvidir = @dvidir@
|
||||||
|
enable_dot = @enable_dot@
|
||||||
|
enable_html_docs = @enable_html_docs@
|
||||||
|
enable_latex_docs = @enable_latex_docs@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
host = @host@
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_cpu = @host_cpu@
|
||||||
|
host_os = @host_os@
|
||||||
|
host_vendor = @host_vendor@
|
||||||
|
htmldir = @htmldir@
|
||||||
|
includedir = @includedir@
|
||||||
|
infodir = @infodir@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
libdir = @libdir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
localedir = @localedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
mandir = @mandir@
|
||||||
|
mkdir_p = @mkdir_p@
|
||||||
|
oldincludedir = @oldincludedir@
|
||||||
|
pdfdir = @pdfdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
program_transform_name = @program_transform_name@
|
||||||
|
psdir = @psdir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
target_alias = @target_alias@
|
||||||
|
top_builddir = @top_builddir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
SUBDIRS = cppunit
|
||||||
|
all: all-recursive
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
|
@for dep in $?; do \
|
||||||
|
case '$(am__configure_deps)' in \
|
||||||
|
*$$dep*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||||
|
&& exit 0; \
|
||||||
|
exit 1;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
|
||||||
|
cd $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu include/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
@case '$?' in \
|
||||||
|
*config.status*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
|
*) \
|
||||||
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
|
esac;
|
||||||
|
|
||||||
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
|
$(top_srcdir)/configure: $(am__configure_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
|
mostlyclean-libtool:
|
||||||
|
-rm -f *.lo
|
||||||
|
|
||||||
|
clean-libtool:
|
||||||
|
-rm -rf .libs _libs
|
||||||
|
|
||||||
|
# This directory's subdirectories are mostly independent; you can cd
|
||||||
|
# into them and run `make' without going through this Makefile.
|
||||||
|
# To change the values of `make' variables: instead of editing Makefiles,
|
||||||
|
# (1) if the variable is set in `config.status', edit `config.status'
|
||||||
|
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||||
|
# (2) otherwise, pass the desired values on the `make' command line.
|
||||||
|
$(RECURSIVE_TARGETS):
|
||||||
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
dot_seen=no; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
dot_seen=yes; \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| eval $$failcom; \
|
||||||
|
done; \
|
||||||
|
if test "$$dot_seen" = "no"; then \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
|
fi; test -z "$$fail"
|
||||||
|
|
||||||
|
$(RECURSIVE_CLEAN_TARGETS):
|
||||||
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
dot_seen=no; \
|
||||||
|
case "$@" in \
|
||||||
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
|
*) list='$(SUBDIRS)' ;; \
|
||||||
|
esac; \
|
||||||
|
rev=''; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = "."; then :; else \
|
||||||
|
rev="$$subdir $$rev"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
rev="$$rev ."; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
for subdir in $$rev; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| eval $$failcom; \
|
||||||
|
done && test -z "$$fail"
|
||||||
|
tags-recursive:
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||||
|
done
|
||||||
|
ctags-recursive:
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||||
|
done
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
mkid -fID $$unique
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
tags=; \
|
||||||
|
here=`pwd`; \
|
||||||
|
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||||
|
include_option=--etags-include; \
|
||||||
|
empty_fix=.; \
|
||||||
|
else \
|
||||||
|
include_option=--include; \
|
||||||
|
empty_fix=; \
|
||||||
|
fi; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test ! -f $$subdir/TAGS || \
|
||||||
|
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||||
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||||
|
$$tags $$unique; \
|
||||||
|
fi
|
||||||
|
ctags: CTAGS
|
||||||
|
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
tags=; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||||
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
|
$$tags $$unique
|
||||||
|
|
||||||
|
GTAGS:
|
||||||
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
|
&& cd $(top_srcdir) \
|
||||||
|
&& gtags -i $(GTAGS_ARGS) $$here
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
list='$(DISTFILES)'; \
|
||||||
|
dist_files=`for file in $$list; do echo $$file; done | \
|
||||||
|
sed -e "s|^$$srcdirstrip/||;t" \
|
||||||
|
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||||
|
case $$dist_files in \
|
||||||
|
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||||
|
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||||
|
sort -u` ;; \
|
||||||
|
esac; \
|
||||||
|
for file in $$dist_files; do \
|
||||||
|
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||||
|
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
fi; \
|
||||||
|
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
else \
|
||||||
|
test -f $(distdir)/$$file \
|
||||||
|
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test -d "$(distdir)/$$subdir" \
|
||||||
|
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||||
|
|| exit 1; \
|
||||||
|
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||||
|
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||||
|
(cd $$subdir && \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
top_distdir="$$top_distdir" \
|
||||||
|
distdir="$$distdir/$$subdir" \
|
||||||
|
am__remove_distdir=: \
|
||||||
|
am__skip_length_check=: \
|
||||||
|
distdir) \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
check-am: all-am
|
||||||
|
check: check-recursive
|
||||||
|
all-am: Makefile
|
||||||
|
installdirs: installdirs-recursive
|
||||||
|
installdirs-am:
|
||||||
|
install: install-recursive
|
||||||
|
install-exec: install-exec-recursive
|
||||||
|
install-data: install-data-recursive
|
||||||
|
uninstall: uninstall-recursive
|
||||||
|
|
||||||
|
install-am: all-am
|
||||||
|
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||||
|
|
||||||
|
installcheck: installcheck-recursive
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
`test -z '$(STRIP)' || \
|
||||||
|
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
@echo "This command is intended for maintainers to use"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
clean: clean-recursive
|
||||||
|
|
||||||
|
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-recursive
|
||||||
|
-rm -f Makefile
|
||||||
|
distclean-am: clean-am distclean-generic distclean-tags
|
||||||
|
|
||||||
|
dvi: dvi-recursive
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
html: html-recursive
|
||||||
|
|
||||||
|
info: info-recursive
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am:
|
||||||
|
|
||||||
|
install-dvi: install-dvi-recursive
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-html: install-html-recursive
|
||||||
|
|
||||||
|
install-info: install-info-recursive
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
|
||||||
|
install-pdf: install-pdf-recursive
|
||||||
|
|
||||||
|
install-ps: install-ps-recursive
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-recursive
|
||||||
|
-rm -f Makefile
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-recursive
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||||
|
|
||||||
|
pdf: pdf-recursive
|
||||||
|
|
||||||
|
pdf-am:
|
||||||
|
|
||||||
|
ps: ps-recursive
|
||||||
|
|
||||||
|
ps-am:
|
||||||
|
|
||||||
|
uninstall-am:
|
||||||
|
|
||||||
|
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||||
|
install-strip
|
||||||
|
|
||||||
|
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||||
|
all all-am check check-am clean clean-generic clean-libtool \
|
||||||
|
ctags ctags-recursive distclean distclean-generic \
|
||||||
|
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||||
|
html-am info info-am install install-am install-data \
|
||||||
|
install-data-am install-dvi install-dvi-am install-exec \
|
||||||
|
install-exec-am install-html install-html-am install-info \
|
||||||
|
install-info-am install-man install-pdf install-pdf-am \
|
||||||
|
install-ps install-ps-am install-strip installcheck \
|
||||||
|
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||||
|
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||||
|
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
|
||||||
|
uninstall uninstall-am
|
||||||
|
|
||||||
|
|
||||||
|
# already handled by toplevel dist-hook.
|
||||||
|
# DIST_SUBDIRS = msvc6
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
|
@ -0,0 +1,76 @@
|
||||||
|
#ifndef CPPUNIT_ADDITIONALMESSAGE_H
|
||||||
|
#define CPPUNIT_ADDITIONALMESSAGE_H
|
||||||
|
|
||||||
|
#include <cppunit/Message.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief An additional Message for assertions.
|
||||||
|
* \ingroup CreatingNewAssertions
|
||||||
|
*
|
||||||
|
* Provides a implicit constructor that takes a single string. This allow this
|
||||||
|
* class to be used as the message arguments in macros.
|
||||||
|
*
|
||||||
|
* The constructed object is either a Message with a single detail string if
|
||||||
|
* a string was passed to the macro, or a copy of the Message passed to the macro.
|
||||||
|
*
|
||||||
|
* Here is an example of usage:
|
||||||
|
* \code
|
||||||
|
*
|
||||||
|
* void checkStringEquals( const std::string &expected,
|
||||||
|
* const std::string &actual,
|
||||||
|
* const CppUnit::SourceLine &sourceLine,
|
||||||
|
* const CppUnit::AdditionalMessage &message );
|
||||||
|
*
|
||||||
|
* #define XTLUT_ASSERT_STRING_EQUAL_MESSAGE( expected, actual, message ) \
|
||||||
|
* ::XtlUt::Impl::checkStringEquals( ::Xtl::toString(expected), \
|
||||||
|
* ::Xtl::toString(actual), \
|
||||||
|
* CPPUNIT_SOURCELINE(), \
|
||||||
|
* message )
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* In the previous example, the user can specify a simple string for \a message,
|
||||||
|
* or a complex Message object.
|
||||||
|
*
|
||||||
|
* \see Message
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API AdditionalMessage : public Message
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Message SuperClass;
|
||||||
|
|
||||||
|
/// Constructs an empty Message.
|
||||||
|
AdditionalMessage();
|
||||||
|
|
||||||
|
/*! \brief Constructs a Message with the specified detail string.
|
||||||
|
* \param detail1 Detail string of the message. If empty, then it is not added.
|
||||||
|
*/
|
||||||
|
AdditionalMessage( const std::string &detail1 );
|
||||||
|
|
||||||
|
/*! \brief Constructs a Message with the specified detail string.
|
||||||
|
* \param detail1 Detail string of the message. If empty, then it is not added.
|
||||||
|
*/
|
||||||
|
AdditionalMessage( const char *detail1 );
|
||||||
|
|
||||||
|
/*! \brief Constructs a copy of the specified message.
|
||||||
|
* \param other Message to copy.
|
||||||
|
*/
|
||||||
|
AdditionalMessage( const Message &other );
|
||||||
|
|
||||||
|
/*! \brief Assignment operator.
|
||||||
|
* \param other Message to copy.
|
||||||
|
* \return Reference on this object.
|
||||||
|
*/
|
||||||
|
AdditionalMessage &operator =( const Message &other );
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_ADDITIONALMESSAGE_H
|
|
@ -0,0 +1,143 @@
|
||||||
|
#ifndef CPPUNIT_ASSERTER_H
|
||||||
|
#define CPPUNIT_ASSERTER_H
|
||||||
|
|
||||||
|
#include <cppunit/AdditionalMessage.h>
|
||||||
|
#include <cppunit/SourceLine.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class Message;
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief A set of functions to help writing assertion macros.
|
||||||
|
* \ingroup CreatingNewAssertions
|
||||||
|
*
|
||||||
|
* Here is an example of assertion, a simplified version of the
|
||||||
|
* actual assertion implemented in examples/cppunittest/XmlUniformiser.h:
|
||||||
|
* \code
|
||||||
|
* #include <cppunit/SourceLine.h>
|
||||||
|
* #include <cppunit/TestAssert.h>
|
||||||
|
*
|
||||||
|
* void
|
||||||
|
* checkXmlEqual( std::string expectedXml,
|
||||||
|
* std::string actualXml,
|
||||||
|
* CppUnit::SourceLine sourceLine )
|
||||||
|
* {
|
||||||
|
* std::string expected = XmlUniformiser( expectedXml ).stripped();
|
||||||
|
* std::string actual = XmlUniformiser( actualXml ).stripped();
|
||||||
|
*
|
||||||
|
* if ( expected == actual )
|
||||||
|
* return;
|
||||||
|
*
|
||||||
|
* ::CppUnit::Asserter::failNotEqual( expected,
|
||||||
|
* actual,
|
||||||
|
* sourceLine );
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* /// Asserts that two XML strings are equivalent.
|
||||||
|
* #define CPPUNITTEST_ASSERT_XML_EQUAL( expected, actual ) \
|
||||||
|
* checkXmlEqual( expected, actual, \
|
||||||
|
* CPPUNIT_SOURCELINE() )
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
struct Asserter
|
||||||
|
{
|
||||||
|
/*! \brief Throws a Exception with the specified message and location.
|
||||||
|
*/
|
||||||
|
static void CPPUNIT_API fail( const Message &message,
|
||||||
|
const SourceLine &sourceLine = SourceLine() );
|
||||||
|
|
||||||
|
/*! \brief Throws a Exception with the specified message and location.
|
||||||
|
* \deprecated Use fail( Message, SourceLine ) instead.
|
||||||
|
*/
|
||||||
|
static void CPPUNIT_API fail( std::string message,
|
||||||
|
const SourceLine &sourceLine = SourceLine() );
|
||||||
|
|
||||||
|
/*! \brief Throws a Exception with the specified message and location.
|
||||||
|
* \param shouldFail if \c true then the exception is thrown. Otherwise
|
||||||
|
* nothing happen.
|
||||||
|
* \param message Message explaining the assertion failiure.
|
||||||
|
* \param sourceLine Location of the assertion.
|
||||||
|
*/
|
||||||
|
static void CPPUNIT_API failIf( bool shouldFail,
|
||||||
|
const Message &message,
|
||||||
|
const SourceLine &sourceLine = SourceLine() );
|
||||||
|
|
||||||
|
/*! \brief Throws a Exception with the specified message and location.
|
||||||
|
* \deprecated Use failIf( bool, Message, SourceLine ) instead.
|
||||||
|
* \param shouldFail if \c true then the exception is thrown. Otherwise
|
||||||
|
* nothing happen.
|
||||||
|
* \param message Message explaining the assertion failiure.
|
||||||
|
* \param sourceLine Location of the assertion.
|
||||||
|
*/
|
||||||
|
static void CPPUNIT_API failIf( bool shouldFail,
|
||||||
|
std::string message,
|
||||||
|
const SourceLine &sourceLine = SourceLine() );
|
||||||
|
|
||||||
|
/*! \brief Returns a expected value string for a message.
|
||||||
|
* Typically used to create 'not equal' message, or to check that a message
|
||||||
|
* contains the expected content when writing unit tests for your custom
|
||||||
|
* assertions.
|
||||||
|
*
|
||||||
|
* \param expectedValue String that represents the expected value.
|
||||||
|
* \return \a expectedValue prefixed with "Expected: ".
|
||||||
|
* \see makeActual().
|
||||||
|
*/
|
||||||
|
static std::string CPPUNIT_API makeExpected( const std::string &expectedValue );
|
||||||
|
|
||||||
|
/*! \brief Returns an actual value string for a message.
|
||||||
|
* Typically used to create 'not equal' message, or to check that a message
|
||||||
|
* contains the expected content when writing unit tests for your custom
|
||||||
|
* assertions.
|
||||||
|
*
|
||||||
|
* \param actualValue String that represents the actual value.
|
||||||
|
* \return \a actualValue prefixed with "Actual : ".
|
||||||
|
* \see makeExpected().
|
||||||
|
*/
|
||||||
|
static std::string CPPUNIT_API makeActual( const std::string &actualValue );
|
||||||
|
|
||||||
|
static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue,
|
||||||
|
const std::string &actualValue,
|
||||||
|
const AdditionalMessage &additionalMessage = AdditionalMessage(),
|
||||||
|
const std::string &shortDescription = "equality assertion failed");
|
||||||
|
|
||||||
|
/*! \brief Throws an Exception with the specified message and location.
|
||||||
|
* \param expected Text describing the expected value.
|
||||||
|
* \param actual Text describing the actual value.
|
||||||
|
* \param sourceLine Location of the assertion.
|
||||||
|
* \param additionalMessage Additional message. Usually used to report
|
||||||
|
* what are the differences between the expected and actual value.
|
||||||
|
* \param shortDescription Short description for the failure message.
|
||||||
|
*/
|
||||||
|
static void CPPUNIT_API failNotEqual( std::string expected,
|
||||||
|
std::string actual,
|
||||||
|
const SourceLine &sourceLine,
|
||||||
|
const AdditionalMessage &additionalMessage = AdditionalMessage(),
|
||||||
|
std::string shortDescription = "equality assertion failed" );
|
||||||
|
|
||||||
|
/*! \brief Throws an Exception with the specified message and location.
|
||||||
|
* \param shouldFail if \c true then the exception is thrown. Otherwise
|
||||||
|
* nothing happen.
|
||||||
|
* \param expected Text describing the expected value.
|
||||||
|
* \param actual Text describing the actual value.
|
||||||
|
* \param sourceLine Location of the assertion.
|
||||||
|
* \param additionalMessage Additional message. Usually used to report
|
||||||
|
* where the "difference" is located.
|
||||||
|
* \param shortDescription Short description for the failure message.
|
||||||
|
*/
|
||||||
|
static void CPPUNIT_API failNotEqualIf( bool shouldFail,
|
||||||
|
std::string expected,
|
||||||
|
std::string actual,
|
||||||
|
const SourceLine &sourceLine,
|
||||||
|
const AdditionalMessage &additionalMessage = AdditionalMessage(),
|
||||||
|
std::string shortDescription = "equality assertion failed" );
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_ASSERTER_H
|
|
@ -0,0 +1,43 @@
|
||||||
|
#ifndef CPPUNIT_BRIEFTESTPROGRESSLISTENER_H
|
||||||
|
#define CPPUNIT_BRIEFTESTPROGRESSLISTENER_H
|
||||||
|
|
||||||
|
#include <cppunit/TestListener.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief TestListener that prints the name of each test before running it.
|
||||||
|
* \ingroup TrackingTestExecution
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API BriefTestProgressListener : public TestListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! Constructs a BriefTestProgressListener object.
|
||||||
|
*/
|
||||||
|
BriefTestProgressListener();
|
||||||
|
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~BriefTestProgressListener();
|
||||||
|
|
||||||
|
void startTest( Test *test );
|
||||||
|
|
||||||
|
void addFailure( const TestFailure &failure );
|
||||||
|
|
||||||
|
void endTest( Test *test );
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Prevents the use of the copy constructor.
|
||||||
|
BriefTestProgressListener( const BriefTestProgressListener © );
|
||||||
|
|
||||||
|
/// Prevents the use of the copy operator.
|
||||||
|
void operator =( const BriefTestProgressListener © );
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_lastTestFailed;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_BRIEFTESTPROGRESSLISTENER_H
|
|
@ -0,0 +1,146 @@
|
||||||
|
#ifndef CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
|
||||||
|
#define CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
#include <cppunit/Outputter.h>
|
||||||
|
#include <cppunit/portability/Stream.h>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class Exception;
|
||||||
|
class SourceLine;
|
||||||
|
class Test;
|
||||||
|
class TestFailure;
|
||||||
|
class TestResultCollector;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Outputs a TestResultCollector in a compiler compatible format.
|
||||||
|
* \ingroup WritingTestResult
|
||||||
|
*
|
||||||
|
* Printing the test results in a compiler compatible format (assertion
|
||||||
|
* location has the same format as compiler error), allow you to use your
|
||||||
|
* IDE to jump to the assertion failure. Location format can be customized (see
|
||||||
|
* setLocationFormat() ).
|
||||||
|
*
|
||||||
|
* For example, when running the test in a post-build with VC++, if an assertion
|
||||||
|
* fails, you can jump to the assertion by pressing F4 (jump to next error).
|
||||||
|
*
|
||||||
|
* Heres is an example of usage (from examples/cppunittest/CppUnitTestMain.cpp):
|
||||||
|
* \code
|
||||||
|
* int main( int argc, char* argv[] ) {
|
||||||
|
* // if command line contains "-selftest" then this is the post build check
|
||||||
|
* // => the output must be in the compiler error format.
|
||||||
|
* bool selfTest = (argc > 1) &&
|
||||||
|
* (std::string("-selftest") == argv[1]);
|
||||||
|
*
|
||||||
|
* CppUnit::TextUi::TestRunner runner;
|
||||||
|
* runner.addTest( CppUnitTest::suite() ); // Add the top suite to the test runner
|
||||||
|
*
|
||||||
|
* if ( selfTest )
|
||||||
|
* { // Change the default outputter to a compiler error format outputter
|
||||||
|
* // The test runner owns the new outputter.
|
||||||
|
* runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
|
||||||
|
* std::cerr ) );
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* // Run the test and don't wait a key if post build check.
|
||||||
|
* bool wasSuccessful = runner.run( "", !selfTest );
|
||||||
|
*
|
||||||
|
* // Return error code 1 if the one of test failed.
|
||||||
|
* return wasSuccessful ? 0 : 1;
|
||||||
|
* }
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API CompilerOutputter : public Outputter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Constructs a CompilerOutputter object.
|
||||||
|
* \param result Result of the test run.
|
||||||
|
* \param stream Stream used to output test result.
|
||||||
|
* \param locationFormat Error location format used by your compiler. Default
|
||||||
|
* to \c CPPUNIT_COMPILER_LOCATION_FORMAT which is defined
|
||||||
|
* in the configuration file. See setLocationFormat() for detail.
|
||||||
|
* \see setLocationFormat().
|
||||||
|
*/
|
||||||
|
CompilerOutputter( TestResultCollector *result,
|
||||||
|
OStream &stream,
|
||||||
|
const std::string &locationFormat = CPPUNIT_COMPILER_LOCATION_FORMAT );
|
||||||
|
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~CompilerOutputter();
|
||||||
|
|
||||||
|
/*! \brief Sets the error location format.
|
||||||
|
*
|
||||||
|
* Indicates the format used to report location of failed assertion. This format should
|
||||||
|
* match the one used by your compiler.
|
||||||
|
*
|
||||||
|
* The location format is a string in which the occurence of the following character
|
||||||
|
* sequence are replaced:
|
||||||
|
*
|
||||||
|
* - "%l" => replaced by the line number
|
||||||
|
* - "%p" => replaced by the full path name of the file ("G:\prg\vc\cppunit\MyTest.cpp")
|
||||||
|
* - "%f" => replaced by the base name of the file ("MyTest.cpp")
|
||||||
|
*
|
||||||
|
* Some examples:
|
||||||
|
*
|
||||||
|
* - VC++ error location format: "%p(%l):" => produce "G:\prg\MyTest.cpp(43):"
|
||||||
|
* - GCC error location format: "%f:%l:" => produce "MyTest.cpp:43:"
|
||||||
|
*
|
||||||
|
* Thoses are the two compilers currently <em>supported</em> (gcc format is used if
|
||||||
|
* VC++ is not detected). If you want your compiler to be automatically supported by
|
||||||
|
* CppUnit, send a mail to the mailing list (preferred), or submit a feature request
|
||||||
|
* that indicates how to detect your compiler with the preprocessor (\#ifdef...) and
|
||||||
|
* your compiler location format.
|
||||||
|
*/
|
||||||
|
void setLocationFormat( const std::string &locationFormat );
|
||||||
|
|
||||||
|
/*! \brief Creates an instance of an outputter that matches your current compiler.
|
||||||
|
* \deprecated This class is specialized through parameterization instead of subclassing...
|
||||||
|
* Use CompilerOutputter::CompilerOutputter instead.
|
||||||
|
*/
|
||||||
|
static CompilerOutputter *defaultOutputter( TestResultCollector *result,
|
||||||
|
OStream &stream );
|
||||||
|
|
||||||
|
void write();
|
||||||
|
|
||||||
|
void setNoWrap();
|
||||||
|
|
||||||
|
void setWrapColumn( int wrapColumn );
|
||||||
|
|
||||||
|
int wrapColumn() const;
|
||||||
|
|
||||||
|
virtual void printSuccess();
|
||||||
|
virtual void printFailureReport();
|
||||||
|
virtual void printFailuresList();
|
||||||
|
virtual void printStatistics();
|
||||||
|
virtual void printFailureDetail( TestFailure *failure );
|
||||||
|
virtual void printFailureLocation( SourceLine sourceLine );
|
||||||
|
virtual void printFailureType( TestFailure *failure );
|
||||||
|
virtual void printFailedTestName( TestFailure *failure );
|
||||||
|
virtual void printFailureMessage( TestFailure *failure );
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Prevents the use of the copy constructor.
|
||||||
|
CompilerOutputter( const CompilerOutputter © );
|
||||||
|
|
||||||
|
/// Prevents the use of the copy operator.
|
||||||
|
void operator =( const CompilerOutputter © );
|
||||||
|
|
||||||
|
virtual bool processLocationFormatCommand( char command,
|
||||||
|
const SourceLine &sourceLine );
|
||||||
|
|
||||||
|
virtual std::string extractBaseName( const std::string &fileName ) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
TestResultCollector *m_result;
|
||||||
|
OStream &m_stream;
|
||||||
|
std::string m_locationFormat;
|
||||||
|
int m_wrapColumn;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
|
|
@ -0,0 +1,90 @@
|
||||||
|
#ifndef CPPUNIT_EXCEPTION_H
|
||||||
|
#define CPPUNIT_EXCEPTION_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
#include <cppunit/Message.h>
|
||||||
|
#include <cppunit/SourceLine.h>
|
||||||
|
#include <exception>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Exceptions thrown by failed assertions.
|
||||||
|
* \ingroup BrowsingCollectedTestResult
|
||||||
|
*
|
||||||
|
* Exception is an exception that serves
|
||||||
|
* descriptive strings through its what() method
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API Exception : public std::exception
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Constructs the exception with the specified message and source location.
|
||||||
|
* \param message Message associated to the exception.
|
||||||
|
* \param sourceLine Source location related to the exception.
|
||||||
|
*/
|
||||||
|
Exception( const Message &message = Message(),
|
||||||
|
const SourceLine &sourceLine = SourceLine() );
|
||||||
|
|
||||||
|
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
|
||||||
|
/*!
|
||||||
|
* \deprecated Use other constructor instead.
|
||||||
|
*/
|
||||||
|
Exception( std::string message,
|
||||||
|
long lineNumber,
|
||||||
|
std::string fileName );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*! \brief Constructs a copy of an exception.
|
||||||
|
* \param other Exception to copy.
|
||||||
|
*/
|
||||||
|
Exception( const Exception &other );
|
||||||
|
|
||||||
|
/// Destructs the exception
|
||||||
|
virtual ~Exception() throw();
|
||||||
|
|
||||||
|
/// Performs an assignment
|
||||||
|
Exception &operator =( const Exception &other );
|
||||||
|
|
||||||
|
/// Returns descriptive message
|
||||||
|
const char *what() const throw();
|
||||||
|
|
||||||
|
/// Location where the error occured
|
||||||
|
SourceLine sourceLine() const;
|
||||||
|
|
||||||
|
/// Message related to the exception.
|
||||||
|
Message message() const;
|
||||||
|
|
||||||
|
/// Set the message.
|
||||||
|
void setMessage( const Message &message );
|
||||||
|
|
||||||
|
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
|
||||||
|
/// The line on which the error occurred
|
||||||
|
long lineNumber() const;
|
||||||
|
|
||||||
|
/// The file in which the error occurred
|
||||||
|
std::string fileName() const;
|
||||||
|
|
||||||
|
static const std::string UNKNOWNFILENAME;
|
||||||
|
static const long UNKNOWNLINENUMBER;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// Clones the exception.
|
||||||
|
virtual Exception *clone() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// VC++ does not recognize call to parent class when prefixed
|
||||||
|
// with a namespace. This is a workaround.
|
||||||
|
typedef std::exception SuperClass;
|
||||||
|
|
||||||
|
Message m_message;
|
||||||
|
SourceLine m_sourceLine;
|
||||||
|
std::string m_whatMessage;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_EXCEPTION_H
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
SUBDIRS = extensions ui plugin config tools portability
|
||||||
|
|
||||||
|
DISTCLEANFILES = config-auto.h
|
||||||
|
|
||||||
|
libcppunitincludedir = $(includedir)/cppunit
|
||||||
|
libcppunitinclude_HEADERS = \
|
||||||
|
config-auto.h \
|
||||||
|
AdditionalMessage.h \
|
||||||
|
Asserter.h \
|
||||||
|
BriefTestProgressListener.h \
|
||||||
|
CompilerOutputter.h \
|
||||||
|
Exception.h \
|
||||||
|
Message.h \
|
||||||
|
Outputter.h \
|
||||||
|
Portability.h \
|
||||||
|
Protector.h \
|
||||||
|
SourceLine.h \
|
||||||
|
SynchronizedObject.h \
|
||||||
|
Test.h \
|
||||||
|
TestAssert.h \
|
||||||
|
TestCase.h \
|
||||||
|
TestCaller.h \
|
||||||
|
TestComposite.h \
|
||||||
|
TestFailure.h \
|
||||||
|
TestFixture.h \
|
||||||
|
TestLeaf.h \
|
||||||
|
TestPath.h \
|
||||||
|
TestResult.h \
|
||||||
|
TestResultCollector.h \
|
||||||
|
TestRunner.h \
|
||||||
|
TestSuccessListener.h \
|
||||||
|
TestSuite.h \
|
||||||
|
TextOutputter.h \
|
||||||
|
TextTestProgressListener.h \
|
||||||
|
TextTestResult.h \
|
||||||
|
TextTestRunner.h \
|
||||||
|
TestListener.h \
|
||||||
|
XmlOutputter.h \
|
||||||
|
XmlOutputterHook.h
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
rm -f $(distdir)/config-auto.h
|
|
@ -0,0 +1,587 @@
|
||||||
|
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
VPATH = @srcdir@
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
install_sh_DATA = $(install_sh) -c -m 644
|
||||||
|
install_sh_PROGRAM = $(install_sh) -c
|
||||||
|
install_sh_SCRIPT = $(install_sh) -c
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = $(program_transform_name)
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
build_triplet = @build@
|
||||||
|
host_triplet = @host@
|
||||||
|
subdir = include/cppunit
|
||||||
|
DIST_COMMON = $(libcppunitinclude_HEADERS) $(srcdir)/Makefile.am \
|
||||||
|
$(srcdir)/Makefile.in
|
||||||
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
|
am__aclocal_m4_deps = \
|
||||||
|
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_rtti.m4 \
|
||||||
|
$(top_srcdir)/config/ac_cxx_string_compare_string_first.m4 \
|
||||||
|
$(top_srcdir)/config/ac_dll.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_gcc_abi_demangle.m4 \
|
||||||
|
$(top_srcdir)/config/ax_cxx_have_isfinite.m4 \
|
||||||
|
$(top_srcdir)/config/bb_enable_doxygen.m4 \
|
||||||
|
$(top_srcdir)/configure.in
|
||||||
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
|
$(ACLOCAL_M4)
|
||||||
|
mkinstalldirs = $(install_sh) -d
|
||||||
|
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||||
|
CONFIG_CLEAN_FILES =
|
||||||
|
SOURCES =
|
||||||
|
DIST_SOURCES =
|
||||||
|
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||||
|
html-recursive info-recursive install-data-recursive \
|
||||||
|
install-dvi-recursive install-exec-recursive \
|
||||||
|
install-html-recursive install-info-recursive \
|
||||||
|
install-pdf-recursive install-ps-recursive install-recursive \
|
||||||
|
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||||
|
ps-recursive uninstall-recursive
|
||||||
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
|
am__vpath_adj = case $$p in \
|
||||||
|
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||||
|
*) f=$$p;; \
|
||||||
|
esac;
|
||||||
|
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||||
|
am__installdirs = "$(DESTDIR)$(libcppunitincludedir)"
|
||||||
|
libcppunitincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||||
|
HEADERS = $(libcppunitinclude_HEADERS)
|
||||||
|
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||||
|
distclean-recursive maintainer-clean-recursive
|
||||||
|
ETAGS = etags
|
||||||
|
CTAGS = ctags
|
||||||
|
DIST_SUBDIRS = $(SUBDIRS)
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AR = @AR@
|
||||||
|
AS = @AS@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AWK = @AWK@
|
||||||
|
CC = @CC@
|
||||||
|
CCDEPMODE = @CCDEPMODE@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
CPP = @CPP@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_BINARY_AGE = @CPPUNIT_BINARY_AGE@
|
||||||
|
CPPUNIT_INTERFACE_AGE = @CPPUNIT_INTERFACE_AGE@
|
||||||
|
CPPUNIT_MAJOR_VERSION = @CPPUNIT_MAJOR_VERSION@
|
||||||
|
CPPUNIT_MICRO_VERSION = @CPPUNIT_MICRO_VERSION@
|
||||||
|
CPPUNIT_MINOR_VERSION = @CPPUNIT_MINOR_VERSION@
|
||||||
|
CPPUNIT_VERSION = @CPPUNIT_VERSION@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
|
CYGPATH_W = @CYGPATH_W@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
DLLTOOL = @DLLTOOL@
|
||||||
|
DOT = @DOT@
|
||||||
|
DOXYGEN = @DOXYGEN@
|
||||||
|
DSYMUTIL = @DSYMUTIL@
|
||||||
|
ECHO = @ECHO@
|
||||||
|
ECHO_C = @ECHO_C@
|
||||||
|
ECHO_N = @ECHO_N@
|
||||||
|
ECHO_T = @ECHO_T@
|
||||||
|
EGREP = @EGREP@
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
F77 = @F77@
|
||||||
|
FFLAGS = @FFLAGS@
|
||||||
|
GREP = @GREP@
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
LIBADD_DL = @LIBADD_DL@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LN_S = @LN_S@
|
||||||
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_AGE = @LT_AGE@
|
||||||
|
LT_CURRENT = @LT_CURRENT@
|
||||||
|
LT_RELEASE = @LT_RELEASE@
|
||||||
|
LT_REVISION = @LT_REVISION@
|
||||||
|
MAKEINFO = @MAKEINFO@
|
||||||
|
MKDIR_P = @MKDIR_P@
|
||||||
|
NMEDIT = @NMEDIT@
|
||||||
|
OBJDUMP = @OBJDUMP@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||||
|
PACKAGE_NAME = @PACKAGE_NAME@
|
||||||
|
PACKAGE_STRING = @PACKAGE_STRING@
|
||||||
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
SED = @SED@
|
||||||
|
SET_MAKE = @SET_MAKE@
|
||||||
|
SHELL = @SHELL@
|
||||||
|
STRIP = @STRIP@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
abs_builddir = @abs_builddir@
|
||||||
|
abs_srcdir = @abs_srcdir@
|
||||||
|
abs_top_builddir = @abs_top_builddir@
|
||||||
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
|
ac_ct_F77 = @ac_ct_F77@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__leading_dot = @am__leading_dot@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
am__tar = @am__tar@
|
||||||
|
am__untar = @am__untar@
|
||||||
|
bindir = @bindir@
|
||||||
|
build = @build@
|
||||||
|
build_alias = @build_alias@
|
||||||
|
build_cpu = @build_cpu@
|
||||||
|
build_os = @build_os@
|
||||||
|
build_vendor = @build_vendor@
|
||||||
|
builddir = @builddir@
|
||||||
|
datadir = @datadir@
|
||||||
|
datarootdir = @datarootdir@
|
||||||
|
docdir = @docdir@
|
||||||
|
dvidir = @dvidir@
|
||||||
|
enable_dot = @enable_dot@
|
||||||
|
enable_html_docs = @enable_html_docs@
|
||||||
|
enable_latex_docs = @enable_latex_docs@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
host = @host@
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_cpu = @host_cpu@
|
||||||
|
host_os = @host_os@
|
||||||
|
host_vendor = @host_vendor@
|
||||||
|
htmldir = @htmldir@
|
||||||
|
includedir = @includedir@
|
||||||
|
infodir = @infodir@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
libdir = @libdir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
localedir = @localedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
mandir = @mandir@
|
||||||
|
mkdir_p = @mkdir_p@
|
||||||
|
oldincludedir = @oldincludedir@
|
||||||
|
pdfdir = @pdfdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
program_transform_name = @program_transform_name@
|
||||||
|
psdir = @psdir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
target_alias = @target_alias@
|
||||||
|
top_builddir = @top_builddir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
SUBDIRS = extensions ui plugin config tools portability
|
||||||
|
DISTCLEANFILES = config-auto.h
|
||||||
|
libcppunitincludedir = $(includedir)/cppunit
|
||||||
|
libcppunitinclude_HEADERS = \
|
||||||
|
config-auto.h \
|
||||||
|
AdditionalMessage.h \
|
||||||
|
Asserter.h \
|
||||||
|
BriefTestProgressListener.h \
|
||||||
|
CompilerOutputter.h \
|
||||||
|
Exception.h \
|
||||||
|
Message.h \
|
||||||
|
Outputter.h \
|
||||||
|
Portability.h \
|
||||||
|
Protector.h \
|
||||||
|
SourceLine.h \
|
||||||
|
SynchronizedObject.h \
|
||||||
|
Test.h \
|
||||||
|
TestAssert.h \
|
||||||
|
TestCase.h \
|
||||||
|
TestCaller.h \
|
||||||
|
TestComposite.h \
|
||||||
|
TestFailure.h \
|
||||||
|
TestFixture.h \
|
||||||
|
TestLeaf.h \
|
||||||
|
TestPath.h \
|
||||||
|
TestResult.h \
|
||||||
|
TestResultCollector.h \
|
||||||
|
TestRunner.h \
|
||||||
|
TestSuccessListener.h \
|
||||||
|
TestSuite.h \
|
||||||
|
TextOutputter.h \
|
||||||
|
TextTestProgressListener.h \
|
||||||
|
TextTestResult.h \
|
||||||
|
TextTestRunner.h \
|
||||||
|
TestListener.h \
|
||||||
|
XmlOutputter.h \
|
||||||
|
XmlOutputterHook.h
|
||||||
|
|
||||||
|
all: all-recursive
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
|
@for dep in $?; do \
|
||||||
|
case '$(am__configure_deps)' in \
|
||||||
|
*$$dep*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||||
|
&& exit 0; \
|
||||||
|
exit 1;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/cppunit/Makefile'; \
|
||||||
|
cd $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu include/cppunit/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
@case '$?' in \
|
||||||
|
*config.status*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
|
*) \
|
||||||
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
|
esac;
|
||||||
|
|
||||||
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
|
$(top_srcdir)/configure: $(am__configure_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
|
mostlyclean-libtool:
|
||||||
|
-rm -f *.lo
|
||||||
|
|
||||||
|
clean-libtool:
|
||||||
|
-rm -rf .libs _libs
|
||||||
|
install-libcppunitincludeHEADERS: $(libcppunitinclude_HEADERS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
test -z "$(libcppunitincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libcppunitincludedir)"
|
||||||
|
@list='$(libcppunitinclude_HEADERS)'; for p in $$list; do \
|
||||||
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " $(libcppunitincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libcppunitincludedir)/$$f'"; \
|
||||||
|
$(libcppunitincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libcppunitincludedir)/$$f"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-libcppunitincludeHEADERS:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(libcppunitinclude_HEADERS)'; for p in $$list; do \
|
||||||
|
f=$(am__strip_dir) \
|
||||||
|
echo " rm -f '$(DESTDIR)$(libcppunitincludedir)/$$f'"; \
|
||||||
|
rm -f "$(DESTDIR)$(libcppunitincludedir)/$$f"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
# This directory's subdirectories are mostly independent; you can cd
|
||||||
|
# into them and run `make' without going through this Makefile.
|
||||||
|
# To change the values of `make' variables: instead of editing Makefiles,
|
||||||
|
# (1) if the variable is set in `config.status', edit `config.status'
|
||||||
|
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||||
|
# (2) otherwise, pass the desired values on the `make' command line.
|
||||||
|
$(RECURSIVE_TARGETS):
|
||||||
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
dot_seen=no; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
dot_seen=yes; \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| eval $$failcom; \
|
||||||
|
done; \
|
||||||
|
if test "$$dot_seen" = "no"; then \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
|
fi; test -z "$$fail"
|
||||||
|
|
||||||
|
$(RECURSIVE_CLEAN_TARGETS):
|
||||||
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
dot_seen=no; \
|
||||||
|
case "$@" in \
|
||||||
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
|
*) list='$(SUBDIRS)' ;; \
|
||||||
|
esac; \
|
||||||
|
rev=''; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = "."; then :; else \
|
||||||
|
rev="$$subdir $$rev"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
rev="$$rev ."; \
|
||||||
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
|
for subdir in $$rev; do \
|
||||||
|
echo "Making $$target in $$subdir"; \
|
||||||
|
if test "$$subdir" = "."; then \
|
||||||
|
local_target="$$target-am"; \
|
||||||
|
else \
|
||||||
|
local_target="$$target"; \
|
||||||
|
fi; \
|
||||||
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|
|| eval $$failcom; \
|
||||||
|
done && test -z "$$fail"
|
||||||
|
tags-recursive:
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||||
|
done
|
||||||
|
ctags-recursive:
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||||
|
done
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
mkid -fID $$unique
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
tags=; \
|
||||||
|
here=`pwd`; \
|
||||||
|
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||||
|
include_option=--etags-include; \
|
||||||
|
empty_fix=.; \
|
||||||
|
else \
|
||||||
|
include_option=--include; \
|
||||||
|
empty_fix=; \
|
||||||
|
fi; \
|
||||||
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test ! -f $$subdir/TAGS || \
|
||||||
|
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||||
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||||
|
$$tags $$unique; \
|
||||||
|
fi
|
||||||
|
ctags: CTAGS
|
||||||
|
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
tags=; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||||
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
|
$$tags $$unique
|
||||||
|
|
||||||
|
GTAGS:
|
||||||
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
|
&& cd $(top_srcdir) \
|
||||||
|
&& gtags -i $(GTAGS_ARGS) $$here
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
list='$(DISTFILES)'; \
|
||||||
|
dist_files=`for file in $$list; do echo $$file; done | \
|
||||||
|
sed -e "s|^$$srcdirstrip/||;t" \
|
||||||
|
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||||
|
case $$dist_files in \
|
||||||
|
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||||
|
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||||
|
sort -u` ;; \
|
||||||
|
esac; \
|
||||||
|
for file in $$dist_files; do \
|
||||||
|
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||||
|
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
fi; \
|
||||||
|
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||||
|
else \
|
||||||
|
test -f $(distdir)/$$file \
|
||||||
|
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
if test "$$subdir" = .; then :; else \
|
||||||
|
test -d "$(distdir)/$$subdir" \
|
||||||
|
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||||
|
|| exit 1; \
|
||||||
|
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||||
|
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||||
|
(cd $$subdir && \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
top_distdir="$$top_distdir" \
|
||||||
|
distdir="$$distdir/$$subdir" \
|
||||||
|
am__remove_distdir=: \
|
||||||
|
am__skip_length_check=: \
|
||||||
|
distdir) \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||||
|
dist-hook
|
||||||
|
check-am: all-am
|
||||||
|
check: check-recursive
|
||||||
|
all-am: Makefile $(HEADERS)
|
||||||
|
installdirs: installdirs-recursive
|
||||||
|
installdirs-am:
|
||||||
|
for dir in "$(DESTDIR)$(libcppunitincludedir)"; do \
|
||||||
|
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||||
|
done
|
||||||
|
install: install-recursive
|
||||||
|
install-exec: install-exec-recursive
|
||||||
|
install-data: install-data-recursive
|
||||||
|
uninstall: uninstall-recursive
|
||||||
|
|
||||||
|
install-am: all-am
|
||||||
|
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||||
|
|
||||||
|
installcheck: installcheck-recursive
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
`test -z '$(STRIP)' || \
|
||||||
|
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
@echo "This command is intended for maintainers to use"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
clean: clean-recursive
|
||||||
|
|
||||||
|
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-recursive
|
||||||
|
-rm -f Makefile
|
||||||
|
distclean-am: clean-am distclean-generic distclean-tags
|
||||||
|
|
||||||
|
dvi: dvi-recursive
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
html: html-recursive
|
||||||
|
|
||||||
|
info: info-recursive
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am: install-libcppunitincludeHEADERS
|
||||||
|
|
||||||
|
install-dvi: install-dvi-recursive
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-html: install-html-recursive
|
||||||
|
|
||||||
|
install-info: install-info-recursive
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
|
||||||
|
install-pdf: install-pdf-recursive
|
||||||
|
|
||||||
|
install-ps: install-ps-recursive
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-recursive
|
||||||
|
-rm -f Makefile
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-recursive
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||||
|
|
||||||
|
pdf: pdf-recursive
|
||||||
|
|
||||||
|
pdf-am:
|
||||||
|
|
||||||
|
ps: ps-recursive
|
||||||
|
|
||||||
|
ps-am:
|
||||||
|
|
||||||
|
uninstall-am: uninstall-libcppunitincludeHEADERS
|
||||||
|
|
||||||
|
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||||
|
install-strip
|
||||||
|
|
||||||
|
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||||
|
all all-am check check-am clean clean-generic clean-libtool \
|
||||||
|
ctags ctags-recursive dist-hook distclean distclean-generic \
|
||||||
|
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||||
|
html-am info info-am install install-am install-data \
|
||||||
|
install-data-am install-dvi install-dvi-am install-exec \
|
||||||
|
install-exec-am install-html install-html-am install-info \
|
||||||
|
install-info-am install-libcppunitincludeHEADERS install-man \
|
||||||
|
install-pdf install-pdf-am install-ps install-ps-am \
|
||||||
|
install-strip installcheck installcheck-am installdirs \
|
||||||
|
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||||
|
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||||
|
ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||||
|
uninstall-libcppunitincludeHEADERS
|
||||||
|
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
rm -f $(distdir)/config-auto.h
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
|
@ -0,0 +1,156 @@
|
||||||
|
#ifndef CPPUNIT_MESSAGE_H
|
||||||
|
#define CPPUNIT_MESSAGE_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <cppunit/portability/CppUnitDeque.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
// template class CPPUNIT_API std::deque<std::string>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*! \brief Message associated to an Exception.
|
||||||
|
* \ingroup CreatingNewAssertions
|
||||||
|
* A message is composed of two items:
|
||||||
|
* - a short description (~20/30 characters)
|
||||||
|
* - a list of detail strings
|
||||||
|
*
|
||||||
|
* The short description is used to indicate how the detail strings should be
|
||||||
|
* interpreted. It usually indicates the failure types, such as
|
||||||
|
* "assertion failed", "forced failure", "unexpected exception caught",
|
||||||
|
* "equality assertion failed"... It should not contains new line character (\n).
|
||||||
|
*
|
||||||
|
* Detail strings are used to provide more information about the failure. It
|
||||||
|
* can contains the asserted expression, the expected and actual values in an
|
||||||
|
* equality assertion, some addional messages... Detail strings can contains
|
||||||
|
* new line characters (\n).
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API Message
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Message();
|
||||||
|
|
||||||
|
// Ensure thread-safe copy by detaching the string.
|
||||||
|
Message( const Message &other );
|
||||||
|
|
||||||
|
explicit Message( const std::string &shortDescription );
|
||||||
|
|
||||||
|
Message( const std::string &shortDescription,
|
||||||
|
const std::string &detail1 );
|
||||||
|
|
||||||
|
Message( const std::string &shortDescription,
|
||||||
|
const std::string &detail1,
|
||||||
|
const std::string &detail2 );
|
||||||
|
|
||||||
|
Message( const std::string &shortDescription,
|
||||||
|
const std::string &detail1,
|
||||||
|
const std::string &detail2,
|
||||||
|
const std::string &detail3 );
|
||||||
|
|
||||||
|
Message &operator =( const Message &other );
|
||||||
|
|
||||||
|
/*! \brief Returns the short description.
|
||||||
|
* \return Short description.
|
||||||
|
*/
|
||||||
|
const std::string &shortDescription() const;
|
||||||
|
|
||||||
|
/*! \brief Returns the number of detail string.
|
||||||
|
* \return Number of detail string.
|
||||||
|
*/
|
||||||
|
int detailCount() const;
|
||||||
|
|
||||||
|
/*! \brief Returns the detail at the specified index.
|
||||||
|
* \param index Zero based index of the detail string to return.
|
||||||
|
* \returns Detail string at the specified index.
|
||||||
|
* \exception std::invalid_argument if \a index < 0 or index >= detailCount().
|
||||||
|
*/
|
||||||
|
std::string detailAt( int index ) const;
|
||||||
|
|
||||||
|
/*! \brief Returns a string that represents a list of the detail strings.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* \code
|
||||||
|
* Message message( "not equal", "Expected: 3", "Actual: 7" );
|
||||||
|
* std::string details = message.details();
|
||||||
|
* // details contains:
|
||||||
|
* // "- Expected: 3\n- Actual: 7\n" \endcode
|
||||||
|
*
|
||||||
|
* \return A string that is a concatenation of all the detail strings. Each detail
|
||||||
|
* string is prefixed with '- ' and suffixed with '\n' before being
|
||||||
|
* concatenated to the other.
|
||||||
|
*/
|
||||||
|
std::string details() const;
|
||||||
|
|
||||||
|
/*! \brief Removes all detail strings.
|
||||||
|
*/
|
||||||
|
void clearDetails();
|
||||||
|
|
||||||
|
/*! \brief Adds a single detail string.
|
||||||
|
* \param detail Detail string to add.
|
||||||
|
*/
|
||||||
|
void addDetail( const std::string &detail );
|
||||||
|
|
||||||
|
/*! \brief Adds two detail strings.
|
||||||
|
* \param detail1 Detail string to add.
|
||||||
|
* \param detail2 Detail string to add.
|
||||||
|
*/
|
||||||
|
void addDetail( const std::string &detail1,
|
||||||
|
const std::string &detail2 );
|
||||||
|
|
||||||
|
/*! \brief Adds three detail strings.
|
||||||
|
* \param detail1 Detail string to add.
|
||||||
|
* \param detail2 Detail string to add.
|
||||||
|
* \param detail3 Detail string to add.
|
||||||
|
*/
|
||||||
|
void addDetail( const std::string &detail1,
|
||||||
|
const std::string &detail2,
|
||||||
|
const std::string &detail3 );
|
||||||
|
|
||||||
|
/*! \brief Adds the detail strings of the specified message.
|
||||||
|
* \param message All the detail strings of this message are added to this one.
|
||||||
|
*/
|
||||||
|
void addDetail( const Message &message );
|
||||||
|
|
||||||
|
/*! \brief Sets the short description.
|
||||||
|
* \param shortDescription New short description.
|
||||||
|
*/
|
||||||
|
void setShortDescription( const std::string &shortDescription );
|
||||||
|
|
||||||
|
/*! \brief Tests if a message is identical to another one.
|
||||||
|
* \param other Message this message is compared to.
|
||||||
|
* \return \c true if the two message are identical, \c false otherwise.
|
||||||
|
*/
|
||||||
|
bool operator ==( const Message &other ) const;
|
||||||
|
|
||||||
|
/*! \brief Tests if a message is different from another one.
|
||||||
|
* \param other Message this message is compared to.
|
||||||
|
* \return \c true if the two message are not identical, \c false otherwise.
|
||||||
|
*/
|
||||||
|
bool operator !=( const Message &other ) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string m_shortDescription;
|
||||||
|
|
||||||
|
typedef CppUnitDeque<std::string> Details;
|
||||||
|
Details m_details;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
#pragma warning( pop )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_MESSAGE_H
|
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef CPPUNIT_OUTPUTTER_H
|
||||||
|
#define CPPUNIT_OUTPUTTER_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Abstract outputter to print test result summary.
|
||||||
|
* \ingroup WritingTestResult
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API Outputter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~Outputter() {}
|
||||||
|
|
||||||
|
virtual void write() =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_OUTPUTTER_H
|
|
@ -0,0 +1,177 @@
|
||||||
|
#ifndef CPPUNIT_PORTABILITY_H
|
||||||
|
#define CPPUNIT_PORTABILITY_H
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(WIN32)
|
||||||
|
# define WIN32 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* include platform specific config */
|
||||||
|
#if defined(__BORLANDC__)
|
||||||
|
# include <cppunit/config/config-bcb5.h>
|
||||||
|
#elif defined (_MSC_VER)
|
||||||
|
# if _MSC_VER == 1200 && defined(_WIN32_WCE) //evc4
|
||||||
|
# include <cppunit/config/config-evc4.h>
|
||||||
|
# else
|
||||||
|
# include <cppunit/config/config-msvc6.h>
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# include <cppunit/config-auto.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Version number of package
|
||||||
|
#ifndef CPPUNIT_VERSION
|
||||||
|
#define CPPUNIT_VERSION "1.12.0"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <cppunit/config/CppUnitApi.h> // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL
|
||||||
|
#include <cppunit/config/SelectDllLoader.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Options that the library user may switch on or off.
|
||||||
|
* If the user has not done so, we chose default values.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Define to 1 if you wish to have the old-style macros
|
||||||
|
assert(), assertEqual(), assertDoublesEqual(), and assertLongsEqual() */
|
||||||
|
#if !defined(CPPUNIT_ENABLE_NAKED_ASSERT)
|
||||||
|
# define CPPUNIT_ENABLE_NAKED_ASSERT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you wish to have the old-style CU_TEST family
|
||||||
|
of macros. */
|
||||||
|
#if !defined(CPPUNIT_ENABLE_CU_TEST_MACROS)
|
||||||
|
# define CPPUNIT_ENABLE_CU_TEST_MACROS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if the preprocessor expands (#foo) to "foo" (quotes incl.)
|
||||||
|
I don't think there is any C preprocess that does NOT support this! */
|
||||||
|
#if !defined(CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION)
|
||||||
|
# define CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Assumes that STL and CppUnit are in global space if the compiler does not
|
||||||
|
support namespace. */
|
||||||
|
#if !defined(CPPUNIT_HAVE_NAMESPACES)
|
||||||
|
# if !defined(CPPUNIT_NO_NAMESPACE)
|
||||||
|
# define CPPUNIT_NO_NAMESPACE 1
|
||||||
|
# endif // !defined(CPPUNIT_NO_NAMESPACE)
|
||||||
|
# if !defined(CPPUNIT_NO_STD_NAMESPACE)
|
||||||
|
# define CPPUNIT_NO_STD_NAMESPACE 1
|
||||||
|
# endif // !defined(CPPUNIT_NO_STD_NAMESPACE)
|
||||||
|
#endif // !defined(CPPUNIT_HAVE_NAMESPACES)
|
||||||
|
|
||||||
|
/* Define CPPUNIT_STD_NEED_ALLOCATOR to 1 if you need to specify
|
||||||
|
* the allocator you used when instantiating STL container. Typically
|
||||||
|
* used for compilers that do not support template default parameter.
|
||||||
|
* CPPUNIT_STD_ALLOCATOR will be used as the allocator. Default is
|
||||||
|
* std::allocator. On some compilers, you may need to change this to
|
||||||
|
* std::allocator<T>.
|
||||||
|
*/
|
||||||
|
#if CPPUNIT_STD_NEED_ALLOCATOR
|
||||||
|
# if !defined(CPPUNIT_STD_ALLOCATOR)
|
||||||
|
# define CPPUNIT_STD_ALLOCATOR std::allocator
|
||||||
|
# endif // !defined(CPPUNIT_STD_ALLOCATOR)
|
||||||
|
#endif // defined(CPPUNIT_STD_NEED_ALLOCATOR)
|
||||||
|
|
||||||
|
|
||||||
|
// Compiler error location format for CompilerOutputter
|
||||||
|
// If not define, assumes that it's gcc
|
||||||
|
// See class CompilerOutputter for format.
|
||||||
|
#if !defined(CPPUNIT_COMPILER_LOCATION_FORMAT)
|
||||||
|
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) )
|
||||||
|
// gcc/Xcode integration on Mac OS X
|
||||||
|
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p:%l: "
|
||||||
|
#else
|
||||||
|
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%f:%l:"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// If CPPUNIT_HAVE_CPP_CAST is defined, then c++ style cast will be used,
|
||||||
|
// otherwise, C style cast are used.
|
||||||
|
#if defined( CPPUNIT_HAVE_CPP_CAST )
|
||||||
|
# define CPPUNIT_CONST_CAST( TargetType, pointer ) \
|
||||||
|
const_cast<TargetType>( pointer )
|
||||||
|
|
||||||
|
# define CPPUNIT_STATIC_CAST( TargetType, pointer ) \
|
||||||
|
static_cast<TargetType>( pointer )
|
||||||
|
#else // defined( CPPUNIT_HAVE_CPP_CAST )
|
||||||
|
# define CPPUNIT_CONST_CAST( TargetType, pointer ) \
|
||||||
|
((TargetType)( pointer ))
|
||||||
|
# define CPPUNIT_STATIC_CAST( TargetType, pointer ) \
|
||||||
|
((TargetType)( pointer ))
|
||||||
|
#endif // defined( CPPUNIT_HAVE_CPP_CAST )
|
||||||
|
|
||||||
|
// If CPPUNIT_NO_STD_NAMESPACE is defined then STL are in the global space.
|
||||||
|
// => Define macro 'std' to nothing
|
||||||
|
#if defined(CPPUNIT_NO_STD_NAMESPACE)
|
||||||
|
# undef std
|
||||||
|
# define std
|
||||||
|
#endif // defined(CPPUNIT_NO_STD_NAMESPACE)
|
||||||
|
|
||||||
|
// If CPPUNIT_NO_NAMESPACE is defined, then put CppUnit classes in the
|
||||||
|
// global namespace: the compiler does not support namespace.
|
||||||
|
#if defined(CPPUNIT_NO_NAMESPACE)
|
||||||
|
# define CPPUNIT_NS_BEGIN
|
||||||
|
# define CPPUNIT_NS_END
|
||||||
|
# define CPPUNIT_NS
|
||||||
|
#else // defined(CPPUNIT_NO_NAMESPACE)
|
||||||
|
# define CPPUNIT_NS_BEGIN namespace CppUnit {
|
||||||
|
# define CPPUNIT_NS_END }
|
||||||
|
# define CPPUNIT_NS CppUnit
|
||||||
|
#endif // defined(CPPUNIT_NO_NAMESPACE)
|
||||||
|
|
||||||
|
/*! Stringize a symbol.
|
||||||
|
*
|
||||||
|
* Use this macro to convert a preprocessor symbol to a string.
|
||||||
|
*
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* #define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTestPlugIn
|
||||||
|
* const char *name = CPPUNIT_STRINGIZE( CPPUNIT_PLUGIN_EXPORTED_NAME );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_STRINGIZE( symbol ) _CPPUNIT_DO_STRINGIZE( symbol )
|
||||||
|
|
||||||
|
/// \internal
|
||||||
|
#define _CPPUNIT_DO_STRINGIZE( symbol ) #symbol
|
||||||
|
|
||||||
|
/*! Joins to symbol after expanding them into string.
|
||||||
|
*
|
||||||
|
* Use this macro to join two symbols. Example of usage:
|
||||||
|
*
|
||||||
|
* \code
|
||||||
|
* #define MAKE_UNIQUE_NAME(prefix) CPPUNIT_JOIN( prefix, __LINE__ )
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* The macro defined in the example concatenate a given prefix with the line number
|
||||||
|
* to obtain a 'unique' identifier.
|
||||||
|
*
|
||||||
|
* \internal From boost documentation:
|
||||||
|
* The following piece of macro magic joins the two
|
||||||
|
* arguments together, even when one of the arguments is
|
||||||
|
* itself a macro (see 16.3.1 in C++ standard). The key
|
||||||
|
* is that macro expansion of macro arguments does not
|
||||||
|
* occur in CPPUNIT_JOIN2 but does in CPPUNIT_JOIN.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_JOIN( symbol1, symbol2 ) _CPPUNIT_DO_JOIN( symbol1, symbol2 )
|
||||||
|
|
||||||
|
/// \internal
|
||||||
|
#define _CPPUNIT_DO_JOIN( symbol1, symbol2 ) _CPPUNIT_DO_JOIN2( symbol1, symbol2 )
|
||||||
|
|
||||||
|
/// \internal
|
||||||
|
#define _CPPUNIT_DO_JOIN2( symbol1, symbol2 ) symbol1##symbol2
|
||||||
|
|
||||||
|
/*! Adds the line number to the specified string to create a unique identifier.
|
||||||
|
* \param prefix Prefix added to the line number to create a unique identifier.
|
||||||
|
* \see CPPUNIT_TEST_SUITE_REGISTRATION for an example of usage.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, __LINE__ )
|
||||||
|
|
||||||
|
/*! Defines wrap colunm for %CppUnit. Used by CompilerOuputter.
|
||||||
|
*/
|
||||||
|
#if !defined(CPPUNIT_WRAP_COLUMN)
|
||||||
|
# define CPPUNIT_WRAP_COLUMN 79
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CPPUNIT_PORTABILITY_H
|
|
@ -0,0 +1,94 @@
|
||||||
|
#ifndef CPPUNIT_PROTECTOR_H
|
||||||
|
#define CPPUNIT_PROTECTOR_H
|
||||||
|
|
||||||
|
#include <cppunit/SourceLine.h>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
class Exception;
|
||||||
|
class Message;
|
||||||
|
class ProtectorContext;
|
||||||
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
|
class CPPUNIT_API Functor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Functor();
|
||||||
|
|
||||||
|
virtual bool operator()() const =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Protects one or more test case run.
|
||||||
|
*
|
||||||
|
* Protector are used to globably 'decorate' a test case. The most common
|
||||||
|
* usage of Protector is to catch exception that do not subclass std::exception,
|
||||||
|
* such as MFC CException class or Rogue Wave RWXMsg class, and capture the
|
||||||
|
* message associated to the exception. In fact, CppUnit capture message from
|
||||||
|
* Exception and std::exception using a Protector.
|
||||||
|
*
|
||||||
|
* Protector are chained. When you add a Protector using
|
||||||
|
* TestResult::pushProtector(), your protector is in fact passed as a Functor
|
||||||
|
* to the first protector of the chain.
|
||||||
|
*
|
||||||
|
* TestCase protects call to setUp(), runTest() and tearDown() by calling
|
||||||
|
* TestResult::protect().
|
||||||
|
*
|
||||||
|
* Because the protector chain is handled by TestResult, a protector can be
|
||||||
|
* active for a single test, or a complete test run.
|
||||||
|
*
|
||||||
|
* Here are some possible usages:
|
||||||
|
* - run all test case in a separate thread and assumes the test failed if it
|
||||||
|
* did not finish in a given time (infinite loop work around)
|
||||||
|
* - performance tracing : time only the runTest() time.
|
||||||
|
* \sa TestResult, TestCase, TestListener.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API Protector
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Protector();
|
||||||
|
|
||||||
|
virtual bool protect( const Functor &functor,
|
||||||
|
const ProtectorContext &context ) =0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void reportError( const ProtectorContext &context,
|
||||||
|
const Exception &error ) const;
|
||||||
|
|
||||||
|
void reportError( const ProtectorContext &context,
|
||||||
|
const Message &message,
|
||||||
|
const SourceLine &sourceLine = SourceLine() ) const;
|
||||||
|
|
||||||
|
void reportFailure( const ProtectorContext &context,
|
||||||
|
const Exception &failure ) const;
|
||||||
|
|
||||||
|
Message actualMessage( const Message &message,
|
||||||
|
const ProtectorContext &context ) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Scoped protector push to TestResult.
|
||||||
|
*
|
||||||
|
* Adds the specified Protector to the specified TestResult for the object
|
||||||
|
* life-time.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API ProtectorGuard
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/// Pushes the specified protector.
|
||||||
|
ProtectorGuard( TestResult *result,
|
||||||
|
Protector *protector );
|
||||||
|
|
||||||
|
/// Pops the protector.
|
||||||
|
~ProtectorGuard();
|
||||||
|
|
||||||
|
private:
|
||||||
|
TestResult *m_result;
|
||||||
|
};
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_PROTECTOR_H
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
#ifndef CPPUNIT_SOURCELINE_H
|
||||||
|
#define CPPUNIT_SOURCELINE_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
/*! \brief Constructs a SourceLine object initialized with the location where the macro is expanded.
|
||||||
|
* \ingroup CreatingNewAssertions
|
||||||
|
* \relates CppUnit::SourceLine
|
||||||
|
* Used to write your own assertion macros.
|
||||||
|
* \see Asserter for example of usage.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_SOURCELINE() CPPUNIT_NS::SourceLine( __FILE__, __LINE__ )
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Represents a source line location.
|
||||||
|
* \ingroup CreatingNewAssertions
|
||||||
|
* \ingroup BrowsingCollectedTestResult
|
||||||
|
*
|
||||||
|
* Used to capture the failure location in assertion.
|
||||||
|
*
|
||||||
|
* Use the CPPUNIT_SOURCELINE() macro to construct that object. Typically used when
|
||||||
|
* writing an assertion macro in association with Asserter.
|
||||||
|
*
|
||||||
|
* \see Asserter.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API SourceLine
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SourceLine();
|
||||||
|
|
||||||
|
// Ensure thread-safe copy by detaching the string buffer.
|
||||||
|
SourceLine( const SourceLine &other );
|
||||||
|
|
||||||
|
SourceLine( const std::string &fileName,
|
||||||
|
int lineNumber );
|
||||||
|
|
||||||
|
SourceLine &operator =( const SourceLine &other );
|
||||||
|
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~SourceLine();
|
||||||
|
|
||||||
|
bool isValid() const;
|
||||||
|
|
||||||
|
int lineNumber() const;
|
||||||
|
|
||||||
|
std::string fileName() const;
|
||||||
|
|
||||||
|
bool operator ==( const SourceLine &other ) const;
|
||||||
|
bool operator !=( const SourceLine &other ) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string m_fileName;
|
||||||
|
int m_lineNumber;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_SOURCELINE_H
|
|
@ -0,0 +1,80 @@
|
||||||
|
#ifndef CPPUNIT_SYNCHRONIZEDOBJECT_H
|
||||||
|
#define CPPUNIT_SYNCHRONIZEDOBJECT_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Base class for synchronized object.
|
||||||
|
*
|
||||||
|
* Synchronized object are object which members are used concurrently by mutiple
|
||||||
|
* threads.
|
||||||
|
*
|
||||||
|
* This class define the class SynchronizationObject which must be subclassed
|
||||||
|
* to implement an actual lock.
|
||||||
|
*
|
||||||
|
* Each instance of this class holds a pointer on a lock object.
|
||||||
|
*
|
||||||
|
* See src/msvc6/MfcSynchronizedObject.h for an example.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API SynchronizedObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Abstract synchronization object (mutex)
|
||||||
|
*/
|
||||||
|
class SynchronizationObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SynchronizationObject() {}
|
||||||
|
virtual ~SynchronizationObject() {}
|
||||||
|
|
||||||
|
virtual void lock() {}
|
||||||
|
virtual void unlock() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! Constructs a SynchronizedObject object.
|
||||||
|
*/
|
||||||
|
SynchronizedObject( SynchronizationObject *syncObject =0 );
|
||||||
|
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~SynchronizedObject();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/*! \brief Locks a synchronization object in the current scope.
|
||||||
|
*/
|
||||||
|
class ExclusiveZone
|
||||||
|
{
|
||||||
|
SynchronizationObject *m_syncObject;
|
||||||
|
|
||||||
|
public:
|
||||||
|
ExclusiveZone( SynchronizationObject *syncObject )
|
||||||
|
: m_syncObject( syncObject )
|
||||||
|
{
|
||||||
|
m_syncObject->lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
~ExclusiveZone()
|
||||||
|
{
|
||||||
|
m_syncObject->unlock ();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual void setSynchronizationObject( SynchronizationObject *syncObject );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
SynchronizationObject *m_syncObject;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Prevents the use of the copy constructor.
|
||||||
|
SynchronizedObject( const SynchronizedObject © );
|
||||||
|
|
||||||
|
/// Prevents the use of the copy operator.
|
||||||
|
void operator =( const SynchronizedObject © );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_SYNCHRONIZEDOBJECT_H
|
|
@ -0,0 +1,117 @@
|
||||||
|
#ifndef CPPUNIT_TEST_H
|
||||||
|
#define CPPUNIT_TEST_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class TestResult;
|
||||||
|
class TestPath;
|
||||||
|
|
||||||
|
/*! \brief Base class for all test objects.
|
||||||
|
* \ingroup BrowsingCollectedTestResult
|
||||||
|
*
|
||||||
|
* All test objects should be a subclass of Test. Some test objects,
|
||||||
|
* TestCase for example, represent one individual test. Other test
|
||||||
|
* objects, such as TestSuite, are comprised of several tests.
|
||||||
|
*
|
||||||
|
* When a Test is run, the result is collected by a TestResult object.
|
||||||
|
*
|
||||||
|
* \see TestCase
|
||||||
|
* \see TestSuite
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API Test
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Test() {};
|
||||||
|
|
||||||
|
/*! \brief Run the test, collecting results.
|
||||||
|
*/
|
||||||
|
virtual void run( TestResult *result ) =0;
|
||||||
|
|
||||||
|
/*! \brief Return the number of test cases invoked by run().
|
||||||
|
*
|
||||||
|
* The base unit of testing is the class TestCase. This
|
||||||
|
* method returns the number of TestCase objects invoked by
|
||||||
|
* the run() method.
|
||||||
|
*/
|
||||||
|
virtual int countTestCases () const =0;
|
||||||
|
|
||||||
|
/*! \brief Returns the number of direct child of the test.
|
||||||
|
*/
|
||||||
|
virtual int getChildTestCount() const =0;
|
||||||
|
|
||||||
|
/*! \brief Returns the child test of the specified index.
|
||||||
|
*
|
||||||
|
* This method test if the index is valid, then call doGetChildTestAt() if
|
||||||
|
* the index is valid. Otherwise std::out_of_range exception is thrown.
|
||||||
|
*
|
||||||
|
* You should override doGetChildTestAt() method.
|
||||||
|
*
|
||||||
|
* \param index Zero based index of the child test to return.
|
||||||
|
* \return Pointer on the test. Never \c NULL.
|
||||||
|
* \exception std::out_of_range is \a index is < 0 or >= getChildTestCount().
|
||||||
|
*/
|
||||||
|
virtual Test *getChildTestAt( int index ) const;
|
||||||
|
|
||||||
|
/*! \brief Returns the test name.
|
||||||
|
*
|
||||||
|
* Each test has a name. This name may be used to find the
|
||||||
|
* test in a suite or registry of tests.
|
||||||
|
*/
|
||||||
|
virtual std::string getName () const =0;
|
||||||
|
|
||||||
|
/*! \brief Finds the test with the specified name and its parents test.
|
||||||
|
* \param testName Name of the test to find.
|
||||||
|
* \param testPath If the test is found, then all the tests traversed to access
|
||||||
|
* \a test are added to \a testPath, including \c this and \a test.
|
||||||
|
* \return \c true if a test with the specified name is found, \c false otherwise.
|
||||||
|
*/
|
||||||
|
virtual bool findTestPath( const std::string &testName,
|
||||||
|
TestPath &testPath ) const;
|
||||||
|
|
||||||
|
/*! \brief Finds the specified test and its parents test.
|
||||||
|
* \param test Test to find.
|
||||||
|
* \param testPath If the test is found, then all the tests traversed to access
|
||||||
|
* \a test are added to \a testPath, including \c this and \a test.
|
||||||
|
* \return \c true if the specified test is found, \c false otherwise.
|
||||||
|
*/
|
||||||
|
virtual bool findTestPath( const Test *test,
|
||||||
|
TestPath &testPath ) const;
|
||||||
|
|
||||||
|
/*! \brief Finds the test with the specified name in the hierarchy.
|
||||||
|
* \param testName Name of the test to find.
|
||||||
|
* \return Pointer on the first test found that is named \a testName. Never \c NULL.
|
||||||
|
* \exception std::invalid_argument if no test named \a testName is found.
|
||||||
|
*/
|
||||||
|
virtual Test *findTest( const std::string &testName ) const;
|
||||||
|
|
||||||
|
/*! \brief Resolved the specified test path with this test acting as 'root'.
|
||||||
|
* \param testPath Test path string to resolve.
|
||||||
|
* \return Resolved TestPath.
|
||||||
|
* \exception std::invalid_argument if \a testPath could not be resolved.
|
||||||
|
* \see TestPath.
|
||||||
|
*/
|
||||||
|
virtual TestPath resolveTestPath( const std::string &testPath ) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/*! Throws an exception if the specified index is invalid.
|
||||||
|
* \param index Zero base index of a child test.
|
||||||
|
* \exception std::out_of_range is \a index is < 0 or >= getChildTestCount().
|
||||||
|
*/
|
||||||
|
virtual void checkIsValidIndex( int index ) const;
|
||||||
|
|
||||||
|
/*! \brief Returns the child test of the specified valid index.
|
||||||
|
* \param index Zero based valid index of the child test to return.
|
||||||
|
* \return Pointer on the test. Never \c NULL.
|
||||||
|
*/
|
||||||
|
virtual Test *doGetChildTestAt( int index ) const =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TEST_H
|
||||||
|
|
|
@ -0,0 +1,428 @@
|
||||||
|
#ifndef CPPUNIT_TESTASSERT_H
|
||||||
|
#define CPPUNIT_TESTASSERT_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
#include <cppunit/Exception.h>
|
||||||
|
#include <cppunit/Asserter.h>
|
||||||
|
#include <cppunit/portability/Stream.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <float.h> // For struct assertion_traits<double>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Traits used by CPPUNIT_ASSERT_EQUAL().
|
||||||
|
*
|
||||||
|
* Here is an example of specialising these traits:
|
||||||
|
*
|
||||||
|
* \code
|
||||||
|
* template<>
|
||||||
|
* struct assertion_traits<std::string> // specialization for the std::string type
|
||||||
|
* {
|
||||||
|
* static bool equal( const std::string& x, const std::string& y )
|
||||||
|
* {
|
||||||
|
* return x == y;
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* static std::string toString( const std::string& x )
|
||||||
|
* {
|
||||||
|
* std::string text = '"' + x + '"'; // adds quote around the string to see whitespace
|
||||||
|
* OStringStream ost;
|
||||||
|
* ost << text;
|
||||||
|
* return ost.str();
|
||||||
|
* }
|
||||||
|
* };
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
template <class T>
|
||||||
|
struct assertion_traits
|
||||||
|
{
|
||||||
|
static bool equal( const T& x, const T& y )
|
||||||
|
{
|
||||||
|
return x == y;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string toString( const T& x )
|
||||||
|
{
|
||||||
|
OStringStream ost;
|
||||||
|
ost << x;
|
||||||
|
return ost.str();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Traits used by CPPUNIT_ASSERT_DOUBLES_EQUAL().
|
||||||
|
*
|
||||||
|
* This specialisation from @c struct @c assertion_traits<> ensures that
|
||||||
|
* doubles are converted in full, instead of being rounded to the default
|
||||||
|
* 6 digits of precision. Use the system defined ISO C99 macro DBL_DIG
|
||||||
|
* within float.h is available to define the maximum precision, otherwise
|
||||||
|
* use the hard-coded maximum precision of 15.
|
||||||
|
*/
|
||||||
|
template <>
|
||||||
|
struct assertion_traits<double>
|
||||||
|
{
|
||||||
|
static bool equal( double x, double y )
|
||||||
|
{
|
||||||
|
return x == y;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string toString( double x )
|
||||||
|
{
|
||||||
|
#ifdef DBL_DIG
|
||||||
|
const int precision = DBL_DIG;
|
||||||
|
#else
|
||||||
|
const int precision = 15;
|
||||||
|
#endif // #ifdef DBL_DIG
|
||||||
|
char buffer[128];
|
||||||
|
#ifdef __STDC_SECURE_LIB__ // Use secure version with visual studio 2005 to avoid warning.
|
||||||
|
sprintf_s(buffer, sizeof(buffer), "%.*g", precision, x);
|
||||||
|
#else
|
||||||
|
sprintf(buffer, "%.*g", precision, x);
|
||||||
|
#endif
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief (Implementation) Asserts that two objects of the same type are equals.
|
||||||
|
* Use CPPUNIT_ASSERT_EQUAL instead of this function.
|
||||||
|
* \sa assertion_traits, Asserter::failNotEqual().
|
||||||
|
*/
|
||||||
|
template <class T>
|
||||||
|
void assertEquals( const T& expected,
|
||||||
|
const T& actual,
|
||||||
|
SourceLine sourceLine,
|
||||||
|
const std::string &message )
|
||||||
|
{
|
||||||
|
if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion...
|
||||||
|
{
|
||||||
|
Asserter::failNotEqual( assertion_traits<T>::toString(expected),
|
||||||
|
assertion_traits<T>::toString(actual),
|
||||||
|
sourceLine,
|
||||||
|
message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief (Implementation) Asserts that two double are equals given a tolerance.
|
||||||
|
* Use CPPUNIT_ASSERT_DOUBLES_EQUAL instead of this function.
|
||||||
|
* \sa Asserter::failNotEqual().
|
||||||
|
* \sa CPPUNIT_ASSERT_DOUBLES_EQUAL for detailed semantic of the assertion.
|
||||||
|
*/
|
||||||
|
void CPPUNIT_API assertDoubleEquals( double expected,
|
||||||
|
double actual,
|
||||||
|
double delta,
|
||||||
|
SourceLine sourceLine,
|
||||||
|
const std::string &message );
|
||||||
|
|
||||||
|
|
||||||
|
/* A set of macros which allow us to get the line number
|
||||||
|
* and file name at the point of an error.
|
||||||
|
* Just goes to show that preprocessors do have some
|
||||||
|
* redeeming qualities.
|
||||||
|
*/
|
||||||
|
#if CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION
|
||||||
|
/** Assertions that a condition is \c true.
|
||||||
|
* \ingroup Assertions
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_ASSERT(condition) \
|
||||||
|
( CPPUNIT_NS::Asserter::failIf( !(condition), \
|
||||||
|
CPPUNIT_NS::Message( "assertion failed", \
|
||||||
|
"Expression: " #condition), \
|
||||||
|
CPPUNIT_SOURCELINE() ) )
|
||||||
|
#else
|
||||||
|
#define CPPUNIT_ASSERT(condition) \
|
||||||
|
( CPPUNIT_NS::Asserter::failIf( !(condition), \
|
||||||
|
CPPUNIT_NS::Message( "assertion failed" ), \
|
||||||
|
CPPUNIT_SOURCELINE() ) )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Assertion with a user specified message.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* \param message Message reported in diagnostic if \a condition evaluates
|
||||||
|
* to \c false.
|
||||||
|
* \param condition If this condition evaluates to \c false then the
|
||||||
|
* test failed.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_ASSERT_MESSAGE(message,condition) \
|
||||||
|
( CPPUNIT_NS::Asserter::failIf( !(condition), \
|
||||||
|
CPPUNIT_NS::Message( "assertion failed", \
|
||||||
|
"Expression: " \
|
||||||
|
#condition, \
|
||||||
|
message ), \
|
||||||
|
CPPUNIT_SOURCELINE() ) )
|
||||||
|
|
||||||
|
/** Fails with the specified message.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* \param message Message reported in diagnostic.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_FAIL( message ) \
|
||||||
|
( CPPUNIT_NS::Asserter::fail( CPPUNIT_NS::Message( "forced failure", \
|
||||||
|
message ), \
|
||||||
|
CPPUNIT_SOURCELINE() ) )
|
||||||
|
|
||||||
|
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
|
||||||
|
/// Generalized macro for primitive value comparisons
|
||||||
|
#define CPPUNIT_ASSERT_EQUAL(expected,actual) \
|
||||||
|
( CPPUNIT_NS::assertEquals( (expected), \
|
||||||
|
(actual), \
|
||||||
|
__LINE__, __FILE__ ) )
|
||||||
|
#else
|
||||||
|
/** Asserts that two values are equals.
|
||||||
|
* \ingroup Assertions
|
||||||
|
*
|
||||||
|
* Equality and string representation can be defined with
|
||||||
|
* an appropriate CppUnit::assertion_traits class.
|
||||||
|
*
|
||||||
|
* A diagnostic is printed if actual and expected values disagree.
|
||||||
|
*
|
||||||
|
* Requirement for \a expected and \a actual parameters:
|
||||||
|
* - They are exactly of the same type
|
||||||
|
* - They are serializable into a std::strstream using operator <<.
|
||||||
|
* - They can be compared using operator ==.
|
||||||
|
*
|
||||||
|
* The last two requirements (serialization and comparison) can be
|
||||||
|
* removed by specializing the CppUnit::assertion_traits.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_ASSERT_EQUAL(expected,actual) \
|
||||||
|
( CPPUNIT_NS::assertEquals( (expected), \
|
||||||
|
(actual), \
|
||||||
|
CPPUNIT_SOURCELINE(), \
|
||||||
|
"" ) )
|
||||||
|
|
||||||
|
/** Asserts that two values are equals, provides additional message on failure.
|
||||||
|
* \ingroup Assertions
|
||||||
|
*
|
||||||
|
* Equality and string representation can be defined with
|
||||||
|
* an appropriate assertion_traits class.
|
||||||
|
*
|
||||||
|
* A diagnostic is printed if actual and expected values disagree.
|
||||||
|
* The message is printed in addition to the expected and actual value
|
||||||
|
* to provide additional information.
|
||||||
|
*
|
||||||
|
* Requirement for \a expected and \a actual parameters:
|
||||||
|
* - They are exactly of the same type
|
||||||
|
* - They are serializable into a std::strstream using operator <<.
|
||||||
|
* - They can be compared using operator ==.
|
||||||
|
*
|
||||||
|
* The last two requirements (serialization and comparison) can be
|
||||||
|
* removed by specializing the CppUnit::assertion_traits.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_ASSERT_EQUAL_MESSAGE(message,expected,actual) \
|
||||||
|
( CPPUNIT_NS::assertEquals( (expected), \
|
||||||
|
(actual), \
|
||||||
|
CPPUNIT_SOURCELINE(), \
|
||||||
|
(message) ) )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*! \brief Macro for primitive double value comparisons.
|
||||||
|
* \ingroup Assertions
|
||||||
|
*
|
||||||
|
* The assertion pass if both expected and actual are finite and
|
||||||
|
* \c fabs( \c expected - \c actual ) <= \c delta.
|
||||||
|
* If either \c expected or actual are infinite (+/- inf), the
|
||||||
|
* assertion pass if \c expected == \c actual.
|
||||||
|
* If either \c expected or \c actual is a NaN (not a number), then
|
||||||
|
* the assertion fails.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_ASSERT_DOUBLES_EQUAL(expected,actual,delta) \
|
||||||
|
( CPPUNIT_NS::assertDoubleEquals( (expected), \
|
||||||
|
(actual), \
|
||||||
|
(delta), \
|
||||||
|
CPPUNIT_SOURCELINE(), \
|
||||||
|
"" ) )
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Macro for primitive double value comparisons, setting a
|
||||||
|
* user-supplied message in case of failure.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* \sa CPPUNIT_ASSERT_DOUBLES_EQUAL for detailed semantic of the assertion.
|
||||||
|
*/
|
||||||
|
#define CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(message,expected,actual,delta) \
|
||||||
|
( CPPUNIT_NS::assertDoubleEquals( (expected), \
|
||||||
|
(actual), \
|
||||||
|
(delta), \
|
||||||
|
CPPUNIT_SOURCELINE(), \
|
||||||
|
(message) ) )
|
||||||
|
|
||||||
|
|
||||||
|
/** Asserts that the given expression throws an exception of the specified type.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* std::vector<int> v;
|
||||||
|
* CPPUNIT_ASSERT_THROW( v.at( 50 ), std::out_of_range );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_THROW( expression, ExceptionType ) \
|
||||||
|
CPPUNIT_ASSERT_THROW_MESSAGE( CPPUNIT_NS::AdditionalMessage(), \
|
||||||
|
expression, \
|
||||||
|
ExceptionType )
|
||||||
|
|
||||||
|
|
||||||
|
// implementation detail
|
||||||
|
#if CPPUNIT_USE_TYPEINFO_NAME
|
||||||
|
#define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \
|
||||||
|
CPPUNIT_NS::TypeInfoHelper::getClassName( typeid(exception) )
|
||||||
|
#else
|
||||||
|
#define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \
|
||||||
|
std::string( no_rtti_message )
|
||||||
|
#endif // CPPUNIT_USE_TYPEINFO_NAME
|
||||||
|
|
||||||
|
// implementation detail
|
||||||
|
#define CPPUNIT_GET_PARAMETER_STRING( parameter ) #parameter
|
||||||
|
|
||||||
|
/** Asserts that the given expression throws an exception of the specified type,
|
||||||
|
* setting a user supplied message in case of failure.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* std::vector<int> v;
|
||||||
|
* CPPUNIT_ASSERT_THROW_MESSAGE( "- std::vector<int> v;", v.at( 50 ), std::out_of_range );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_THROW_MESSAGE( message, expression, ExceptionType ) \
|
||||||
|
do { \
|
||||||
|
bool cpputCorrectExceptionThrown_ = false; \
|
||||||
|
CPPUNIT_NS::Message cpputMsg_( "expected exception not thrown" ); \
|
||||||
|
cpputMsg_.addDetail( message ); \
|
||||||
|
cpputMsg_.addDetail( "Expected: " \
|
||||||
|
CPPUNIT_GET_PARAMETER_STRING( ExceptionType ) ); \
|
||||||
|
\
|
||||||
|
try { \
|
||||||
|
expression; \
|
||||||
|
} catch ( const ExceptionType & ) { \
|
||||||
|
cpputCorrectExceptionThrown_ = true; \
|
||||||
|
} catch ( const std::exception &e) { \
|
||||||
|
cpputMsg_.addDetail( "Actual : " + \
|
||||||
|
CPPUNIT_EXTRACT_EXCEPTION_TYPE_( e, \
|
||||||
|
"std::exception or derived") ); \
|
||||||
|
cpputMsg_.addDetail( std::string("What() : ") + e.what() ); \
|
||||||
|
} catch ( ... ) { \
|
||||||
|
cpputMsg_.addDetail( "Actual : unknown."); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
if ( cpputCorrectExceptionThrown_ ) \
|
||||||
|
break; \
|
||||||
|
\
|
||||||
|
CPPUNIT_NS::Asserter::fail( cpputMsg_, \
|
||||||
|
CPPUNIT_SOURCELINE() ); \
|
||||||
|
} while ( false )
|
||||||
|
|
||||||
|
|
||||||
|
/** Asserts that the given expression does not throw any exceptions.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* std::vector<int> v;
|
||||||
|
* v.push_back( 10 );
|
||||||
|
* CPPUNIT_ASSERT_NO_THROW( v.at( 0 ) );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_NO_THROW( expression ) \
|
||||||
|
CPPUNIT_ASSERT_NO_THROW_MESSAGE( CPPUNIT_NS::AdditionalMessage(), \
|
||||||
|
expression )
|
||||||
|
|
||||||
|
|
||||||
|
/** Asserts that the given expression does not throw any exceptions,
|
||||||
|
* setting a user supplied message in case of failure.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* std::vector<int> v;
|
||||||
|
* v.push_back( 10 );
|
||||||
|
* CPPUNIT_ASSERT_NO_THROW( "std::vector<int> v;", v.at( 0 ) );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_NO_THROW_MESSAGE( message, expression ) \
|
||||||
|
do { \
|
||||||
|
CPPUNIT_NS::Message cpputMsg_( "unexpected exception caught" ); \
|
||||||
|
cpputMsg_.addDetail( message ); \
|
||||||
|
\
|
||||||
|
try { \
|
||||||
|
expression; \
|
||||||
|
} catch ( const std::exception &e ) { \
|
||||||
|
cpputMsg_.addDetail( "Caught: " + \
|
||||||
|
CPPUNIT_EXTRACT_EXCEPTION_TYPE_( e, \
|
||||||
|
"std::exception or derived" ) ); \
|
||||||
|
cpputMsg_.addDetail( std::string("What(): ") + e.what() ); \
|
||||||
|
CPPUNIT_NS::Asserter::fail( cpputMsg_, \
|
||||||
|
CPPUNIT_SOURCELINE() ); \
|
||||||
|
} catch ( ... ) { \
|
||||||
|
cpputMsg_.addDetail( "Caught: unknown." ); \
|
||||||
|
CPPUNIT_NS::Asserter::fail( cpputMsg_, \
|
||||||
|
CPPUNIT_SOURCELINE() ); \
|
||||||
|
} \
|
||||||
|
} while ( false )
|
||||||
|
|
||||||
|
|
||||||
|
/** Asserts that an assertion fail.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Use to test assertions.
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* CPPUNIT_ASSERT_ASSERTION_FAIL( CPPUNIT_ASSERT( 1 == 2 ) );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_ASSERTION_FAIL( assertion ) \
|
||||||
|
CPPUNIT_ASSERT_THROW( assertion, CPPUNIT_NS::Exception )
|
||||||
|
|
||||||
|
|
||||||
|
/** Asserts that an assertion fail, with a user-supplied message in
|
||||||
|
* case of error.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Use to test assertions.
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE( "1 == 2", CPPUNIT_ASSERT( 1 == 2 ) );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE( message, assertion ) \
|
||||||
|
CPPUNIT_ASSERT_THROW_MESSAGE( message, assertion, CPPUNIT_NS::Exception )
|
||||||
|
|
||||||
|
|
||||||
|
/** Asserts that an assertion pass.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Use to test assertions.
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* CPPUNIT_ASSERT_ASSERTION_PASS( CPPUNIT_ASSERT( 1 == 1 ) );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_ASSERTION_PASS( assertion ) \
|
||||||
|
CPPUNIT_ASSERT_NO_THROW( assertion )
|
||||||
|
|
||||||
|
|
||||||
|
/** Asserts that an assertion pass, with a user-supplied message in
|
||||||
|
* case of failure.
|
||||||
|
* \ingroup Assertions
|
||||||
|
* Use to test assertions.
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* CPPUNIT_ASSERT_ASSERTION_PASS_MESSAGE( "1 != 1", CPPUNIT_ASSERT( 1 == 1 ) );
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
# define CPPUNIT_ASSERT_ASSERTION_PASS_MESSAGE( message, assertion ) \
|
||||||
|
CPPUNIT_ASSERT_NO_THROW_MESSAGE( message, assertion )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Backwards compatibility
|
||||||
|
|
||||||
|
#if CPPUNIT_ENABLE_NAKED_ASSERT
|
||||||
|
|
||||||
|
#undef assert
|
||||||
|
#define assert(c) CPPUNIT_ASSERT(c)
|
||||||
|
#define assertEqual(e,a) CPPUNIT_ASSERT_EQUAL(e,a)
|
||||||
|
#define assertDoublesEqual(e,a,d) CPPUNIT_ASSERT_DOUBLES_EQUAL(e,a,d)
|
||||||
|
#define assertLongsEqual(e,a) CPPUNIT_ASSERT_EQUAL(e,a)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTASSERT_H
|
|
@ -0,0 +1,204 @@
|
||||||
|
#ifndef CPPUNIT_TESTCALLER_H // -*- C++ -*-
|
||||||
|
#define CPPUNIT_TESTCALLER_H
|
||||||
|
|
||||||
|
#include <cppunit/Exception.h>
|
||||||
|
#include <cppunit/TestCase.h>
|
||||||
|
|
||||||
|
|
||||||
|
#if CPPUNIT_USE_TYPEINFO_NAME
|
||||||
|
# include <cppunit/extensions/TypeInfoHelper.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/*! \brief Marker class indicating that no exception is expected by TestCaller.
|
||||||
|
* This class is an implementation detail. You should never use this class directly.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API NoExceptionExpected
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
//! Prevent class instantiation.
|
||||||
|
NoExceptionExpected();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief (Implementation) Traits used by TestCaller to expect an exception.
|
||||||
|
*
|
||||||
|
* This class is an implementation detail. You should never use this class directly.
|
||||||
|
*/
|
||||||
|
template<class ExceptionType>
|
||||||
|
struct ExpectedExceptionTraits
|
||||||
|
{
|
||||||
|
static void expectedException()
|
||||||
|
{
|
||||||
|
#if CPPUNIT_USE_TYPEINFO_NAME
|
||||||
|
throw Exception( Message(
|
||||||
|
"expected exception not thrown",
|
||||||
|
"Expected exception type: " +
|
||||||
|
TypeInfoHelper::getClassName( typeid( ExceptionType ) ) ) );
|
||||||
|
#else
|
||||||
|
throw Exception( "expected exception not thrown" );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief (Implementation) Traits specialization used by TestCaller to
|
||||||
|
* expect no exception.
|
||||||
|
*
|
||||||
|
* This class is an implementation detail. You should never use this class directly.
|
||||||
|
*/
|
||||||
|
template<>
|
||||||
|
struct ExpectedExceptionTraits<NoExceptionExpected>
|
||||||
|
{
|
||||||
|
static void expectedException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//*** FIXME: rework this when class Fixture is implemented. ***//
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Generate a test case from a fixture method.
|
||||||
|
* \ingroup WritingTestFixture
|
||||||
|
*
|
||||||
|
* A test caller provides access to a test case method
|
||||||
|
* on a test fixture class. Test callers are useful when
|
||||||
|
* you want to run an individual test or add it to a
|
||||||
|
* suite.
|
||||||
|
* Test Callers invoke only one Test (i.e. test method) on one
|
||||||
|
* Fixture of a TestFixture.
|
||||||
|
*
|
||||||
|
* Here is an example:
|
||||||
|
* \code
|
||||||
|
* class MathTest : public CppUnit::TestFixture {
|
||||||
|
* ...
|
||||||
|
* public:
|
||||||
|
* void setUp();
|
||||||
|
* void tearDown();
|
||||||
|
*
|
||||||
|
* void testAdd();
|
||||||
|
* void testSubtract();
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* CppUnit::Test *MathTest::suite() {
|
||||||
|
* CppUnit::TestSuite *suite = new CppUnit::TestSuite;
|
||||||
|
*
|
||||||
|
* suite->addTest( new CppUnit::TestCaller<MathTest>( "testAdd", testAdd ) );
|
||||||
|
* return suite;
|
||||||
|
* }
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* You can use a TestCaller to bind any test method on a TestFixture
|
||||||
|
* class, as long as it accepts void and returns void.
|
||||||
|
*
|
||||||
|
* \see TestCase
|
||||||
|
*/
|
||||||
|
|
||||||
|
template <class Fixture>
|
||||||
|
class TestCaller : public TestCase
|
||||||
|
{
|
||||||
|
typedef void (Fixture::*TestMethod)();
|
||||||
|
|
||||||
|
public:
|
||||||
|
/*!
|
||||||
|
* Constructor for TestCaller. This constructor builds a new Fixture
|
||||||
|
* instance owned by the TestCaller.
|
||||||
|
* \param name name of this TestCaller
|
||||||
|
* \param test the method this TestCaller calls in runTest()
|
||||||
|
*/
|
||||||
|
TestCaller( std::string name, TestMethod test ) :
|
||||||
|
TestCase( name ),
|
||||||
|
m_ownFixture( true ),
|
||||||
|
m_fixture( new Fixture() ),
|
||||||
|
m_test( test )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Constructor for TestCaller.
|
||||||
|
* This constructor does not create a new Fixture instance but accepts
|
||||||
|
* an existing one as parameter. The TestCaller will not own the
|
||||||
|
* Fixture object.
|
||||||
|
* \param name name of this TestCaller
|
||||||
|
* \param test the method this TestCaller calls in runTest()
|
||||||
|
* \param fixture the Fixture to invoke the test method on.
|
||||||
|
*/
|
||||||
|
TestCaller(std::string name, TestMethod test, Fixture& fixture) :
|
||||||
|
TestCase( name ),
|
||||||
|
m_ownFixture( false ),
|
||||||
|
m_fixture( &fixture ),
|
||||||
|
m_test( test )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Constructor for TestCaller.
|
||||||
|
* This constructor does not create a new Fixture instance but accepts
|
||||||
|
* an existing one as parameter. The TestCaller will own the
|
||||||
|
* Fixture object and delete it in its destructor.
|
||||||
|
* \param name name of this TestCaller
|
||||||
|
* \param test the method this TestCaller calls in runTest()
|
||||||
|
* \param fixture the Fixture to invoke the test method on.
|
||||||
|
*/
|
||||||
|
TestCaller(std::string name, TestMethod test, Fixture* fixture) :
|
||||||
|
TestCase( name ),
|
||||||
|
m_ownFixture( true ),
|
||||||
|
m_fixture( fixture ),
|
||||||
|
m_test( test )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~TestCaller()
|
||||||
|
{
|
||||||
|
if (m_ownFixture)
|
||||||
|
delete m_fixture;
|
||||||
|
}
|
||||||
|
|
||||||
|
void runTest()
|
||||||
|
{
|
||||||
|
// try {
|
||||||
|
(m_fixture->*m_test)();
|
||||||
|
// }
|
||||||
|
// catch ( ExpectedException & ) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ExpectedExceptionTraits<ExpectedException>::expectedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setUp()
|
||||||
|
{
|
||||||
|
m_fixture->setUp ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void tearDown()
|
||||||
|
{
|
||||||
|
m_fixture->tearDown ();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string toString() const
|
||||||
|
{
|
||||||
|
return "TestCaller " + getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
TestCaller( const TestCaller &other );
|
||||||
|
TestCaller &operator =( const TestCaller &other );
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_ownFixture;
|
||||||
|
Fixture *m_fixture;
|
||||||
|
TestMethod m_test;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTCALLER_H
|
|
@ -0,0 +1,55 @@
|
||||||
|
#ifndef CPPUNIT_TESTCASE_H
|
||||||
|
#define CPPUNIT_TESTCASE_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
#include <cppunit/TestLeaf.h>
|
||||||
|
#include <cppunit/TestAssert.h>
|
||||||
|
#include <cppunit/TestFixture.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief A single test object.
|
||||||
|
*
|
||||||
|
* This class is used to implement a simple test case: define a subclass
|
||||||
|
* that overrides the runTest method.
|
||||||
|
*
|
||||||
|
* You don't usually need to use that class, but TestFixture and TestCaller instead.
|
||||||
|
*
|
||||||
|
* You are expected to subclass TestCase is you need to write a class similiar
|
||||||
|
* to TestCaller.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestCase : public TestLeaf,
|
||||||
|
public TestFixture
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
TestCase( const std::string &name );
|
||||||
|
|
||||||
|
TestCase();
|
||||||
|
|
||||||
|
~TestCase();
|
||||||
|
|
||||||
|
virtual void run(TestResult *result);
|
||||||
|
|
||||||
|
std::string getName() const;
|
||||||
|
|
||||||
|
//! FIXME: this should probably be pure virtual.
|
||||||
|
virtual void runTest();
|
||||||
|
|
||||||
|
private:
|
||||||
|
TestCase( const TestCase &other );
|
||||||
|
TestCase &operator=( const TestCase &other );
|
||||||
|
|
||||||
|
private:
|
||||||
|
const std::string m_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTCASE_H
|
|
@ -0,0 +1,45 @@
|
||||||
|
#ifndef CPPUNIT_TESTCOMPSITE_H // -*- C++ -*-
|
||||||
|
#define CPPUNIT_TESTCOMPSITE_H
|
||||||
|
|
||||||
|
#include <cppunit/Test.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief A Composite of Tests.
|
||||||
|
*
|
||||||
|
* Base class for all test composites. Subclass this class if you need to implement
|
||||||
|
* a custom TestSuite.
|
||||||
|
*
|
||||||
|
* \see Test, TestSuite.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestComposite : public Test
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TestComposite( const std::string &name = "" );
|
||||||
|
|
||||||
|
~TestComposite();
|
||||||
|
|
||||||
|
void run( TestResult *result );
|
||||||
|
|
||||||
|
int countTestCases() const;
|
||||||
|
|
||||||
|
std::string getName() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
TestComposite( const TestComposite &other );
|
||||||
|
TestComposite &operator =( const TestComposite &other );
|
||||||
|
|
||||||
|
virtual void doStartSuite( TestResult *controller );
|
||||||
|
virtual void doRunChildTests( TestResult *controller );
|
||||||
|
virtual void doEndSuite( TestResult *controller );
|
||||||
|
|
||||||
|
private:
|
||||||
|
const std::string m_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTCOMPSITE_H
|
|
@ -0,0 +1,58 @@
|
||||||
|
#ifndef CPPUNIT_TESTFAILURE_H // -*- C++ -*-
|
||||||
|
#define CPPUNIT_TESTFAILURE_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class Exception;
|
||||||
|
class SourceLine;
|
||||||
|
class Test;
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Record of a failed Test execution.
|
||||||
|
* \ingroup BrowsingCollectedTestResult
|
||||||
|
*
|
||||||
|
* A TestFailure collects a failed test together with
|
||||||
|
* the caught exception.
|
||||||
|
*
|
||||||
|
* TestFailure assumes lifetime control for any exception
|
||||||
|
* passed to it.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestFailure
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TestFailure( Test *failedTest,
|
||||||
|
Exception *thrownException,
|
||||||
|
bool isError );
|
||||||
|
|
||||||
|
virtual ~TestFailure ();
|
||||||
|
|
||||||
|
virtual Test *failedTest() const;
|
||||||
|
|
||||||
|
virtual Exception *thrownException() const;
|
||||||
|
|
||||||
|
virtual SourceLine sourceLine() const;
|
||||||
|
|
||||||
|
virtual bool isError() const;
|
||||||
|
|
||||||
|
virtual std::string failedTestName() const;
|
||||||
|
|
||||||
|
virtual TestFailure *clone() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Test *m_failedTest;
|
||||||
|
Exception *m_thrownException;
|
||||||
|
bool m_isError;
|
||||||
|
|
||||||
|
private:
|
||||||
|
TestFailure( const TestFailure &other );
|
||||||
|
TestFailure &operator =( const TestFailure& other );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTFAILURE_H
|
|
@ -0,0 +1,99 @@
|
||||||
|
#ifndef CPPUNIT_TESTFIXTURE_H // -*- C++ -*-
|
||||||
|
#define CPPUNIT_TESTFIXTURE_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Wraps a test case with setUp and tearDown methods.
|
||||||
|
* \ingroup WritingTestFixture
|
||||||
|
*
|
||||||
|
* A TestFixture is used to provide a common environment for a set
|
||||||
|
* of test cases.
|
||||||
|
*
|
||||||
|
* To define a test fixture, do the following:
|
||||||
|
* - implement a subclass of TestCase
|
||||||
|
* - the fixture is defined by instance variables
|
||||||
|
* - initialize the fixture state by overriding setUp
|
||||||
|
* (i.e. construct the instance variables of the fixture)
|
||||||
|
* - clean-up after a test by overriding tearDown.
|
||||||
|
*
|
||||||
|
* Each test runs in its own fixture so there
|
||||||
|
* can be no side effects among test runs.
|
||||||
|
* Here is an example:
|
||||||
|
*
|
||||||
|
* \code
|
||||||
|
* class MathTest : public CppUnit::TestFixture {
|
||||||
|
* protected:
|
||||||
|
* int m_value1, m_value2;
|
||||||
|
*
|
||||||
|
* public:
|
||||||
|
* MathTest() {}
|
||||||
|
*
|
||||||
|
* void setUp () {
|
||||||
|
* m_value1 = 2;
|
||||||
|
* m_value2 = 3;
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* For each test implement a method which interacts
|
||||||
|
* with the fixture. Verify the expected results with assertions specified
|
||||||
|
* by calling CPPUNIT_ASSERT on the expression you want to test:
|
||||||
|
*
|
||||||
|
* \code
|
||||||
|
* public:
|
||||||
|
* void testAdd () {
|
||||||
|
* int result = m_value1 + m_value2;
|
||||||
|
* CPPUNIT_ASSERT( result == 5 );
|
||||||
|
* }
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* Once the methods are defined you can run them. To do this, use
|
||||||
|
* a TestCaller.
|
||||||
|
*
|
||||||
|
* \code
|
||||||
|
* CppUnit::Test *test = new CppUnit::TestCaller<MathTest>( "testAdd",
|
||||||
|
* &MathTest::testAdd );
|
||||||
|
* test->run();
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* The tests to be run can be collected into a TestSuite.
|
||||||
|
*
|
||||||
|
* \code
|
||||||
|
* public:
|
||||||
|
* static CppUnit::TestSuite *MathTest::suite () {
|
||||||
|
* CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite;
|
||||||
|
* suiteOfTests->addTest(new CppUnit::TestCaller<MathTest>(
|
||||||
|
* "testAdd", &MathTest::testAdd));
|
||||||
|
* suiteOfTests->addTest(new CppUnit::TestCaller<MathTest>(
|
||||||
|
* "testDivideByZero", &MathTest::testDivideByZero));
|
||||||
|
* return suiteOfTests;
|
||||||
|
* }
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* A set of macros have been created for convenience. They are located in HelperMacros.h.
|
||||||
|
*
|
||||||
|
* \see TestResult, TestSuite, TestCaller,
|
||||||
|
* \see CPPUNIT_TEST_SUB_SUITE, CPPUNIT_TEST, CPPUNIT_TEST_SUITE_END,
|
||||||
|
* \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_EXCEPTION, CPPUNIT_TEST_FAIL.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestFixture
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~TestFixture() {};
|
||||||
|
|
||||||
|
//! \brief Set up context before running a test.
|
||||||
|
virtual void setUp() {};
|
||||||
|
|
||||||
|
//! Clean up after the test run.
|
||||||
|
virtual void tearDown() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,44 @@
|
||||||
|
#ifndef CPPUNIT_TESTLEAF_H
|
||||||
|
#define CPPUNIT_TESTLEAF_H
|
||||||
|
|
||||||
|
#include <cppunit/Test.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief A single test object.
|
||||||
|
*
|
||||||
|
* Base class for single test case: a test that doesn't have any children.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestLeaf: public Test
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! Returns 1 as the default number of test cases invoked by run().
|
||||||
|
*
|
||||||
|
* You may override this method when many test cases are invoked (RepeatedTest
|
||||||
|
* for example).
|
||||||
|
*
|
||||||
|
* \return 1.
|
||||||
|
* \see Test::countTestCases().
|
||||||
|
*/
|
||||||
|
int countTestCases() const;
|
||||||
|
|
||||||
|
/*! Returns the number of child of this test case: 0.
|
||||||
|
*
|
||||||
|
* You should never override this method: a TestLeaf as no children by definition.
|
||||||
|
*
|
||||||
|
* \return 0.
|
||||||
|
*/
|
||||||
|
int getChildTestCount() const;
|
||||||
|
|
||||||
|
/*! Always throws std::out_of_range.
|
||||||
|
* \see Test::doGetChildTestAt().
|
||||||
|
*/
|
||||||
|
Test *doGetChildTestAt( int index ) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTLEAF_H
|
|
@ -0,0 +1,148 @@
|
||||||
|
#ifndef CPPUNIT_TESTLISTENER_H // -*- C++ -*-
|
||||||
|
#define CPPUNIT_TESTLISTENER_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class Exception;
|
||||||
|
class Test;
|
||||||
|
class TestFailure;
|
||||||
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Listener for test progress and result.
|
||||||
|
* \ingroup TrackingTestExecution
|
||||||
|
*
|
||||||
|
* Implementing the Observer pattern a TestListener may be registered
|
||||||
|
* to a TestResult to obtain information on the testing progress. Use
|
||||||
|
* specialized sub classes of TestListener for text output
|
||||||
|
* (TextTestProgressListener). Do not use the Listener for the test
|
||||||
|
* result output, use a subclass of Outputter instead.
|
||||||
|
*
|
||||||
|
* The test framework distinguishes between failures and errors.
|
||||||
|
* A failure is anticipated and checked for with assertions. Errors are
|
||||||
|
* unanticipated problems signified by exceptions that are not generated
|
||||||
|
* by the framework.
|
||||||
|
*
|
||||||
|
* Here is an example to track test time:
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* \code
|
||||||
|
* #include <cppunit/TestListener.h>
|
||||||
|
* #include <cppunit/Test.h>
|
||||||
|
* #include <time.h> // for clock()
|
||||||
|
*
|
||||||
|
* class TimingListener : public CppUnit::TestListener
|
||||||
|
* {
|
||||||
|
* public:
|
||||||
|
* void startTest( CppUnit::Test *test )
|
||||||
|
* {
|
||||||
|
* _chronometer.start();
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* void endTest( CppUnit::Test *test )
|
||||||
|
* {
|
||||||
|
* _chronometer.end();
|
||||||
|
* addTest( test, _chronometer.elapsedTime() );
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* // ... (interface to add/read test timing result)
|
||||||
|
*
|
||||||
|
* private:
|
||||||
|
* Clock _chronometer;
|
||||||
|
* };
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* And another example that track failure/success at test suite level and captures
|
||||||
|
* the TestPath of each suite:
|
||||||
|
* \code
|
||||||
|
* class SuiteTracker : public CppUnit::TestListener
|
||||||
|
* {
|
||||||
|
* public:
|
||||||
|
* void startSuite( CppUnit::Test *suite )
|
||||||
|
* {
|
||||||
|
* m_currentPath.add( suite );
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* void addFailure( const TestFailure &failure )
|
||||||
|
* {
|
||||||
|
* m_suiteFailure.top() = false;
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* void endSuite( CppUnit::Test *suite )
|
||||||
|
* {
|
||||||
|
* m_suiteStatus.insert( std::make_pair( suite, m_suiteFailure.top() ) );
|
||||||
|
* m_suitePaths.insert( std::make_pair( suite, m_currentPath ) );
|
||||||
|
*
|
||||||
|
* m_currentPath.up();
|
||||||
|
* m_suiteFailure.pop();
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* private:
|
||||||
|
* std::stack<bool> m_suiteFailure;
|
||||||
|
* CppUnit::TestPath m_currentPath;
|
||||||
|
* std::map<CppUnit::Test *, bool> m_suiteStatus;
|
||||||
|
* std::map<CppUnit::Test *, CppUnit::TestPath> m_suitePaths;
|
||||||
|
* };
|
||||||
|
* \endcode
|
||||||
|
*
|
||||||
|
* \see TestResult
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~TestListener() {}
|
||||||
|
|
||||||
|
/// Called when just before a TestCase is run.
|
||||||
|
virtual void startTest( Test * /*test*/ ) {}
|
||||||
|
|
||||||
|
/*! \brief Called when a failure occurs while running a test.
|
||||||
|
* \see TestFailure.
|
||||||
|
* \warning \a failure is a temporary object that is destroyed after the
|
||||||
|
* method call. Use TestFailure::clone() to create a duplicate.
|
||||||
|
*/
|
||||||
|
virtual void addFailure( const TestFailure & /*failure*/ ) {}
|
||||||
|
|
||||||
|
/// Called just after a TestCase was run (even if a failure occured).
|
||||||
|
virtual void endTest( Test * /*test*/ ) {}
|
||||||
|
|
||||||
|
/*! \brief Called by a TestComposite just before running its child tests.
|
||||||
|
*/
|
||||||
|
virtual void startSuite( Test * /*suite*/ ) {}
|
||||||
|
|
||||||
|
/*! \brief Called by a TestComposite after running its child tests.
|
||||||
|
*/
|
||||||
|
virtual void endSuite( Test * /*suite*/ ) {}
|
||||||
|
|
||||||
|
/*! \brief Called by a TestRunner before running the test.
|
||||||
|
*
|
||||||
|
* You can use this to do some global initialisation. A listener
|
||||||
|
* could also use to output a 'prolog' to the test run.
|
||||||
|
*
|
||||||
|
* \param test Test that is going to be run.
|
||||||
|
* \param eventManager Event manager used for the test run.
|
||||||
|
*/
|
||||||
|
virtual void startTestRun( Test * /*test*/,
|
||||||
|
TestResult * /*eventManager*/ ) {}
|
||||||
|
|
||||||
|
/*! \brief Called by a TestRunner after running the test.
|
||||||
|
*
|
||||||
|
* TextTestProgressListener use this to emit a line break. You can also use this
|
||||||
|
* to do some global uninitialisation.
|
||||||
|
*
|
||||||
|
* \param test Test that was run.
|
||||||
|
* \param eventManager Event manager used for the test run.
|
||||||
|
*/
|
||||||
|
virtual void endTestRun( Test * /*test*/,
|
||||||
|
TestResult * /*eventManager*/ ) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTLISTENER_H
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,211 @@
|
||||||
|
#ifndef CPPUNIT_TESTPATH_H
|
||||||
|
#define CPPUNIT_TESTPATH_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <cppunit/portability/CppUnitDeque.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class Test;
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
// template class CPPUNIT_API std::deque<Test *>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief A List of Test representing a path to access a Test.
|
||||||
|
* \ingroup ExecutingTest
|
||||||
|
*
|
||||||
|
* The path can be converted to a string and resolved from a string with toString()
|
||||||
|
* and TestPath( Test *root, const std::string &pathAsString ).
|
||||||
|
*
|
||||||
|
* Pointed tests are not owned by the class.
|
||||||
|
*
|
||||||
|
* \see Test::resolvedTestPath()
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestPath
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Constructs an invalid path.
|
||||||
|
*
|
||||||
|
* The path is invalid until a test is added with add().
|
||||||
|
*/
|
||||||
|
TestPath();
|
||||||
|
|
||||||
|
/*! \brief Constructs a valid path.
|
||||||
|
*
|
||||||
|
* \param root Test to add.
|
||||||
|
*/
|
||||||
|
TestPath( Test *root );
|
||||||
|
|
||||||
|
/*! \brief Constructs a path using a slice of another path.
|
||||||
|
* \param otherPath Path the test are copied from.
|
||||||
|
* \param indexFirst Zero based index of the first test to copy. Adjusted to be in valid
|
||||||
|
* range. \a count is adjusted with \a indexFirst.
|
||||||
|
* \param count Number of tests to copy. If < 0 then all test starting from index
|
||||||
|
* \a indexFirst are copied.
|
||||||
|
*/
|
||||||
|
TestPath( const TestPath &otherPath,
|
||||||
|
int indexFirst,
|
||||||
|
int count = -1 );
|
||||||
|
|
||||||
|
/*! \brief Resolves a path from a string returned by toString().
|
||||||
|
*
|
||||||
|
* If \a pathAsString is an absolute path (begins with '/'), then the first test name
|
||||||
|
* of the path must be the name of \a searchRoot. Otherwise, \a pathAsString is a
|
||||||
|
* relative path, and the first test found using Test::findTest() matching the first
|
||||||
|
* test name is used as root. An empty string resolve to a path containing
|
||||||
|
* \a searchRoot.
|
||||||
|
*
|
||||||
|
* The resolved path is always valid.
|
||||||
|
*
|
||||||
|
* \param searchRoot Test used to resolve the path.
|
||||||
|
* \param pathAsString String that contains the path as a string created by toString().
|
||||||
|
* \exception std::invalid_argument if one of the test names can not be resolved.
|
||||||
|
* \see toString().
|
||||||
|
*/
|
||||||
|
TestPath( Test *searchRoot,
|
||||||
|
const std::string &pathAsString );
|
||||||
|
|
||||||
|
/*! \brief Copy constructor.
|
||||||
|
* \param other Object to copy.
|
||||||
|
*/
|
||||||
|
TestPath( const TestPath &other );
|
||||||
|
|
||||||
|
virtual ~TestPath();
|
||||||
|
|
||||||
|
/*! \brief Tests if the path contains at least one test.
|
||||||
|
* \return \c true if the path contains at least one test, otherwise returns \c false.
|
||||||
|
*/
|
||||||
|
virtual bool isValid() const;
|
||||||
|
|
||||||
|
/*! \brief Adds a test to the path.
|
||||||
|
* \param test Pointer on the test to add. Must not be \c NULL.
|
||||||
|
*/
|
||||||
|
virtual void add( Test *test );
|
||||||
|
|
||||||
|
/*! \brief Adds all the tests of the specified path.
|
||||||
|
* \param path Path that contains the test to add.
|
||||||
|
*/
|
||||||
|
virtual void add( const TestPath &path );
|
||||||
|
|
||||||
|
/*! \brief Inserts a test at the specified index.
|
||||||
|
* \param test Pointer on the test to insert. Must not be \c NULL.
|
||||||
|
* \param index Zero based index indicating where the test is inserted.
|
||||||
|
* \exception std::out_of_range is \a index < 0 or \a index > getTestCount().
|
||||||
|
*/
|
||||||
|
virtual void insert( Test *test, int index );
|
||||||
|
|
||||||
|
/*! \brief Inserts all the tests at the specified path at a given index.
|
||||||
|
* \param path Path that contains the test to insert.
|
||||||
|
* \param index Zero based index indicating where the tests are inserted.
|
||||||
|
* \exception std::out_of_range is \a index < 0 or \a index > getTestCount(), and
|
||||||
|
* \a path is valid.
|
||||||
|
*/
|
||||||
|
virtual void insert( const TestPath &path, int index );
|
||||||
|
|
||||||
|
/*! \brief Removes all the test from the path.
|
||||||
|
*
|
||||||
|
* The path becomes invalid after this call.
|
||||||
|
*/
|
||||||
|
virtual void removeTests();
|
||||||
|
|
||||||
|
/*! \brief Removes the test at the specified index of the path.
|
||||||
|
* \param index Zero based index of the test to remove.
|
||||||
|
* \exception std::out_of_range is \a index < 0 or \a index >= getTestCount().
|
||||||
|
*/
|
||||||
|
virtual void removeTest( int index );
|
||||||
|
|
||||||
|
/*! \brief Removes the last test.
|
||||||
|
* \exception std::out_of_range is the path is invalid.
|
||||||
|
* \see isValid().
|
||||||
|
*/
|
||||||
|
virtual void up();
|
||||||
|
|
||||||
|
/*! \brief Returns the number of tests in the path.
|
||||||
|
* \return Number of tests in the path.
|
||||||
|
*/
|
||||||
|
virtual int getTestCount() const;
|
||||||
|
|
||||||
|
/*! \brief Returns the test of the specified index.
|
||||||
|
* \param index Zero based index of the test to return.
|
||||||
|
* \return Pointer on the test at index \a index. Never \c NULL.
|
||||||
|
* \exception std::out_of_range is \a index < 0 or \a index >= getTestCount().
|
||||||
|
*/
|
||||||
|
virtual Test *getTestAt( int index ) const;
|
||||||
|
|
||||||
|
/*! \brief Get the last test of the path.
|
||||||
|
* \return Pointer on the last test (test at the bottom of the hierarchy). Never \c NULL.
|
||||||
|
* \exception std::out_of_range if the path is not valid ( isValid() returns \c false ).
|
||||||
|
*/
|
||||||
|
virtual Test *getChildTest() const;
|
||||||
|
|
||||||
|
/*! \brief Returns the path as a string.
|
||||||
|
*
|
||||||
|
* For example, if a path is composed of three tests named "All Tests", "Math" and
|
||||||
|
* "Math::testAdd", toString() will return:
|
||||||
|
*
|
||||||
|
* "All Tests/Math/Math::testAdd".
|
||||||
|
*
|
||||||
|
* \return A string composed of the test names separated with a '/'. It is a relative
|
||||||
|
* path.
|
||||||
|
*/
|
||||||
|
virtual std::string toString() const;
|
||||||
|
|
||||||
|
/*! \brief Assignment operator.
|
||||||
|
* \param other Object to copy.
|
||||||
|
* \return This object.
|
||||||
|
*/
|
||||||
|
TestPath &operator =( const TestPath &other );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/*! \brief Checks that the specified test index is within valid range.
|
||||||
|
* \param index Zero based index to check.
|
||||||
|
* \exception std::out_of_range is \a index < 0 or \a index >= getTestCount().
|
||||||
|
*/
|
||||||
|
void checkIndexValid( int index ) const;
|
||||||
|
|
||||||
|
/// A list of test names.
|
||||||
|
typedef CppUnitDeque<std::string> PathTestNames;
|
||||||
|
|
||||||
|
/*! \brief Splits a path string into its test name components.
|
||||||
|
* \param pathAsString Path string created with toString().
|
||||||
|
* \param testNames Test name components are added to that container.
|
||||||
|
* \return \c true if the path is relative (does not begin with '/'), \c false
|
||||||
|
* if it is absolute (begin with '/').
|
||||||
|
*/
|
||||||
|
bool splitPathString( const std::string &pathAsString,
|
||||||
|
PathTestNames &testNames );
|
||||||
|
|
||||||
|
/*! \brief Finds the actual root of a path string and get the path string name components.
|
||||||
|
* \param searchRoot Test used as root if the path string is absolute, or to search
|
||||||
|
* the root test if the path string is relative.
|
||||||
|
* \param pathAsString Path string. May be absolute or relative.
|
||||||
|
* \param testNames Test name components are added to that container.
|
||||||
|
* \return Pointer on the resolved root test. Never \c NULL.
|
||||||
|
* \exception std::invalid_argument if either the root name can not be resolved or if
|
||||||
|
* pathAsString contains no name components.
|
||||||
|
*/
|
||||||
|
Test *findActualRoot( Test *searchRoot,
|
||||||
|
const std::string &pathAsString,
|
||||||
|
PathTestNames &testNames );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
typedef CppUnitDeque<Test *> Tests;
|
||||||
|
Tests m_tests;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTPATH_H
|
||||||
|
|
|
@ -0,0 +1,156 @@
|
||||||
|
#ifndef CPPUNIT_TESTRESULT_H
|
||||||
|
#define CPPUNIT_TESTRESULT_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <cppunit/SynchronizedObject.h>
|
||||||
|
#include <cppunit/portability/CppUnitDeque.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class Exception;
|
||||||
|
class Functor;
|
||||||
|
class Protector;
|
||||||
|
class ProtectorChain;
|
||||||
|
class Test;
|
||||||
|
class TestFailure;
|
||||||
|
class TestListener;
|
||||||
|
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
// template class CPPUNIT_API std::deque<TestListener *>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*! \brief Manages TestListener.
|
||||||
|
* \ingroup TrackingTestExecution
|
||||||
|
*
|
||||||
|
* A single instance of this class is used when running the test. It is usually
|
||||||
|
* created by the test runner (TestRunner).
|
||||||
|
*
|
||||||
|
* This class shouldn't have to be inherited from. Use a TestListener
|
||||||
|
* or one of its subclasses to be informed of the ongoing tests.
|
||||||
|
* Use a Outputter to receive a test summary once it has finished
|
||||||
|
*
|
||||||
|
* TestResult supplies a template method 'setSynchronizationObject()'
|
||||||
|
* so that subclasses can provide mutual exclusion in the face of multiple
|
||||||
|
* threads. This can be useful when tests execute in one thread and
|
||||||
|
* they fill a subclass of TestResult which effects change in another
|
||||||
|
* thread. To have mutual exclusion, override setSynchronizationObject()
|
||||||
|
* and make sure that you create an instance of ExclusiveZone at the
|
||||||
|
* beginning of each method.
|
||||||
|
*
|
||||||
|
* \see Test, TestListener, TestResultCollector, Outputter.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestResult : protected SynchronizedObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/// Construct a TestResult
|
||||||
|
TestResult( SynchronizationObject *syncObject = 0 );
|
||||||
|
|
||||||
|
/// Destroys a test result
|
||||||
|
virtual ~TestResult();
|
||||||
|
|
||||||
|
virtual void addListener( TestListener *listener );
|
||||||
|
|
||||||
|
virtual void removeListener( TestListener *listener );
|
||||||
|
|
||||||
|
/// Resets the stop flag.
|
||||||
|
virtual void reset();
|
||||||
|
|
||||||
|
/// Stop testing
|
||||||
|
virtual void stop();
|
||||||
|
|
||||||
|
/// Returns whether testing should be stopped
|
||||||
|
virtual bool shouldStop() const;
|
||||||
|
|
||||||
|
/// Informs TestListener that a test will be started.
|
||||||
|
virtual void startTest( Test *test );
|
||||||
|
|
||||||
|
/*! \brief Adds an error to the list of errors.
|
||||||
|
* The passed in exception
|
||||||
|
* caused the error
|
||||||
|
*/
|
||||||
|
virtual void addError( Test *test, Exception *e );
|
||||||
|
|
||||||
|
/*! \brief Adds a failure to the list of failures. The passed in exception
|
||||||
|
* caused the failure.
|
||||||
|
*/
|
||||||
|
virtual void addFailure( Test *test, Exception *e );
|
||||||
|
|
||||||
|
/// Informs TestListener that a test was completed.
|
||||||
|
virtual void endTest( Test *test );
|
||||||
|
|
||||||
|
/// Informs TestListener that a test suite will be started.
|
||||||
|
virtual void startSuite( Test *test );
|
||||||
|
|
||||||
|
/// Informs TestListener that a test suite was completed.
|
||||||
|
virtual void endSuite( Test *test );
|
||||||
|
|
||||||
|
/*! \brief Run the specified test.
|
||||||
|
*
|
||||||
|
* Calls startTestRun(), test->run(this), and finally endTestRun().
|
||||||
|
*/
|
||||||
|
virtual void runTest( Test *test );
|
||||||
|
|
||||||
|
/*! \brief Protects a call to the specified functor.
|
||||||
|
*
|
||||||
|
* See Protector to understand how protector works. A default protector is
|
||||||
|
* always present. It captures CppUnit::Exception, std::exception and
|
||||||
|
* any other exceptions, retrieving as much as possible information about
|
||||||
|
* the exception as possible.
|
||||||
|
*
|
||||||
|
* Additional Protector can be added to the chain to support other exception
|
||||||
|
* types using pushProtector() and popProtector().
|
||||||
|
*
|
||||||
|
* \param functor Functor to call (typically a call to setUp(), runTest() or
|
||||||
|
* tearDown().
|
||||||
|
* \param test Test the functor is associated to (used for failure reporting).
|
||||||
|
* \param shortDescription Short description override for the failure message.
|
||||||
|
*/
|
||||||
|
virtual bool protect( const Functor &functor,
|
||||||
|
Test *test,
|
||||||
|
const std::string &shortDescription = std::string("") );
|
||||||
|
|
||||||
|
/// Adds the specified protector to the protector chain.
|
||||||
|
virtual void pushProtector( Protector *protector );
|
||||||
|
|
||||||
|
/// Removes the last protector from the protector chain.
|
||||||
|
virtual void popProtector();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/*! \brief Called to add a failure to the list of failures.
|
||||||
|
*/
|
||||||
|
void addFailure( const TestFailure &failure );
|
||||||
|
|
||||||
|
virtual void startTestRun( Test *test );
|
||||||
|
virtual void endTestRun( Test *test );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
typedef CppUnitDeque<TestListener *> TestListeners;
|
||||||
|
TestListeners m_listeners;
|
||||||
|
ProtectorChain *m_protectorChain;
|
||||||
|
bool m_stop;
|
||||||
|
|
||||||
|
private:
|
||||||
|
TestResult( const TestResult &other );
|
||||||
|
TestResult &operator =( const TestResult &other );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
#pragma warning( pop )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTRESULT_H
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
#ifndef CPPUNIT_TESTRESULTCOLLECTOR_H
|
||||||
|
#define CPPUNIT_TESTRESULTCOLLECTOR_H
|
||||||
|
|
||||||
|
#include <cppunit/Portability.h>
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable: 4251 4660 ) // X needs to have dll-interface to be used by clients of class Z
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <cppunit/TestSuccessListener.h>
|
||||||
|
#include <cppunit/portability/CppUnitDeque.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
// template class CPPUNIT_API std::deque<TestFailure *>;
|
||||||
|
// template class CPPUNIT_API std::deque<Test *>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Collects test result.
|
||||||
|
* \ingroup WritingTestResult
|
||||||
|
* \ingroup BrowsingCollectedTestResult
|
||||||
|
*
|
||||||
|
* A TestResultCollector is a TestListener which collects the results of executing
|
||||||
|
* a test case. It is an instance of the Collecting Parameter pattern.
|
||||||
|
*
|
||||||
|
* The test framework distinguishes between failures and errors.
|
||||||
|
* A failure is anticipated and checked for with assertions. Errors are
|
||||||
|
* unanticipated problems signified by exceptions that are not generated
|
||||||
|
* by the framework.
|
||||||
|
* \see TestListener, TestFailure.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestResultCollector : public TestSuccessListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef CppUnitDeque<TestFailure *> TestFailures;
|
||||||
|
typedef CppUnitDeque<Test *> Tests;
|
||||||
|
|
||||||
|
|
||||||
|
/*! Constructs a TestResultCollector object.
|
||||||
|
*/
|
||||||
|
TestResultCollector( SynchronizationObject *syncObject = 0 );
|
||||||
|
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~TestResultCollector();
|
||||||
|
|
||||||
|
void startTest( Test *test );
|
||||||
|
void addFailure( const TestFailure &failure );
|
||||||
|
|
||||||
|
virtual void reset();
|
||||||
|
|
||||||
|
virtual int runTests() const;
|
||||||
|
virtual int testErrors() const;
|
||||||
|
virtual int testFailures() const;
|
||||||
|
virtual int testFailuresTotal() const;
|
||||||
|
|
||||||
|
virtual const TestFailures& failures() const;
|
||||||
|
virtual const Tests &tests() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void freeFailures();
|
||||||
|
|
||||||
|
Tests m_tests;
|
||||||
|
TestFailures m_failures;
|
||||||
|
int m_testErrors;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Prevents the use of the copy constructor.
|
||||||
|
TestResultCollector( const TestResultCollector © );
|
||||||
|
|
||||||
|
/// Prevents the use of the copy operator.
|
||||||
|
void operator =( const TestResultCollector © );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#if CPPUNIT_NEED_DLL_DECL
|
||||||
|
#pragma warning( pop )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTRESULTCOLLECTOR_H
|
|
@ -0,0 +1,135 @@
|
||||||
|
#ifndef CPPUNIT_TESTRUNNER_H
|
||||||
|
#define CPPUNIT_TESTRUNNER_H
|
||||||
|
|
||||||
|
#include <cppunit/TestSuite.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
class Test;
|
||||||
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Generic test runner.
|
||||||
|
* \ingroup ExecutingTest
|
||||||
|
*
|
||||||
|
* The TestRunner assumes ownership of all added tests: you can not add test
|
||||||
|
* or suite that are local variable since they can't be deleted.
|
||||||
|
*
|
||||||
|
* Example of usage:
|
||||||
|
* \code
|
||||||
|
* #include <cppunit/extensions/TestFactoryRegistry.h>
|
||||||
|
* #include <cppunit/CompilerOutputter.h>
|
||||||
|
* #include <cppunit/TestResult.h>
|
||||||
|
* #include <cppunit/TestResultCollector.h>
|
||||||
|
* #include <cppunit/TestRunner.h>
|
||||||
|
* #include <cppunit/TextTestProgressListener.h>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* int
|
||||||
|
* main( int argc, char* argv[] )
|
||||||
|
* {
|
||||||
|
* std::string testPath = (argc > 1) ? std::string(argv[1]) : "";
|
||||||
|
*
|
||||||
|
* // Create the event manager and test controller
|
||||||
|
* CppUnit::TestResult controller;
|
||||||
|
*
|
||||||
|
* // Add a listener that colllects test result
|
||||||
|
* CppUnit::TestResultCollector result;
|
||||||
|
* controller.addListener( &result );
|
||||||
|
*
|
||||||
|
* // Add a listener that print dots as test run.
|
||||||
|
* CppUnit::TextTestProgressListener progress;
|
||||||
|
* controller.addListener( &progress );
|
||||||
|
*
|
||||||
|
* // Add the top suite to the test runner
|
||||||
|
* CppUnit::TestRunner runner;
|
||||||
|
* runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
|
||||||
|
* try
|
||||||
|
* {
|
||||||
|
* std::cout << "Running " << testPath;
|
||||||
|
* runner.run( controller, testPath );
|
||||||
|
*
|
||||||
|
* std::cerr << std::endl;
|
||||||
|
*
|
||||||
|
* // Print test in a compiler compatible format.
|
||||||
|
* CppUnit::CompilerOutputter outputter( &result, std::cerr );
|
||||||
|
* outputter.write();
|
||||||
|
* }
|
||||||
|
* catch ( std::invalid_argument &e ) // Test path not resolved
|
||||||
|
* {
|
||||||
|
* std::cerr << std::endl
|
||||||
|
* << "ERROR: " << e.what()
|
||||||
|
* << std::endl;
|
||||||
|
* return 0;
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* return result.wasSuccessful() ? 0 : 1;
|
||||||
|
* }
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestRunner
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Constructs a TestRunner object.
|
||||||
|
*/
|
||||||
|
TestRunner( );
|
||||||
|
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~TestRunner();
|
||||||
|
|
||||||
|
/*! \brief Adds the specified test.
|
||||||
|
* \param test Test to add. The TestRunner takes ownership of the test.
|
||||||
|
*/
|
||||||
|
virtual void addTest( Test *test );
|
||||||
|
|
||||||
|
/*! \brief Runs a test using the specified controller.
|
||||||
|
* \param controller Event manager and controller used for testing
|
||||||
|
* \param testPath Test path string. See Test::resolveTestPath() for detail.
|
||||||
|
* \exception std::invalid_argument if no test matching \a testPath is found.
|
||||||
|
* see TestPath::TestPath( Test*, const std::string &)
|
||||||
|
* for detail.
|
||||||
|
*/
|
||||||
|
virtual void run( TestResult &controller,
|
||||||
|
const std::string &testPath = "" );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/*! \brief (INTERNAL) Mutating test suite.
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API WrappingSuite : public TestSuite
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
WrappingSuite( const std::string &name = "All Tests" );
|
||||||
|
|
||||||
|
int getChildTestCount() const;
|
||||||
|
|
||||||
|
std::string getName() const;
|
||||||
|
|
||||||
|
void run( TestResult *result );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Test *doGetChildTestAt( int index ) const;
|
||||||
|
|
||||||
|
bool hasOnlyOneTest() const;
|
||||||
|
|
||||||
|
Test *getUniqueChildTest() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
WrappingSuite *m_suite;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Prevents the use of the copy constructor.
|
||||||
|
TestRunner( const TestRunner © );
|
||||||
|
|
||||||
|
/// Prevents the use of the copy operator.
|
||||||
|
void operator =( const TestRunner © );
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTRUNNER_H
|
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef CPPUNIT_TESTSUCCESSLISTENER_H
|
||||||
|
#define CPPUNIT_TESTSUCCESSLISTENER_H
|
||||||
|
|
||||||
|
#include <cppunit/SynchronizedObject.h>
|
||||||
|
#include <cppunit/TestListener.h>
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief TestListener that checks if any test case failed.
|
||||||
|
* \ingroup TrackingTestExecution
|
||||||
|
*/
|
||||||
|
class CPPUNIT_API TestSuccessListener : public TestListener,
|
||||||
|
public SynchronizedObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! Constructs a TestSuccessListener object.
|
||||||
|
*/
|
||||||
|
TestSuccessListener( SynchronizationObject *syncObject = 0 );
|
||||||
|
|
||||||
|
/// Destructor.
|
||||||
|
virtual ~TestSuccessListener();
|
||||||
|
|
||||||
|
virtual void reset();
|
||||||
|
|
||||||
|
void addFailure( const TestFailure &failure );
|
||||||
|
|
||||||
|
/// Returns whether the entire test was successful or not.
|
||||||
|
virtual bool wasSuccessful() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_success;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPPUNIT_NS_END
|
||||||
|
|
||||||
|
#endif // CPPUNIT_TESTSUCCESSLISTENER_H
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue