// Copyright (c) 2006 Ole Christian Weidner (oweidner@cct.lsu.edu) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef SAGA_TEST_INIT_HPP #define SAGA_TEST_INIT_HPP #include #include #include "test_cleanup.hpp" /** * This class is used for test initialization based on a given config file. * */ class test_init { private: saga::ini::ini config_file_; test_suite * test_suite_; cleanup::suite * cleanup_handler_; /** * the main config file processing function. Parses/validates the config file * and adds the test cases to the test suite. * */ void add_adaptor_tests_(); /** * creates a simple .saga.ini file in the given directory * * @param base_dir * the directory where the config file should be created * * @return * the config file's path as string. * */ std::string create_saga_ini_file_ (std::string base_dir); /** * creates a adaptor .ini file in the given directory * * @param base_dir * the directory where the config file should be created * * @param sec * a pointer to an adaptor test config file section * * @return * the config file's path as string. */ std::string create_adaptor_ini_file_ (std::string base_dir, saga::ini::section const& sec ); /** * returns the [sec_name.properties] section of a test ini file. The * properties section for the file adaptor tests is for example called * [file_adaptor_test.properties]. If no properties section exists, NULL * is returned. * * @param sec_name * the name of the section we want to get the properties for * * @return * the corresponding section or NULL * */ saga::ini::section * get_section_custom_properties_(saga::ini::section const& base_sec); /** * checks if the provided library (adaptor) has a factory method for * creating an instance of test_helper_utils. * * @param lib_path * path to the library we want to test * * @return * TRUE if the factory exists, FALSE otherwise * */ bool lib_has_test_helper_factory_(std::string lib_path); /** * COMMENT ME ! */ saga::test::test_helper_utils * init_helper_object_(std::string lib_path); public: /** * constructor * * @param suite * a pointer to the boost test suite we want to initialize * * @param config_file_location * a string containing the path of the config file we want to use */ test_init(test_suite* suite, std::string config_file_location); /** * destructor */ ~test_init() {} }; #endif //SAGA_TEST_INIT_HPP