Adjustment needed for performance tests in wrt-commons 23/18823/5
authorJanusz Kozerski <j.kozerski@samsung.com>
Tue, 1 Apr 2014 13:02:02 +0000 (15:02 +0200)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Mon, 14 Apr 2014 12:39:49 +0000 (05:39 -0700)
The change "Add summary view to all security tests" colids with DPL
performance test in wrt-commons (commit: Add RUNNER_PERF_TEST_BEGIN()
and RUNNER_PERF_TEST_END() macros for performance tests). Without
this patch a build-break in security-test will occur after applying
performance tests feature to wrt-commons repository.
This patch fix the build break - security-tests can be build with
and without performance test in wrt-commons.

Verify:
    Build wrt-commons with patch "Add RUNNER_PERF_TEST_BEGIN()
and RUNNER_PERF_TEST_END() macros for performance tests". Then build
security-tests. Run all tests - there should be no changes in test
results.

Change-Id: If49834dcdd5396434a782e936d9906035b02fd32
Signed-off-by: Janusz Kozerski <j.kozerski@samsung.com>
tests/common/summary_collector.cpp
tests/common/summary_collector.h

index b4d69aca50f28798572e7c3d7c7d7f6f68249b94..229b0737bb42941a82a44aabe657b12c3caa6e5d 100644 (file)
@@ -56,6 +56,26 @@ void SummaryCollector::Finish()
     outputFile.close();
 }
 
+void SummaryCollector::CollectResult(const std::string& /*id*/,
+                                      const std::string& /*description*/,
+                                      const FailStatus::Type status,
+                                      const std::string& /*reason = ""*/,
+                                      const bool& isPerformanceTest,
+                                      const std::chrono::system_clock::duration& performanceTime,
+                                      const std::chrono::system_clock::duration& performanceMaxTime)
+{
+    (void)isPerformanceTest;
+    (void)performanceTime;
+    (void)performanceMaxTime;
+    switch (status) {
+        case FailStatus::IGNORED: ++m_ignored; break;
+        case FailStatus::INTERNAL: // internal error count as fail
+        case FailStatus::FAILED: ++m_failed; break;
+        case FailStatus::NONE: ++m_succeeded; break;
+    };
+    ++m_total;
+}
+
 void SummaryCollector::CollectResult(const std::string& /*id*/,
                                       const std::string& /*description*/,
                                       const FailStatus::Type status,
index 3a1cdf98ba336927c28beecd441313b8073de7fa..3f2eb3cf852b8e8a033dfdb5785a341bf26df179 100644 (file)
@@ -25,6 +25,7 @@
 #define _RAW_RESULTS_COLLECTOR_H_
 
 #include <dpl/test/test_results_collector.h>
+#include <chrono>
 
 /*
  * Custom test runner results collector. The results (total test cases, failed, etc.) are
@@ -42,6 +43,15 @@ class SummaryCollector : public DPL::Test::TestResultsCollectorBase
                        const std::string& /*description*/,
                        const FailStatus::Type status,
                        const std::string& /*reason = ""*/);
+    void CollectResult(const std::string& /*id*/,
+                       const std::string& /*description*/,
+                       const FailStatus::Type status,
+                       const std::string& /*reason = ""*/,
+                       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());
 
 public:
     static TestResultsCollectorBase* Constructor();