123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #ifndef _TEST_MANAGER_H_
- #define _TEST_MANAGER_H_
- #include "TestBase.h"
- #include <vector>
- #include <string>
- #include "linux/msm_ipa.h"
- #ifdef HAVE_LIBXML
- #include <libxml/parser.h>
- #include <libxml/tree.h>
- #endif
- using namespace std;
- class TestsXMLResult
- {
- public:
- TestsXMLResult();
- ~TestsXMLResult();
- void AddTestcase(const string &suite_nm, const string &test_nm,
- double runtime, bool pass);
- void GenerateXMLReport(void);
- private:
- #ifdef HAVE_LIBXML
- xmlNodePtr GetSuiteElement(const string& suite_name);
- xmlDocPtr m_XML_doc_ptr;
- #endif
- };
- class TestManager /* Singleton */
- {
- public:
- static TestManager *GetInstance(
- const char* nat_mem_type_ptr = DFLT_NAT_MEM_TYPE);
- ~TestManager();
- void Register(TestBase & test);
- bool Setup();
-
- bool Run(vector <string> testSuiteList,
- vector <string> testNameList);
-
- bool Teardown();
-
- vector < TestBase * > m_testList;
-
- enum ipa_hw_type GetIPAHwType() {return m_IPAHwType;}
- const char* GetMemType() { return m_nat_mem_type_ptr; }
- private:
- TestManager(
- const char* nat_mem_type_ptr = DFLT_NAT_MEM_TYPE);
- TestManager(TestManager const &);
- TestManager & operator = (TestManager const &);
- void PrintSeparator(size_t len);
- void PrintRegisteredTests();
- void BuildRegressionTestSuite();
- void FetchIPAHwType();
- static TestManager *m_instance;
- size_t m_numTestsRun;
- size_t m_numTestsFailed;
- enum ipa_hw_type m_IPAHwType;
- const char* m_nat_mem_type_ptr;
- vector < string > m_failedTestsNames;
- };
- #endif
|