tizen 2.4 release
[framework/web/wrt-commons.git] / modules / test / src / test_runner.cpp
similarity index 97%
rename from modules_wearable/test/src/test_runner.cpp
rename to modules/test/src/test_runner.cpp
index aaac7af..483720f 100644 (file)
 #include <dpl/test/test_runner.h>
 #include <dpl/test/test_results_collector.h>
 #include <dpl/exception.h>
-#include <dpl/scoped_free.h>
+#include <dpl/free_deleter.h>
+#include <memory>
 #include <dpl/foreach.h>
-#include <dpl/log/log.h>
+#include <dpl/log/wrt_log.h>
 #include <dpl/colors.h>
 #include <pcrecpp.h>
 #include <algorithm>
@@ -65,11 +66,11 @@ namespace // anonymous
 {
 std::string BaseName(std::string aPath)
 {
-    ScopedFree<char> path(strdup(aPath.c_str()));
-    if (NULL == path.Get()) {
+    std::unique_ptr<char[],free_deleter> path(strdup(aPath.c_str()));
+    if (NULL == path.get()) {
         throw std::bad_alloc();
     }
-    char* baseName = basename(path.Get());
+    char* baseName = basename(path.get());
     std::string retValue = baseName;
     return retValue;
 }
@@ -188,14 +189,14 @@ bool TestRunner::filterGroupsByXmls(const std::vector<std::string> & files)
             }
             xmlNodeSetPtr nodes = xpathObject->nodesetval;
             unsigned size = (nodes) ? nodes->nodeNr : 0;
-            LogDebug("Found " << size << " nodes matching xpath");
+            WrtLogD("Found %i nodes matching xpath", size);
             for(unsigned i = 0; i < size; ++i)
             {
-                LogPedantic("Type: " << nodes->nodeTab[i]->type);
+                WrtLogD("Type: %i", nodes->nodeTab[i]->type);
                 if (nodes->nodeTab[i]->type == XML_ATTRIBUTE_NODE) {
                     xmlNodePtr curNode = nodes->nodeTab[i];
                     result = getXMLNode(curNode);
-                    LogPedantic("Result: " << result);
+                    WrtLogD("Result: %s", result.c_str());
                     normalizeXMLTag(result, testsuite);
                     casesMap.insert(make_pair(result, false));
                 }
@@ -208,7 +209,7 @@ bool TestRunner::filterGroupsByXmls(const std::vector<std::string> & files)
     }
     Catch(XMLError)
     {
-        LogError("Libxml error: " << _rethrown_exception.DumpToString());
+        WrtLogE("Libxml error: %s", _rethrown_exception.DumpToString().c_str());
         success = false;
     }
     xmlCleanupParser();
@@ -238,7 +239,7 @@ bool TestRunner::filterByXML(std::map<std::string, bool> & casesMap)
     {
         if(cs->second == false)
         {
-            LogError("Cannot find testcase from XML file: " << cs->first);
+            WrtLogE("Cannot find testcase from XML file: %s", cs->first.c_str());
             return false;
         }
     }