added cppunit unit testing framework, using cmake, stripped out the original build systems.

added starting point for Bullet unit tests, with one example unit test
Enable the option BUILD_UNIT_TESTS in cmake to build the test. Note that the test doesn't automatically run.
This commit is contained in:
erwin.coumans
2010-07-23 22:09:57 +00:00
parent 6f823687b5
commit a983353f34
139 changed files with 15575 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#ifndef CPPUNIT_CONFIG_CPPUNITAPI
#define CPPUNIT_CONFIG_CPPUNITAPI
#undef CPPUNIT_API
#ifdef WIN32
// define CPPUNIT_DLL_BUILD when building CppUnit dll.
#ifdef CPPUNIT_BUILD_DLL
#define CPPUNIT_API __declspec(dllexport)
#endif
// define CPPUNIT_DLL when linking to CppUnit dll.
#ifdef CPPUNIT_DLL
#define CPPUNIT_API __declspec(dllimport)
#endif
#ifdef CPPUNIT_API
#undef CPPUNIT_NEED_DLL_DECL
#define CPPUNIT_NEED_DLL_DECL 1
#endif
#endif
#ifndef CPPUNIT_API
#define CPPUNIT_API
#undef CPPUNIT_NEED_DLL_DECL
#define CPPUNIT_NEED_DLL_DECL 0
#endif
#endif // CPPUNIT_CONFIG_CPPUNITAPI

View File

@@ -0,0 +1,76 @@
#ifndef CPPUNIT_CONFIG_SELECTDLLLOADER_H
#define CPPUNIT_CONFIG_SELECTDLLLOADER_H
/*! \file
* Selects DynamicLibraryManager implementation.
*
* Don't include this file directly. Include Portability.h instead.
*/
/*!
* \def CPPUNIT_NO_TESTPLUGIN
* \brief If defined, then plug-in related classes and functions will not be compiled.
*
* \internal
* CPPUNIT_HAVE_WIN32_DLL_LOADER
* If defined, Win32 implementation of DynamicLibraryManager will be used.
*
* CPPUNIT_HAVE_BEOS_DLL_LOADER
* If defined, BeOs implementation of DynamicLibraryManager will be used.
*
* CPPUNIT_HAVE_UNIX_DLL_LOADER
* If defined, Unix implementation (dlfcn.h) of DynamicLibraryManager will be used.
*/
/*!
* \def CPPUNIT_PLUGIN_EXPORT
* \ingroup WritingTestPlugIn
* \brief A macro to export a function from a dynamic library
*
* This macro export the C function following it from a dynamic library.
* Exporting the function makes it accessible to the DynamicLibraryManager.
*
* Example of usage:
* \code
* #include <cppunit/include/plugin/TestPlugIn.h>
*
* CPPUNIT_PLUGIN_EXPORT CppUnitTestPlugIn *CPPUNIT_PLUGIN_EXPORTED_NAME(void)
* {
* ...
* return &myPlugInInterface;
* }
* \endcode
*/
#if !defined(CPPUNIT_NO_TESTPLUGIN)
// Is WIN32 platform ?
#if defined(WIN32)
#define CPPUNIT_HAVE_WIN32_DLL_LOADER 1
#undef CPPUNIT_PLUGIN_EXPORT
#define CPPUNIT_PLUGIN_EXPORT extern "C" __declspec(dllexport)
// Is BeOS platform ?
#elif defined(__BEOS__)
#define CPPUNIT_HAVE_BEOS_DLL_LOADER 1
// Is Unix platform and have shl_load() (hp-ux)
#elif defined(CPPUNIT_HAVE_SHL_LOAD)
#define CPPUNIT_HAVE_UNIX_SHL_LOADER 1
// Is Unix platform and have include <dlfcn.h>
#elif defined(CPPUNIT_HAVE_LIBDL)
#define CPPUNIT_HAVE_UNIX_DLL_LOADER 1
// Otherwise, disable support for DllLoader
#else
#define CPPUNIT_NO_TESTPLUGIN 1
#endif
#if !defined(CPPUNIT_PLUGIN_EXPORT)
#define CPPUNIT_PLUGIN_EXPORT extern "C"
#endif // !defined(CPPUNIT_PLUGIN_EXPORT)
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_CONFIG_SELECTDLLLOADER_H

View File

@@ -0,0 +1,14 @@
#ifndef CPPUNIT_CONFIG_H_INCLUDED
#define CPPUNIT_CONFIG_H_INCLUDED
#include <cppunit/Portability.h>
#ifdef _MSC_VER
#pragma warning(disable: 4018 4284 4146)
#if _MSC_VER >= 1400
#pragma warning(disable: 4996) // sprintf is deprecated
#endif
#endif
#endif // CPPUNIT_CONFIG_H_INCLUDED

View File

@@ -0,0 +1,47 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_BCB5_H
#define _INCLUDE_CPPUNIT_CONFIG_BCB5_H 1
#define HAVE_CMATH 1
/* include/cppunit/config-bcb5.h. Manually adapted from
include/cppunit/config-auto.h */
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if library uses std::string::compare(string,pos,n) */
#ifndef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#define CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 0
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
#define CPPUNIT_HAVE_RTTI 1
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
#define CPPUNIT_HAVE_SSTREAM 1
/* Name of package */
#ifndef CPPUNIT_PACKAGE
#define CPPUNIT_PACKAGE "cppunit"
#endif
/* _INCLUDE_CPPUNIT_CONFIG_BCB5_H */
#endif

