Correct style, use of newer YATL.
[awesomized/libmemcached] / libtest / framework.h
index da1d5b9878ed2b28a4ac5451a10050778fe8b440..7a24466a5ab9c7254d8f4b3a3db4de2155e98a98 100644 (file)
 
 #include <vector>
 
+namespace { class Collection; }
+typedef std::vector<libtest::Collection*> Suites;
+
+namespace libtest {
+
 class Framework {
 public:
 
 public:
   test_return_t create();
 
+  const std::string& name() const
+  {
+    return _name;
+  }
+
   void create(test_callback_create_fn* arg)
   {
     _create= arg;
@@ -62,10 +72,7 @@ public:
     _destroy= arg;
   }
 
-  void collections(collection_st* arg)
-  {
-    _collections= arg;
-  }
+  void collections(collection_st* arg);
 
   void set_on_error(test_callback_error_fn *arg)
   {
@@ -100,11 +107,10 @@ public:
 
   libtest::Collection& collection();
 
-  Framework(libtest::SignalThread&, const std::string&);
-
   virtual ~Framework();
 
   Framework(libtest::SignalThread&,
+            const std::string&,
             const std::string&,
             const std::string&);
 
@@ -150,11 +156,12 @@ public:
     return _failed;
   }
 
-private:
-  Framework& operator=(const Framework&);
-
-  collection_st *_collections;
+  Suites& suites()
+  {
+    return _collection;
+  }
 
+private:
   uint32_t _total;
   uint32_t _success;
   uint32_t _skipped;
@@ -179,8 +186,15 @@ private:
   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;
+
+private:
+  Framework( const Framework& );
+  const Framework& operator=( const Framework& );
 };
+
+} // namespace libtest