2015-11-27 19:24:00 +01:00
|
|
|
/*
|
2015-11-28 19:20:10 +01:00
|
|
|
EVENT-LOG.hpp - test facility to verify the occurrence of expected events
|
2015-11-27 19:24:00 +01:00
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
2015-11-28 19:20:10 +01:00
|
|
|
2015, Hermann Vosseler <Ichthyostega@web.de>
|
2015-11-27 19:24:00 +01:00
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2015-11-28 19:20:10 +01:00
|
|
|
/** @file event-log.hpp
|
|
|
|
|
** Support for verifying the occurrence of events from unit tests.
|
|
|
|
|
** Typically used within special rigging and instrumentation for tests,
|
|
|
|
|
** the [EventLog] allows to record invocations and similar events. It is
|
|
|
|
|
** implemented as a "PImpl" to allow sharing of logs. The front-end used
|
|
|
|
|
** for access offers a query facility, so the test code may express some
|
|
|
|
|
** expected patterns of incidence and verify match or non-match.
|
|
|
|
|
**
|
|
|
|
|
** Failure of match deliberately throws an assertion failure, in order to
|
|
|
|
|
** deliver a precise indication what part of the condition failed.
|
|
|
|
|
**
|
|
|
|
|
** @todo as of 11/2015 this is complete WIP-WIP-WIP
|
|
|
|
|
**
|
|
|
|
|
** @see ////TODO_test usage example
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2015-11-28 18:36:35 +01:00
|
|
|
#ifndef LIB_TEST_EVENT_LOG_H
|
|
|
|
|
#define LIB_TEST_EVENT_LOG_H
|
2015-11-27 19:24:00 +01:00
|
|
|
|
|
|
|
|
|
2015-11-28 19:20:10 +01:00
|
|
|
#include "lib/error.hpp"
|
|
|
|
|
//#include "lib/time/timevalue.hpp"
|
2015-11-27 19:24:00 +01:00
|
|
|
|
2015-11-28 19:20:10 +01:00
|
|
|
//#include <boost/lexical_cast.hpp>
|
|
|
|
|
//#include <string>
|
2015-11-27 19:24:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace lib {
|
|
|
|
|
namespace test{
|
|
|
|
|
|
2015-11-28 19:20:10 +01:00
|
|
|
// using lib::Literal;
|
|
|
|
|
// using std::string;
|
|
|
|
|
// using std::rand;
|
2015-11-27 19:24:00 +01:00
|
|
|
|
|
|
|
|
|
2015-11-28 19:20:10 +01:00
|
|
|
/**
|
|
|
|
|
* Helper to log and verify the occurrence of events.
|
2015-11-27 19:24:00 +01:00
|
|
|
*/
|
2015-11-28 19:20:10 +01:00
|
|
|
class EventLog
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
};
|
2015-11-27 19:24:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}} // namespace lib::test
|
2015-11-28 19:20:10 +01:00
|
|
|
#endif /*LIB_TEST_EVENT_LOG_H*/
|