From: Lukasz Wojciechowski Date: Tue, 24 Mar 2015 19:32:02 +0000 (+0100) Subject: Merge branch 'cynara' into tizen X-Git-Tag: security-manager_5.5_testing~122^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Ftest%2Fsecurity-tests.git;a=commitdiff_plain;h=89f2ab1b5f41c27e8b08dd27b4343778a991af0a Merge branch 'cynara' into tizen Conflicts: src/framework/include/dpl/test/test_runner.h src/framework/src/test_runner.cpp Change-Id: I7186c1d1e8f60e453ea5ffe4f7cfd1e1eca3a3bb --- 89f2ab1b5f41c27e8b08dd27b4343778a991af0a diff --cc src/framework/include/dpl/test/test_runner.h index 8fb8803,53764bf..9da89df --- a/src/framework/include/dpl/test/test_runner.h +++ b/src/framework/include/dpl/test/test_runner.h @@@ -41,8 -42,9 +42,11 @@@ #include #include #include +#include + #include + #include + #include +#include #include namespace DPL { @@@ -63,12 -65,18 +67,14 @@@ class TestRunne m_currentTestCase(nullptr) , m_terminate(false) , m_allowChildLogs(false) + , m_deferDeepness(0U) + , m_firstDeferredExceptionType(DeferredExceptionType::DEFERRED_FAILED) {} - void beginPerformanceTestTime(std::chrono::system_clock::duration maxTimeInMicroseconds); - void endPerformanceTestTime(); - void getCurrentTestCasePerformanceResult(bool& isPerformanceTest, - std::chrono::system_clock::duration& result, - std::chrono::system_clock::duration& resultMax); - void setCurrentTestCasePerformanceResult(bool isPerformanceTest, - std::chrono::system_clock::duration result, - std::chrono::system_clock::duration resultMax); + void beginPerformance(std::chrono::system_clock::duration maxDurationInMicroseconds); + void endPerformance(); + void setCurrentTestCasePerformanceResult(const PerformanceResultPtr &performance); + ConstPerformanceResultPtr getCurrentTestCasePerformanceResult(); void addFailReason(const std::string &reason); @@@ -134,56 -149,15 +140,9 @@@ std::string getConcatedFailReason(const std::string &reason); - void CollectResult(const std::string& id, - const TestResultsCollectorBase::FailStatus status - = TestResultsCollectorBase::FailStatus::NONE, - const std::string& reason = std::string(), - const bool& isPerformanceTest = false, - const std::chrono::system_clock::duration& performanceTime = std::chrono::microseconds::zero(), - const std::chrono::system_clock::duration& performanceMaxTime = std::chrono::microseconds::zero()); + void CollectResult(const std::string& id, const TestResult &result); public: - class TestFailed - { - private: - std::string m_message; - - public: - TestFailed() - {} - - //! \brief Failed test message creator - //! - //! \param[in] aTest string for tested expression - //! \param[in] aFile source file name - //! \param[in] aLine source file line - //! \param[in] aMessage error message - TestFailed(const char* aTest, - const char* aFile, - int aLine, - const std::string &aMessage); - - TestFailed(const std::string &message); - - std::string GetMessage() const - { - return m_message; - } - }; - - class Ignored - { - private: - std::string m_message; - - public: - Ignored() - {} - - Ignored(const std::string &message) : - m_message(message) - {} - - std::string GetMessage() const - { - return m_message; - } - }; - void MarkAssertion(); void RegisterTest(const char *testName, TestCase proc); diff --cc src/framework/src/test_runner.cpp index b753cdd,0b4099c..726d434 --- a/src/framework/src/test_runner.cpp +++ b/src/framework/src/test_runner.cpp @@@ -243,20 -206,21 +206,21 @@@ bool TestRunner::filterByXML(std::map(testCase))); + m_deferDeepness = 0U; try { testCase.proc(); } catch (const TestFailed &e) { // Simple test failure CollectResult(testCase.name, - TestResultsCollectorBase::FailStatus::FAILED, - getConcatedFailReason(e.GetMessage())); + TestResult(TestResult::FailStatus::FAILED, + getConcatedFailReason(e.GetMessage()))); setCurrentTestCase(nullptr); - return FAILED; + return; - } catch (const Ignored &e) { + } catch (const TestIgnored &e) { if (m_runIgnored) { // Simple test have to be implemented CollectResult(testCase.name, diff --cc src/framework/src/test_runner_child.cpp index b4157ba,816316a..e2efb02 --- a/src/framework/src/test_runner_child.cpp +++ b/src/framework/src/test_runner_child.cpp @@@ -321,15 -333,19 +323,15 @@@ void RunChildProc(TestRunner::TestCase } if (pipeReturn == PipeWrapper::ERROR) { - throw TestRunner::TestFailed("Reading pipe error"); + throw TestFailed("Reading pipe error"); } - if (code == CHILD_TEST_PASS && msgType == MSG_TYPE_PERF_TIME) { - DPL::Test::TestRunnerSingleton::Instance().setCurrentTestCasePerformanceResult(true, - time_m, - timeMax_m); - } + TestRunnerSingleton::Instance().setCurrentTestCasePerformanceResult(performance); if (code == CHILD_TEST_FAIL) { - throw TestRunner::TestFailed(message); + throw TestFailed(message); } else if (code == CHILD_TEST_IGNORED) { - throw TestRunner::Ignored(message); + throw TestIgnored(message); } } else { // child code