X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fcollection.h;h=bc879e3091d79f94592613b6c049c6c5f859b2f6;hb=f47caf2833675cce0b62a6e4ffd6764c1490a8b4;hp=044acf036b4db7c6fca3d5494f5f6992117c1ab5;hpb=47f45992107361ad58c170bdf78fdc92523fab06;p=m6w6%2Flibmemcached diff --git a/libtest/collection.h b/libtest/collection.h index 044acf03..bc879e30 100644 --- a/libtest/collection.h +++ b/libtest/collection.h @@ -36,6 +36,13 @@ #pragma once +#include + +#include + +namespace { class Framework; } + + /** A structure which describes a collection of test cases. */ @@ -46,4 +53,56 @@ struct collection_st { struct test_st *tests; }; +namespace libtest { + +class Collection { +public: + Collection(libtest::Framework*, collection_st*); + + test_return_t exec(); + + const char* name() + { + return _name.c_str(); + } + + uint32_t success() + { + return _success; + } + + uint32_t skipped() + { + return _skipped; + } + + uint32_t failed() + { + return _failed; + } + + uint32_t total() + { + return _total; + } + + libtest::Formatter* formatter() + { + return &_formatter; + } + +private: + std::string _name; + test_callback_fn *_pre; + test_callback_fn *_post; + struct test_st *_tests; + libtest::Framework* _frame; + uint32_t _success; + uint32_t _skipped; + uint32_t _failed; + uint32_t _total; + libtest::Timer _timer; + libtest::Formatter _formatter; +}; +} // namespace libtest