X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fcollection.h;h=91c76a6d7f9084558a892f2c3779855af2c51471;hb=38c7c4e5444881eee8f76c6050e146c137c3781e;hp=044acf036b4db7c6fca3d5494f5f6992117c1ab5;hpb=a1f2b0b98e03369ed051b232f1fc33ed1d611b16;p=m6w6%2Flibmemcached diff --git a/libtest/collection.h b/libtest/collection.h index 044acf03..91c76a6d 100644 --- a/libtest/collection.h +++ b/libtest/collection.h @@ -36,6 +36,10 @@ #pragma once +#include + +class Framework; + /** A structure which describes a collection of test cases. */ @@ -46,4 +50,50 @@ struct collection_st { struct test_st *tests; }; +namespace libtest { + +class Collection { +public: + Collection(Framework*, collection_st*); + + test_return_t exec(); + + const char* name() + { + return _name; + } + + uint32_t success() + { + return _success; + } + + uint32_t skipped() + { + return _skipped; + } + + uint32_t failed() + { + return _failed; + } + + uint32_t total() + { + return _total; + } + +private: + const char *_name; + test_callback_fn *_pre; + test_callback_fn *_post; + struct test_st *_tests; + Framework* _frame; + uint32_t _success; + uint32_t _skipped; + uint32_t _failed; + uint32_t _total; + libtest::Timer _timer; +}; +} // namespace libtest