import os
import os.path
+from tools.scons.RunTest import *
+
+Import('test_env')
# SConscript file for Local PKI google tests
-gtest_env = SConscript('#extlibs/gtest/SConscript')
-srmtest_env = gtest_env.Clone()
+srmtest_env = test_env.Clone()
src_dir = srmtest_env.get('SRC_DIR')
target_os = srmtest_env.get('TARGET_OS')
+rd_mode = srmtest_env.get('RD_MODE')
######################################################################
# Build flags
######################################################################
+with_upstream_libcoap = srmtest_env.get('WITH_UPSTREAM_LIBCOAP')
+if with_upstream_libcoap == '1':
+ # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded.
+ srmtest_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
+else:
+ # For bring up purposes only, the forked version will live here.
+ srmtest_env.AppendUnique(CPPPATH = ['../../connectivity/lib/libcoap-4.1.1/include'])
+
srmtest_env.PrependUnique(CPPPATH = [
'../../../c_common/oic_malloc/include',
'../../connectivity/inc',
+ '../../connectivity/inc/pkix',
'../../connectivity/api',
'../../connectivity/external/inc',
- '../../connectivity/lib/libcoap-4.1.1',
'../include/internal',
'../../logger/include',
'../../stack/include',
'../../stack/include/internal',
'../../../oc_logger/include',
- '../../../../extlibs/cjson/',
'../provisioning/include',
'../include'
])
srmtest_env.AppendUnique(LIBPATH = [srmtest_env.get('BUILD_DIR')])
srmtest_env.PrependUnique(LIBS = ['ocsrm',
- 'octbstack',
+ 'octbstack_test',
'oc_logger',
'connectivity_abstraction',
'coap'])
if srmtest_env.get('SECURED') == '1':
- srmtest_env.AppendUnique(LIBS = ['tinydtls', 'timer'])
+ srmtest_env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto'])
+ srmtest_env.AppendUnique(LIBS = ['tinydtls'])
if srmtest_env.get('LOGGING') == '1':
srmtest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+if srmtest_env.get('MULTIPLE_OWNER') == '1':
+ srmtest_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
+
if target_os == 'windows':
srmtest_env.AppendUnique(LINKFLAGS = ['/subsystem:CONSOLE'])
- srmtest_env.AppendUnique(LIBS = ['advapi32', 'kernel32', 'ws2_32', 'iphlpapi'])
+ srmtest_env.AppendUnique(LIBS = ['octbstack_static'])
else:
# TODO: Implement feature check.
srmtest_env.AppendUnique(CPPDEFINES = ['HAVE_LOCALTIME_R'])
+ srmtest_env.AppendUnique(LIBS = ['octbstack'])
+
+if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
+ srmtest_env.PrependUnique(LIBS = ['resource_directory'])
######################################################################
# Source files and Targets
'srmutility.cpp',
'iotvticalendartest.cpp',
'base64tests.cpp',
+ 'pbkdf2tests.cpp',
'svcresourcetest.cpp',
'srmtestcommon.cpp',
'directpairingtest.cpp',
unittest_src_dir + 'oic_svr_db_prov.dat'))
srmtest_env.Alias("install", srmtest_env.Install( unittest_build_dir,
unittest_src_dir + 'oic_svr_db.dat'))
-
+
srmtest_env.AppendTarget('test')
if srmtest_env.get('TEST') == '1':
if target_os in ['linux', 'windows']:
os.makedirs(result_dir)
srmtest_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
srmtest_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
- srmtest_env.AppendENVPath('PATH', [os.path.join(out_dir, 'resource', 'csdk')])
- from tools.scons.RunTest import *
run_test(srmtest_env,'ut','resource/csdk/security/unittest/unittest')