Made the Unit test stuff a bit more mwcc/mwld friendly. It still doesn't build right out of the box with our build system, but with a few changes to the build system it can be done (I'm not going to do that, though).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6640 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
/*! This class is used to serialize access to a TestResult object. You should
|
||||
not need to explicitly use it anywhere in your testing code.
|
||||
*/
|
||||
class LockerSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
|
||||
class CPPUNIT_API LockerSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
|
||||
public:
|
||||
LockerSyncObject() {}
|
||||
virtual ~LockerSyncObject() {}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*! This class is used to serialize access to a TestResult object. You should
|
||||
not need to explicitly use it anywhere in your testing code.
|
||||
*/
|
||||
class SemaphoreSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
|
||||
class CPPUNIT_API SemaphoreSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
|
||||
public:
|
||||
SemaphoreSyncObject();
|
||||
virtual ~SemaphoreSyncObject();
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <List.h>
|
||||
#include <MessageQueue.h>
|
||||
|
||||
#include <cppunit/Portability.h>
|
||||
|
||||
// TestHandler
|
||||
|
||||
class BTestHandler : public BHandler {
|
||||
@@ -21,7 +23,7 @@ private:
|
||||
|
||||
// TestApp
|
||||
|
||||
class BTestApp : public BApplication {
|
||||
class CPPUNIT_API BTestApp : public BApplication {
|
||||
public:
|
||||
BTestApp(const char *signature);
|
||||
virtual ~BTestApp();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <SupportDefs.h>
|
||||
|
||||
//! Base class for single threaded unit tests
|
||||
class BTestCase : public CppUnit::TestCase {
|
||||
class CPPUNIT_API BTestCase : public CppUnit::TestCase {
|
||||
public:
|
||||
BTestCase(string Name = "");
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class CppUnit::Exception;
|
||||
You should not need to explicitly use this class in any
|
||||
of your tests.
|
||||
*/
|
||||
class BTestListener : public CppUnit::TestListener {
|
||||
class CPPUNIT_API BTestListener : public CppUnit::TestListener {
|
||||
public:
|
||||
virtual void startTest( CppUnit::Test *test );
|
||||
virtual void addFailure( const CppUnit::TestFailure &failure );
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef CppUnit::SynchronizedObject::SynchronizationObject SyncObject;
|
||||
user can get a list of each test installed via AddSuite(), and optionally
|
||||
can opt to run only a specified set of them.
|
||||
*/
|
||||
class BTestShell {
|
||||
class CPPUNIT_API BTestShell {
|
||||
public:
|
||||
BTestShell(const string &description = "", SyncObject *syncObject = 0);
|
||||
virtual ~BTestShell();
|
||||
@@ -120,13 +120,14 @@ protected:
|
||||
static const char indent[];
|
||||
bool fListTestsAndExit;
|
||||
BPath *fTestDir;
|
||||
BLocker *fPatchGroupLocker;
|
||||
int32 fTLSDebuggerCall;
|
||||
#ifndef NO_ELF_SYMBOL_PATCHING
|
||||
BLocker *fPatchGroupLocker;
|
||||
ElfSymbolPatchGroup *fPatchGroup;
|
||||
void (*fOldDebuggerHook)(const char*);
|
||||
image_id (*fOldLoadAddOnHook)(const char*);
|
||||
status_t (*fOldUnloadAddOnHook)(image_id);
|
||||
|
||||
#endif // ! NO_ELF_SYMBOL_PATCHING
|
||||
|
||||
//! Prints a brief description of the program.
|
||||
virtual void PrintDescription(int argc, char *argv[]);
|
||||
@@ -177,6 +178,7 @@ private:
|
||||
//! Prevents the use of the copy operator.
|
||||
void operator =( const BTestShell © );
|
||||
|
||||
#ifndef NO_ELF_SYMBOL_PATCHING
|
||||
void _Debugger(const char* message);
|
||||
image_id _LoadAddOn(const char* path);
|
||||
status_t _UnloadAddOn(image_id image);
|
||||
@@ -184,6 +186,7 @@ private:
|
||||
static void _DebuggerHook(const char* message);
|
||||
static image_id _LoadAddOnHook(const char* path);
|
||||
static status_t _UnloadAddOnHook(image_id image);
|
||||
#endif // ! NO_ELF_SYMBOL_PATCHING
|
||||
|
||||
}; // class BTestShell
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class CppUnit::TestResult;
|
||||
|
||||
//! Groups together a set of tests for a given kit.
|
||||
class BTestSuite : public CppUnit::Test {
|
||||
class CPPUNIT_API BTestSuite : public CppUnit::Test {
|
||||
public:
|
||||
BTestSuite( string name = "" );
|
||||
virtual ~BTestSuite();
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
class BTestSuite;
|
||||
|
||||
extern "C" {
|
||||
BTestSuite* getTestSuite();
|
||||
}
|
||||
extern "C" CPPUNIT_API BTestSuite* getTestSuite();
|
||||
|
||||
#endif // _beos_test_suite_addon_h_
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <string>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#include <cppunit/Portability.h>
|
||||
|
||||
// Handy defines :-)
|
||||
#define CHK CPPUNIT_ASSERT
|
||||
#define RES DecodeResult
|
||||
@@ -13,7 +15,7 @@
|
||||
// out just what the R5 libraries are returning.
|
||||
// Returns the same value passed in, so you can
|
||||
// use it inline in tests if necessary.
|
||||
status_t DecodeResult(status_t result);
|
||||
extern CPPUNIT_API status_t DecodeResult(status_t result);
|
||||
|
||||
// First parameter is equal to the second or third
|
||||
template<typename A, typename B, typename C>
|
||||
@@ -26,17 +28,17 @@ Equals(const A &a, const B &b, const C &c)
|
||||
}
|
||||
|
||||
// Returns a string version of the given integer
|
||||
string IntToStr(int i);
|
||||
extern CPPUNIT_API string IntToStr(int i);
|
||||
|
||||
// Calls system() with the concatenated string of command and parameter.
|
||||
void ExecCommand(const char *command, const char *parameter);
|
||||
extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter);
|
||||
|
||||
// Calls system() with the concatenated string of command, parameter1,
|
||||
// " " and parameter2.
|
||||
void ExecCommand(const char *command, const char *parameter1,
|
||||
const char *parameter2);
|
||||
extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter1,
|
||||
const char *parameter2);
|
||||
|
||||
// Calls system() with the given command (kind of silly, but it's consistent :-)
|
||||
void ExecCommand(const char *command);
|
||||
extern CPPUNIT_API void ExecCommand(const char *command);
|
||||
|
||||
#endif // __beos_test_utils_h__
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// Helper class to handle thread management
|
||||
template <class TestClass, class ExpectedException>
|
||||
class BThreadManager {
|
||||
class CPPUNIT_API BThreadManager {
|
||||
public:
|
||||
typedef void (TestClass::*ThreadMethod)();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class TestResult;
|
||||
|
||||
template <class TestClass, class ExpectedException = CppUnit::NoExceptionExpected>
|
||||
class BThreadedTestCaller : public CppUnit::TestCase {
|
||||
class CPPUNIT_API BThreadedTestCaller : public CppUnit::TestCase {
|
||||
public:
|
||||
/*! \brief Pointer to a test function in the given class.
|
||||
Each ThreadMethod added with addThread() is run in its own thread.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <vector>
|
||||
|
||||
//! Base class for single threaded unit tests
|
||||
class BThreadedTestCase : public BTestCase {
|
||||
class CPPUNIT_API BThreadedTestCase : public BTestCase {
|
||||
public:
|
||||
BThreadedTestCase(string Name = "", string progressSeparator = ".");
|
||||
virtual ~BThreadedTestCase();
|
||||
|
||||
@@ -41,7 +41,11 @@
|
||||
|
||||
// CPPUNIT_API is defined in <config_msvc6.h> if required (building or using as dll)
|
||||
#ifndef CPPUNIT_API
|
||||
#define CPPUNIT_API
|
||||
# ifdef BUILDING_CPPUNIT
|
||||
# define CPPUNIT_API _EXPORT
|
||||
# else
|
||||
# define CPPUNIT_API _IMPORT
|
||||
# endif
|
||||
#undef CPPUNIT_NEED_DLL_DECL
|
||||
#define CPPUNIT_NEED_DLL_DECL 0
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user