View File

@@ -0,0 +1,78 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_EVC4_H
#define _INCLUDE_CPPUNIT_CONFIG_EVC4_H 1
#if _MSC_VER > 1000 // VC++
#pragma warning( disable : 4786 ) // disable warning debug symbol > 255...
#endif // _MSC_VER > 1000
#define HAVE_CMATH 1
/* include/cppunit/config-msvc6.h. Manually adapted from
include/cppunit/config-auto.h */
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if library uses std::string::compare(string,pos,n) */
#ifdef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
#define CPPUNIT_HAVE_RTTI 0
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
#define CPPUNIT_NO_STREAM 1
#define CPPUNIT_NO_ASSERT 1
#define CPPUNIT_HAVE_SSTREAM 0
/* Name of package */
#ifndef CPPUNIT_PACKAGE
#define CPPUNIT_PACKAGE "cppunit"
#endif
// Compiler error location format for CompilerOutputter
// See class CompilerOutputter for format.
#undef CPPUNIT_COMPILER_LOCATION_FORMAT
#if _MSC_VER >= 1300 // VS 7.0
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l) : error : "
#else
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l):"
#endif
/* define to 1 if the compiler has _finite() */
#ifndef CPPUNIT_HAVE__FINITE
#define CPPUNIT_HAVE__FINITE 1
#endif
// Uncomment to turn on STL wrapping => use this to test compilation.
// This will make CppUnit subclass std::vector & co to provide default
// parameter.
/*#define CPPUNIT_STD_NEED_ALLOCATOR 1
#define CPPUNIT_STD_ALLOCATOR std::allocator<T>
//#define CPPUNIT_NO_NAMESPACE 1
*/
/* _INCLUDE_CPPUNIT_CONFIG_EVC4_H */
#endif

View File

@@ -0,0 +1,58 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_MAC_H
#define _INCLUDE_CPPUNIT_CONFIG_MAC_H 1
/* MacOS X should be installed using the configure script.
This file is for other macs.
It is not integrated into <cppunit/Portability.h> because we don't
know a suitable preprocessor symbol that will distinguish MacOS X
from other MacOS versions. Email us if you know the answer.
*/
/* define if library uses std::string::compare(string,pos,n) */
#ifdef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#endif
/* define if the library defines strstream */
#ifndef CPPUNIT_HAVE_CLASS_STRSTREAM
#define CPPUNIT_HAVE_CLASS_STRSTREAM 1
#endif
/* Define if you have the <cmath> header file. */
#ifdef CPPUNIT_HAVE_CMATH
#undef CPPUNIT_HAVE_CMATH
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
#define CPPUNIT_HAVE_RTTI 1
#endif
/* define if the compiler has stringstream */
#ifndef CPPUNIT_HAVE_SSTREAM
#define CPPUNIT_HAVE_SSTREAM 1
#endif
/* Define if you have the <strstream> header file. */
#ifndef CPPUNIT_HAVE_STRSTREAM
#define CPPUNIT_HAVE_STRSTREAM 1
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
/* _INCLUDE_CPPUNIT_CONFIG_MAC_H */
#endif

View File

@@ -0,0 +1,86 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_MSVC6_H
#define _INCLUDE_CPPUNIT_CONFIG_MSVC6_H 1
#if _MSC_VER > 1000 // VC++
#pragma warning( disable : 4786 ) // disable warning debug symbol > 255...
#endif // _MSC_VER > 1000
#define HAVE_CMATH 1
/* include/cppunit/config-msvc6.h. Manually adapted from
include/cppunit/config-auto.h */
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if library uses std::string::compare(string,pos,n) */
#ifdef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
# ifdef _CPPRTTI // Defined by the compiler option /GR
# define CPPUNIT_HAVE_RTTI 1
# else
# define CPPUNIT_HAVE_RTTI 0
# endif
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
#define CPPUNIT_HAVE_SSTREAM 1
/* Name of package */
#ifndef CPPUNIT_PACKAGE
#define CPPUNIT_PACKAGE "cppunit"
#endif
// Compiler error location format for CompilerOutputter
// See class CompilerOutputter for format.
#undef CPPUNIT_COMPILER_LOCATION_FORMAT
#if _MSC_VER >= 1300 // VS 7.0
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l) : error : "
#else
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l):"
#endif
// Define to 1 if the compiler support C++ style cast.
#define CPPUNIT_HAVE_CPP_CAST 1
/* define to 1 if the compiler has _finite() */
#ifndef CPPUNIT_HAVE__FINITE
#define CPPUNIT_HAVE__FINITE 1
#endif
// Uncomment to turn on STL wrapping => use this to test compilation.
// This will make CppUnit subclass std::vector & co to provide default
// parameter.
/*#define CPPUNIT_STD_NEED_ALLOCATOR 1
#define CPPUNIT_STD_ALLOCATOR std::allocator<T>
//#define CPPUNIT_NO_NAMESPACE 1
*/
#if _MSC_VER >= 1300 // VS 7.0
#define CPPUNIT_UNIQUE_COUNTER __COUNTER__
#endif // if _MSC_VER >= 1300 // VS 7.0
/* _INCLUDE_CPPUNIT_CONFIG_MSVC6_H */
#endif