#include <vector>
+namespace { class Collection; }
+typedef std::vector<libtest::Collection*> Suites;
+
+namespace libtest {
+
class Framework {
public:
- collection_st *collections;
-
- /* These methods are called outside of any collection call. */
- test_callback_create_fn *_create;
- test_callback_destroy_fn *_destroy;
public:
test_return_t create();
- /**
- If an error occurs during the test, this is called.
- */
- test_callback_error_fn *_on_error;
+ const std::string& name() const
+ {
+ return _name;
+ }
+
+ void create(test_callback_create_fn* arg)
+ {
+ _create= arg;
+ }
+
+ void destroy(test_callback_destroy_fn* arg)
+ {
+ _destroy= arg;
+ }
+
+ void collections(collection_st* arg);
void set_on_error(test_callback_error_fn *arg)
{
{
return _servers;
}
-
- /**
- Runner represents the callers for the tests. If not implemented we will use
- a set of default implementations.
- */
- libtest::Runner *_runner;
void set_runner(libtest::Runner *arg)
{
libtest::Collection& collection();
- Framework(libtest::SignalThread&, const std::string&);
-
virtual ~Framework();
Framework(libtest::SignalThread&,
+ const std::string&,
const std::string&,
const std::string&);
return _failed;
}
+ Suites& suites()
+ {
+ return _collection;
+ }
+
private:
Framework& operator=(const Framework&);
uint32_t _success;
uint32_t _skipped;
uint32_t _failed;
+
+ /* These methods are called outside of any collection call. */
+ test_callback_create_fn *_create;
+ test_callback_destroy_fn *_destroy;
+
+ /**
+ If an error occurs during the test, this is called.
+ */
+ test_callback_error_fn *_on_error;
+
+ /**
+ Runner represents the callers for the tests. If not implemented we will use
+ a set of default implementations.
+ */
+ libtest::Runner *_runner;
libtest::server_startup_st _servers;
bool _socket;
void *_creators_ptr;
unsigned long int _servers_to_run;
- std::vector<libtest::Collection*> _collection;
+ Suites _collection;
libtest::SignalThread& _signal;
std::string _only_run;
std::string _wildcard;
+ std::string _name;
};
+
+} // namespace libtest