Enable code coverage generation for Proxy
authorAbhishek Sharma <ce.abhishek@samsung.com>
Mon, 24 Apr 2017 07:42:38 +0000 (13:12 +0530)
committerUze Choi <uzchoi@samsung.com>
Tue, 9 May 2017 22:00:57 +0000 (22:00 +0000)
Change-Id: I4aaee3a4770e2fa644e1e4be5ae395ee575d435a
Signed-off-by: Abhishek Sharma <ce.abhishek@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19221
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/coap-http-proxy/SConscript
service/coap-http-proxy/samples/SConscript

index 80973bf..49c1480 100644 (file)
@@ -71,6 +71,13 @@ if target_os == 'android':
 # Source files and Targets
 ######################################################################
 
+# Link with gcov if building in debug mode
+if target_os in ['linux']:
+    if not env.get('RELEASE'):
+        local_env.PrependUnique(LIBS = ['gcov'])
+        local_env.AppendUnique(CXXFLAGS = ['--coverage'])
+        local_env.AppendUnique(CFLAGS = ['--coverage'])
+
 proxy_src = [
        './src/CoapHttpHandler.c',
        './src/CoapHttpMap.c',
index e062d9b..c93f5ce 100644 (file)
@@ -40,6 +40,10 @@ if target_os not in ['windows']:
 else:
     proxy_sample_app_env.PrependUnique(LIBS = ['m'])
 
+if target_os in ['linux']:
+    if not env.get('RELEASE'):
+        proxy_sample_app_env.PrependUnique(LIBS = ['gcov'])
+
 proxy_sample_app_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 proxy_sample_app_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
 proxy_sample_app_env.PrependUnique(LIBS = ['coap_http_proxy', 'oc', 'octbstack', 'curl', 'connectivity_abstraction', 'cjson', 'm'])