Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class test_suite

Boost , Boost.Test , Header <boost/test/tree/test_unit.hpp>

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class test_suite

boost::unit_test::test_suite — Class representing test suites.

Synopsis

// In header: <boost/test/tree/test_unit.hpp>

class test_suite : public boost::unit_test::test_unit {
public:
  // types
  typedef std::vector< test_unit_id >                                  id_list;       
  typedef std::vector< test_unit_fixture_ptr >                         fixture_list_t;
  typedef std::vector< decorator::base_ptr >                           decor_list_t;  
  typedef boost::function< test_tools::assertion_result(test_unit_id)> precondition_t;
  enum @2 { type = = TUT_SUITE };
  enum @0 { type = = TUT_ANY };
  enum run_status { RS_DISABLED, RS_ENABLED, RS_INHERIT, RS_INVALID };
  // construct/copy/destruct
  explicit test_suite(const_string, const_string, std::size_t);
  explicit test_suite(const_string);
  ~test_suite();
  // public member functions
  void add(test_unit *, counter_t = 0, unsigned = 0);
  void add(test_unit_generator const &, unsigned = 0);
  void add(test_unit_generator const &, decorator::collector &);
  void remove(test_unit_id);
  test_unit_id get(const_string) const;
  std::size_t size() const;
  typedef BOOST_READONLY_PROPERTY(test_unit_id, (framework::state));
  typedef BOOST_READONLY_PROPERTY(test_unit_id, (test_suite));
  typedef BOOST_READONLY_PROPERTY(id_list, (test_unit));
  typedef BOOST_READONLY_PROPERTY(std::vector< std::string >, (test_unit));
  typedef BOOST_READONLY_PROPERTY(std::vector< precondition_t >, (test_unit));
  void depends_on(test_unit *);
  void add_precondition(precondition_t const &);
  test_tools::assertion_result check_preconditions() const;
  void add_label(const_string);
  bool has_label(const_string) const;
  void increase_exp_fail(counter_t);
  bool is_enabled() const;
  std::string full_name() const;
  // public data members
  test_unit_type const p_type;  // type for this test unit 
  const_string const p_type_name;  // "case"/"suite"/"module" 
  const_string const p_file_name;
  std::size_t const p_line_num;
  id_t p_id;  // unique id for this test unit 
  parent_id_t p_parent_id;  // parent test suite id 
  label_list_t p_labels;  // list of labels associated with this test unit 
  id_list_t p_dependencies;  // list of test units this one depends on 
  precond_list_t p_preconditions;  // user supplied preconditions for this test unit; 
  readwrite_property< std::string > p_name;  // name for this test unit 
  readwrite_property< std::string > p_description;  // description for this test unit 
  readwrite_property< unsigned > p_timeout;  // timeout for the test unit execution in seconds 
  readwrite_property< counter_t > p_expected_failures;  // number of expected failures in this test unit 
  readwrite_property< run_status > p_default_status;  // run status obtained by this unit during setup phase 
  readwrite_property< run_status > p_run_status;  // run status assigned to this unit before execution phase after applying all filters 
  readwrite_property< counter_t > p_sibling_rank;  // rank of this test unit amoung siblings of the same parent 
  readwrite_property< decor_list_t > p_decorators;  // automatically assigned decorators; execution is delayed till framework::finalize_setup_phase function 
  readwrite_property< fixture_list_t > p_fixtures;  // fixtures associated with this test unit 
};

Description

test_suite public construct/copy/destruct

  1. <
    explicittest_suite(const_stringts_name,const_stringts_file,
                       std::size_tts_line);
    >
  2. <
    explicittest_suite(const_stringmodule_name);
    >
  3. <
    ~test_suite();
    >

test_suite public member functions

  1. <
    voidadd(test_unit*tu,counter_texpected_failures=0,
            unsignedtimeout=0);
    >Добавляет тестовый блок в тестовый набор.

    Можно указать тайм-аут и ожидаемые сбои.

  2. <
    voidadd(test_unit_generatorconst&gen,unsignedtimeout=0);
    >

    Это перегруженная функция члена, предусмотренная для удобства. Он отличается от вышеуказанной функции только тем, какие аргументы он принимает.

  3. <
    voidadd(test_unit_generatorconst&gen,decorator::collector&decorators);
    >

    Это перегруженная функция члена, предусмотренная для удобства. Он отличается от вышеуказанной функции только тем, какие аргументы он принимает.

  4. <
    voidremove(test_unit_idid);
    >Удалить тест из набора тестов.
  5. <
    test_unit_idget(const_stringtu_name)const;
    >
  6. <
    std::size_tsize()const;
    >
  7. <
    typedefBOOST_READONLY_PROPERTY(test_unit_id,(framework::state));
    >
  8. <
    typedefBOOST_READONLY_PROPERTY(test_unit_id,(test_suite));
    >
  9. <
    typedefBOOST_READONLY_PROPERTY(id_list,(test_unit));
    >
  10. <
    typedefBOOST_READONLY_PROPERTY(std::vector<std::string>,(test_unit));
    >
  11. <
    typedefBOOST_READONLY_PROPERTY(std::vector<precondition_t>,(test_unit));
    >
  12. <
    voiddepends_on(test_unit*tu);
    >
  13. <
    voidadd_precondition(precondition_tconst&);
    >
  14. <
    test_tools::assertion_resultcheck_preconditions()const;
    >
  15. <
    voidadd_label(const_stringl);
    >
  16. <
    boolhas_label(const_stringl)const;
    >
  17. <
    voidincrease_exp_fail(counter_tnum);
    >
  18. <
    boolis_enabled()const;
    >
  19. <
    std::stringfull_name()const;
    >

PrevUpHomeNext

Статья Class test_suite раздела Boost.Test Header <boost/test/tree/test_unit.hpp> может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Header <boost/test/tree/test_unit.hpp> ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 21:09:05/0.0092830657958984/1