Fix warning and add warning related gcc options 39/61639/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen_3.0 tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.141807 accepted/tizen/3.0.m2/tv/20170104.142139 accepted/tizen/3.0.m2/wearable/20170104.142432 accepted/tizen/3.0/common/20161114.110008 accepted/tizen/3.0/ivi/20161011.044347 accepted/tizen/3.0/mobile/20161015.033524 accepted/tizen/3.0/tv/20161016.005025 accepted/tizen/3.0/wearable/20161015.083245 accepted/tizen/common/20160311.201051 accepted/tizen/ivi/20160310.063418 accepted/tizen/mobile/20160310.063244 accepted/tizen/tv/20160310.063326 accepted/tizen/unified/20170309.033936 accepted/tizen/wearable/20160310.063353 submit/tizen/20160310.050225 submit/tizen_3.0.m2/20170104.093751 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000003 submit/tizen_3.0_mobile/20161015.000003 submit/tizen_3.0_tv/20161015.000003 submit/tizen_3.0_wearable/20161015.000003 submit/tizen_unified/20170308.100409
authorKyungwook Tak <k.tak@samsung.com>
Wed, 9 Mar 2016 09:11:15 +0000 (18:11 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Wed, 9 Mar 2016 09:11:15 +0000 (18:11 +0900)
Change-Id: Ieccac38280db7aff3094a6ea84907e48c44d3446
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
CMakeLists.txt
test/colour_log_formatter.cc

index d030472..9805779 100644 (file)
@@ -14,6 +14,11 @@ SET(CMAKE_CXX_FLAGS_DEBUG     "-g -O0 -ggdb -Wp,-U_FORITY_SOURCE ${EXTRA_CXXFLAG
 SET(CMAKE_C_FLAGS_RELEASE     "-g -O2")
 SET(CMAKE_CXX_FLAGS_RELEASE   "-g -O2 ${EXTRA_CXXFLAGS}")
 
+# Set compiler warning flags
+ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
+ADD_DEFINITIONS("-Wall")                        # Generate all warnings
+ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
+
 SET(TARGET_CRYPTSVC ${PROJECT_NAME})
 SET(TARGET_DEVICE_INFO "device_info")
 SET(TARGET_GADGET "duid-gadget")
index 9274c49..50857a7 100644 (file)
@@ -29,24 +29,10 @@ namespace cryptsvc {
 
 namespace {
 
-const char* BOLD_GREEN_BEGIN = "\033[1;32m";
-const char* BOLD_GREEN_END = "\033[m";
-const char* RED_BEGIN = "\033[0;31m";
-const char* RED_END = "\033[m";
-const char* PURPLE_BEGIN = "\033[0;35m";
-const char* PURPLE_END = "\033[m";
-const char* GREEN_BEGIN = "\033[0;32m";
-const char* GREEN_END = "\033[m";
-const char* CYAN_BEGIN = "\033[0;36m";
-const char* CYAN_END = "\033[m";
-const char* BOLD_RED_BEGIN = "\033[1;31m";
-const char* BOLD_RED_END = "\033[m";
-const char* BOLD_YELLOW_BEGIN = "\033[1;33m";
-const char* BOLD_YELLOW_END = "\033[m";
-const char* BOLD_GOLD_BEGIN = "\033[0;33m";
-const char* BOLD_GOLD_END = "\033[m";
-const char* BOLD_WHITE_BEGIN = "\033[1;37m";
-const char* BOLD_WHITE_END = "\033[m";
+const char* COLOR_RED = "\033[0;31m";
+const char* COLOR_GREEN = "\033[0;32m";
+const char* COLOR_CYAN = "\033[0;36m";
+const char* COLOR_BOLD_YELLOW = "\033[1;33m";
 const char* COLOR_END = "\033[m";
 
 const_string
@@ -128,16 +114,16 @@ colour_log_formatter::test_unit_finish(
         output << "Finished test " << tu.p_type_name << " \"" << tu.p_name << "\""<< std::endl;
         return;
     }
-    std::string color = GREEN_BEGIN;
+    std::string color = COLOR_GREEN;
     std::string status = "OK";
     if (m_isTestCaseFailed) {
-        color = RED_BEGIN;
+        color = COLOR_RED;
         status = "FAIL";
     }
     output << "\t" << "[   " << color << status << COLOR_END << "   ]";
 
 
-    output << ", " << CYAN_BEGIN << "time: ";
+    output << ", " << COLOR_CYAN << "time: ";
     if( elapsed > 0 ) {
         if( elapsed % 1000 == 0 )
             output << elapsed/1000 << "ms";
@@ -170,7 +156,7 @@ colour_log_formatter::log_exception(
         boost::execution_exception const& ex )
 {
     boost::execution_exception::location const& loc = ex.where();
-    output << '\t' << BOLD_YELLOW_BEGIN << get_basename(loc.m_file_name)
+    output << '\t' << COLOR_BOLD_YELLOW << get_basename(loc.m_file_name)
             << '(' << loc.m_line_num << "), ";
 
     output << "fatal error in \""
@@ -210,13 +196,13 @@ colour_log_formatter::log_entry_start(
             output << "warning in \"" << test_phase_identifier() << "\": ";
             break;
         case BOOST_UTL_ET_ERROR:
-            output << '\t' << BOLD_YELLOW_BEGIN <<  get_basename(entry_data.m_file_name)
+            output << '\t' << COLOR_BOLD_YELLOW <<  get_basename(entry_data.m_file_name)
                 << '(' << entry_data.m_line_num << "), ";
             output << "error in \"" << test_phase_identifier() << "\": ";
             m_isTestCaseFailed = true;
             break;
         case BOOST_UTL_ET_FATAL_ERROR:
-            output << '\t' << BOLD_YELLOW_BEGIN <<  get_basename(entry_data.m_file_name)
+            output << '\t' << COLOR_BOLD_YELLOW <<  get_basename(entry_data.m_file_name)
                 << '(' << entry_data.m_line_num << "),  ";
             output <<  " fatal error in \"" << test_phase_identifier() << "\": ";
             m_isTestCaseFailed = true;