replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / unittest / SConscript
index e8dc524..1b5cd5f 100644 (file)
@@ -20,6 +20,7 @@
 
 import os
 import os.path
+from tools.scons.RunTest import run_test
 
 # SConscript file for Local PKI google tests
 gtest_env = SConscript('#extlibs/gtest/SConscript')
@@ -51,14 +52,12 @@ sptest_env.PrependUnique(CPPPATH = [
                '../../../security/provisioning/include/internal',
                '../../../../oc_logger/include',
                '../include/oxm',
-               '../../../../../extlibs/tinydtls',
                '../../../../../extlibs/cjson',
                '../../../../../extlibs/base64',
                '../../../connectivity/inc',
                '../../../connectivity/inc/pkix',
                '../../../connectivity/common/inc',
-               '../../../connectivity/api',
-               '../../../../../extlibs/tinydtls'
+               '../../../connectivity/api'
                ])
 sptest_env.AppendUnique(LIBPATH = [sptest_env.get('BUILD_DIR')])
 sptest_env.PrependUnique(LIBS = [   'ocpmapi',
@@ -70,13 +69,12 @@ sptest_env.PrependUnique(LIBS = [   'ocpmapi',
 
 if sptest_env.get('SECURED') == '1':
     sptest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
-    sptest_env.AppendUnique(LIBS = ['tinydtls'])
 
 if not sptest_env.get('RELEASE'):
        sptest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
 
 if sptest_env.get('MULTIPLE_OWNER') == '1':
-       sptest_env.AppendUnique(CPPDEFINES=['_ENABLE_MULTIPLE_OWNER_'])
+       sptest_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
 
 if target_os in ['msys_nt', 'windows']:
     sptest_env.AppendUnique(LINKFLAGS = ['/subsystem:CONSOLE'])
@@ -111,8 +109,9 @@ if target_os not in ['windows']:
 Alias("test", [unittest])
 
 sptest_env.AppendTarget('test')
+# TODO: fix this test on linux and remove this comment line
 if sptest_env.get('TEST') == '1':
-       if target_os in ['linux', 'windows']:
+       if target_os in ['windows']:
                out_dir = sptest_env.get('BUILD_DIR')
                result_dir = os.path.join(sptest_env.get('BUILD_DIR'), 'test_out') + os.sep
                if not os.path.isdir(result_dir):
@@ -120,6 +119,6 @@ if sptest_env.get('TEST') == '1':
                sptest_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
                sptest_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
                sptest_env.AppendENVPath('PATH', sptest_env.get('BUILD_DIR'))
-               ut = sptest_env.Command ('ut', None, out_dir + '/resource/csdk/security/provisioning/unittest/unittest')
-               AlwaysBuild ('ut')
-
+               run_test(sptest_env,
+                                'resource_csdk_security_provisioning_unittest.memcheck',
+                                'resource/csdk/security/provisioning/unittest/unittest')