First attempt at data generator support

The support is to be considered experimental, that is, the interfaces,
the first party generators and helper functions can change or be removed
at any point in time.

Related to #850
This commit is contained in:
Phil Nash authored and Martin Hořeňovský committed 2018-08-24 13:31:51 +02:00
1 parent 7f18282d17
commit 7c25dae9ea
12 files changed
+656 -16

No files matched your search

@@ -0,0 +1,39 @@
/*
* Created by Phil Nash on 26/6/2018.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef TWOBLUECUBES_CATCH_INTERFACES_GENERATORTRACKER_INCLUDED
#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORTRACKER_INCLUDED
#include <memory>
namespace Catch {
namespace Generators {
class GeneratorBase {
protected:
size_t m_size = 0;
public:
GeneratorBase( size_t size ) : m_size( size ) {}
virtual ~GeneratorBase();
auto size() const -> size_t { return m_size; }
};
using GeneratorBasePtr = std::unique_ptr<GeneratorBase>;
} // namespace Generators
struct IGeneratorTracker {
virtual ~IGeneratorTracker();
virtual auto hasGenerator() const -> bool = 0;
virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0;
virtual auto getIndex() const -> std::size_t = 0;
};
} // namespace Catch
#endif //TWOBLUECUBES_CATCH_INTERFACES_GENERATORTRACKER_INCLUDED