sptest_env = env.Clone()
src_dir = sptest_env.get('SRC_DIR')
+target_os = env.get('TARGET_OS')
######################################################################
# Build flags
'gtest_main'])
if env.get('SECURED') == '1':
+ sptest_env.AppendUnique(LIBS = ['timer'])
sptest_env.AppendUnique(LIBS = ['tinydtls'])
if env.get('DTLS_WITH_X509') == '1':
sptest_env.AppendUnique(LIBS = ['CKManager'])
if not env.get('RELEASE'):
sptest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+if target_os in ['msys_nt', 'windows']:
+ sptest_env.AppendUnique(LINKFLAGS = ['/subsystem:CONSOLE'])
+ sptest_env.AppendUnique(LIBS = ['ws2_32',
+ 'advapi32',
+ 'iphlpapi'])
+
######################################################################
# Source files and Targets
######################################################################
env.AppendTarget('test')
if env.get('TEST') == '1':
- target_os = env.get('TARGET_OS')
if target_os == 'linux':
out_dir = env.get('BUILD_DIR')
result_dir = env.get('BUILD_DIR') + '/test_out/'
os.makedirs(result_dir)
sptest_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
sptest_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
+ sptest_env.AppendENVPath('PATH', env.get('BUILD_DIR'))
sptest_env.AppendENVPath('LD_LIBRARY_PATH', ['./extlibs/gtest/gtest-1.7.0/lib/.libs'])
ut = sptest_env.Command ('ut', None, out_dir + '/resource/csdk/security/provisioning/unittest/unittest')
AlwaysBuild ('ut')
# Build Security Resource Manager unit tests
SConscript('csdk/security/unittest/SConscript')
+ # Build Provisioning API unit test
+ if env.get('SECURED') == '1':
+ SConscript('csdk/security/provisioning/unittest/SConscript')
+
elif target_os in ['darwin', 'msys_nt']:
# Verify that 'google unit test' library is installed. If not,
# get it and install it
%DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
%DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
%DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
+ %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
) else if "!CURRENT_ARG!"=="build" (
echo Starting IoTivity build with these options:
echo TARGET_OS=%TARGET_OS%