env.AppendUnique(CCFLAGS = ['/MD', '/O2', '/GF'])
env.AppendUnique(CPPDEFINES = ['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['/MDd', '/Od', '/Zi', '/RTC1', '/Gm'])
+ env.AppendUnique(CCFLAGS = ['/MDd', '/Od', '/RTC1'])
env.AppendUnique(LINKFLAGS = ['/debug'])
env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
env.AppendUnique(PATH = os.environ['PATH'])
+ env['PDB'] = '${TARGET.base}.pdb'
+ env.Append(LINKFLAGS=['/PDB:${TARGET.base}.pdb'])
# Add Windows-specific libraries
env.AppendUnique(LIBS = ['bcrypt', 'ws2_32', 'advapi32', 'iphlpapi', 'crypt32', 'kernel32'])
from tools.scons.RunTest import *
run_test(unittests_env,
'plugins_unittests.memcheck',
- 'plugins/unittests/piunittests')
+ 'plugins/unittests/piunittests',
+ piunittests)
if target_os in ['linux']:
run_test(rd_test_env,
'resource_csdk_resource-directory_unittests_rdtests.memcheck',
- 'resource/csdk/resource-directory/unittests/rdtests')
+ 'resource/csdk/resource-directory/unittests/rdtests',
+ rd_client_test)
provisiontests_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
run_test(provisiontests_env,
'resource/provisioning/unittests/provisiontests.memcheck',
- 'resource/provisioning/unittests/provisiontests')
+ 'resource/provisioning/unittests/provisiontests',
+ unittests)
src_dir = provisiontests_env.get('SRC_DIR')
svr_db_src_dir = src_dir + '/resource/provisioning/examples/'
if target_os in ['linux', 'windows']:
run_test(unittests_env,
'resource_unittests_unittests.memcheck',
- 'resource/unittests/unittests')
+ 'resource/unittests/unittests',
+ unittests)
src_dir = unittests_env.get('SRC_DIR')
svr_db_src_dir = os.path.join(src_dir, 'resource/examples/')
set RELEASE=0
)
+set THREAD_COUNT=%NUMBER_OF_PROCESSORS%
set SECURED=1
set ROUTING=EP
set WITH_TCP=1
SET TARGET_ARCH=%2
SHIFT
)
+ IF "%1"=="-threads" (
+ SET THREAD_COUNT=%2
+ SHIFT
+ )
IF "%1"=="-noTest" (
SET TEST=0
)
set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
)
-set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% RELEASE=%RELEASE% WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=%WITH_TCP% BUILD_SAMPLE=ON LOGGING=%LOGGING% TEST=%TEST% RD_MODE=CLIENT ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP% MULTIPLE_OWNER=%MULTIPLE_OWNER%
+set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% RELEASE=%RELEASE% WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=%WITH_TCP% BUILD_SAMPLE=ON LOGGING=%LOGGING% TEST=%TEST% RD_MODE=CLIENT ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP% MULTIPLE_OWNER=%MULTIPLE_OWNER% -j %THREAD_COUNT%
REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
echo WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
echo MULTIPLE_OWNER=%MULTIPLE_OWNER%
echo MSVC_VERSION=%MSVC_VERSION%
+ echo THREAD_COUNT=%THREAD_COUNT%
echo.scons VERBOSE=1 %BUILD_OPTIONS%
scons VERBOSE=1 %BUILD_OPTIONS%
) else if "!RUN_ARG!"=="clean" (
echo.
echo. Default build parameters can be overridden using the following arguments
echo.
-echo -arch [x86 ^| amd64] - Build either amd64 or x86 architecture binaries
+echo -arch [x86 ^| amd64] - Build either amd64 or x86 architecture binaries
echo.
-echo -noTest - Don't run the unittests after building the binaries
+echo -noTest - Don't run the unittests after building the binaries
echo.
-echo -logging - Enable logging while building the binaries
+echo -logging - Enable logging while building the binaries
echo.
-echo -debugger - Debug the requested application
+echo -debugger - Debug the requested application
echo.
-echo -release - Build release binaries
+echo -release - Build release binaries
+echo.
+echo -threads [NUMBER_OF_THREADS] - Build in parallel using [NUMBER_OF_THREADS] threads. Default: %NUMBER_OF_PROCESSORS%.
echo.
echo. Usage examples:
echo Launch SimpleClient with debugger:
echo Build amd64 release binaries with logging enabled:
echo %0 build -arch amd64 -release -logging
echo.
+echo Build using only one thread:
+echo %0 build -threads 1
+echo.
echo Run all tests:
echo %0 test
echo.
if target_os in []:
run_test(easysetup_enrollee_test_env,
'service_easy-setup_enrollee_unittests_easysetup_enrollee_test.memcheck',
- 'service/easy-setup/enrollee/unittests/easysetup_enrollee_test')
+ 'service/easy-setup/enrollee/unittests/easysetup_enrollee_test',
+ easysetup_enrollee_test)
run_test(easysetup_mediator_test_env,
# 'service_easy-setup_mediator_richsdk_unittests_easysetup_mediator_test.memcheck',
'',
- 'service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test')
+ 'service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test',
+ easysetup_mediator_test)
'',
# 'service_notification_cpp-wrapper_unittest_notification_consumer_wrapper_test.memcheck',
- 'service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test')
+ 'service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test',
+ notification_consumer_wrapper_test)
run_test(notification_provider_wrapper_test_env,
'',
# 'service_notification_cpp-wrapper_unittest_notification_provider_wrapper_test.memcheck',
- 'service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test')
+ 'service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test',
+ notification_provider_wrapper_test)
run_test(notification_consumer_test_env,
# 'service_notification_unittest_notification_consumer_test.memcheck',
'',
- 'service/notification/unittest/notification_consumer_test')
+ 'service/notification/unittest/notification_consumer_test',
+ notification_consumer_test)
run_test(notification_provider_test_env,
# 'service_notification_unittest_notification_provider_test.memcheck',
'',
- 'service/notification/unittest/notification_provider_test')
+ 'service/notification/unittest/notification_provider_test',
+ notification_provider_test)
run_test(container_gtest_env,
# 'service_resource-container_unittests_container_test.memcheck',
'',
- 'service/resource-container/unittests/container_test')
+ 'service/resource-container/unittests/container_test',
+ container_test)
run_test(rcs_common_test_env,
# 'service_resource-encapsulation_src_common_rcs_common_test.memcheck',
'',
- 'service/resource-encapsulation/src/common/rcs_common_test')
+ 'service/resource-encapsulation/src/common/rcs_common_test',
+ rcs_common_test)
# TODO: fix this test on linux and remove commented lines
# 'service_resource-encapsulation_src_resourceBroker_unittest_broker_test.memcheck',
'',
- 'service/resource-encapsulation/src/resourceBroker/unittest/broker_test')
+ 'service/resource-encapsulation/src/resourceBroker/unittest/broker_test',
+ broker_test)
from tools.scons.RunTest import run_test
run_test(cache_test_env,
'service_resource-encapsulation_src_resourceCache_unittests_cache_test.memtest',
- 'service/resource-encapsulation/src/resourceCache/unittests/cache_test')
+ 'service/resource-encapsulation/src/resourceCache/unittests/cache_test',
+ cache_test)
# TODO: fix this test on linux and remove commented lines
'',
# 'service_resource-encapsulation_src_serverBuilder_rcs_server_test.memcheck',
- 'service/resource-encapsulation/src/serverBuilder/rcs_server_test')
+ 'service/resource-encapsulation/src/serverBuilder/rcs_server_test',
+ server_builder_test)
run_test(rcs_test_env,
# 'service_resource-encapsulation_unittests_rcs_client_test.memcheck',
'',
- 'service/resource-encapsulation/unittests/rcs_client_test')
+ 'service/resource-encapsulation/unittests/rcs_client_test',
+ rcs_client_test)
# from tools.scons.RunTest import *
# run_test(scene_test_env,
# '',
-# 'service/scene-manager/unittest/scene_test')
+# 'service/scene-manager/unittest/scene_test',
+# remote_scene_action_test)
import os
-def run_test(env, xml_file, test):
+def run_test(env, xml_file, test, test_targets = ['test']):
"""
Run test with the given SCons Environment, dumping Valgrind
results to the given XML file. If no Valgrind run is desired
if env.get('TARGET_OS') in ['linux']:
env.Depends('ut' + test , os.path.join(build_dir, test))
ut = env.Command('ut' + test, None, test_cmd)
- env.AlwaysBuild('ut' + test)
+ env.Depends(ut, test_targets)
+ env.AlwaysBuild(ut)