2009-02-18 12:39:51 +01:00
|
|
|
/*
|
2009-03-25 12:25:08 +01:00
|
|
|
* Copyright (C) 2008 Funambol, Inc.
|
2009-03-25 15:21:04 +01:00
|
|
|
* Copyright (C) 2008-2009 Patrick Ohly <patrick.ohly@gmx.de>
|
|
|
|
* Copyright (C) 2009 Intel Corporation
|
2009-04-30 18:26:27 +02:00
|
|
|
*
|
|
|
|
* 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) version 3.
|
|
|
|
*
|
|
|
|
* 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
* 02110-1301 USA
|
2009-02-18 12:39:51 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file is used by source files which depend on CPPUnit and thus
|
|
|
|
* the STL => using it here is allowed.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCL_TEST_H
|
|
|
|
#define INCL_TEST_H
|
|
|
|
/** @cond DEV */
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
2009-10-05 14:49:32 +02:00
|
|
|
# include "config.h"
|
2009-02-18 12:39:51 +01:00
|
|
|
#endif
|
|
|
|
|
2009-10-05 14:49:32 +02:00
|
|
|
#include <syncevo/declarations.h>
|
2009-10-02 17:23:53 +02:00
|
|
|
|
2009-02-18 12:39:51 +01:00
|
|
|
// These defines are set in config.h when using the autotools
|
|
|
|
// mechanism and by the project setup on Windows. They control whether
|
|
|
|
// tests inside the libraries source code (ENABLE_UNIT_TESTS) or of
|
|
|
|
// the final library are enabled (ENABLE_INTEGRATION_TESTS).
|
|
|
|
#if defined(ENABLE_UNIT_TESTS) || defined(ENABLE_INTEGRATION_TESTS)
|
|
|
|
|
|
|
|
// make common macros like CPPUNIT_TEST_ASSERT() available */
|
|
|
|
# include <cppunit/extensions/TestFactoryRegistry.h>
|
|
|
|
# include <cppunit/extensions/HelperMacros.h>
|
|
|
|
# include <string>
|
|
|
|
|
2009-10-02 17:23:53 +02:00
|
|
|
SE_BEGIN_CXX
|
2009-02-18 12:39:51 +01:00
|
|
|
|
|
|
|
// until a better solution is found use the helper function from TestMain.cpp
|
|
|
|
// to get the name of the currently running test; beware, will contain colons
|
|
|
|
extern const std::string &getCurrentTest();
|
|
|
|
|
|
|
|
// removes special characters like colons and slashes
|
|
|
|
extern void simplifyFilename(std::string &filename);
|
|
|
|
|
2009-07-13 18:24:55 +02:00
|
|
|
// redefine CPPUNIT_TEST so that we can filter tests
|
|
|
|
#undef CPPUNIT_TEST
|
|
|
|
#define CPPUNIT_TEST(testMethod) \
|
|
|
|
CPPUNIT_TEST_SUITE_ADD_TEST( \
|
|
|
|
( FilterTest(new CPPUNIT_NS::TestCaller<TestFixtureType>( \
|
|
|
|
context.getTestNameFor( #testMethod), \
|
|
|
|
&TestFixtureType::testMethod, \
|
|
|
|
context.makeFixture() ) ) ) )
|
|
|
|
|
|
|
|
/**
|
|
|
|
* replace test with dummy if filtered out via CLIENT_TEST_SKIP
|
|
|
|
*/
|
|
|
|
CppUnit::Test *FilterTest(CppUnit::Test *test);
|
|
|
|
|
2009-10-02 17:23:53 +02:00
|
|
|
SE_END_CXX
|
|
|
|
|
2009-02-18 12:39:51 +01:00
|
|
|
#endif // ENABLE_UNIT_TESTS
|
|
|
|
|
|
|
|
/** @endcond */
|
2009-10-02 17:23:53 +02:00
|
|
|
|
2009-02-18 12:39:51 +01:00
|
|
|
#endif // INCL_TEST_H
|