Build: reworked unit tests to use gtest in a more generic way sandbox/pcoval/jethro
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Thu, 12 May 2016 21:44:59 +0000 (23:44 +0200)
committerPhilippe Coval <philippe.coval@osg.samsung.com>
Wed, 1 Jun 2016 13:24:33 +0000 (15:24 +0200)
First as shared library is unused disable building it,
then scons will use the static one as default.

Also let's remove hardcoded path, as there is not warranty
that the files will be at the same place in any configurations.

Problem was observed when building on recent yocto configuration,
build also tested on Debian jessie.

If for some reason shared libs are desired, you can revert that patch,
but double check about security checks ("ld: final link failed: Bad value")

Bug-AGL: https://jira.automotivelinux.org/browse/SPEC-158
Origin: https://github.com/tizenteam/iotivity/tree/sandbox/pcoval/for/master
Change-Id: Ia13ee8c03f65f3407e88ff21d51b292261c9f2a3
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
26 files changed:
extlibs/gtest/SConscript
plugins/unittests/SConscript
resource/c_common/ocrandom/test/SConscript
resource/c_common/oic_malloc/test/SConscript
resource/c_common/oic_string/test/SConscript
resource/c_common/oic_time/test/SConscript
resource/csdk/connectivity/test/SConscript
resource/csdk/security/provisioning/ck_manager/unittest/SConscript
resource/csdk/security/provisioning/unittest/SConscript
resource/csdk/security/unittest/SConscript
resource/csdk/stack/test/SConscript
resource/provisioning/unittests/SConscript
resource/unit_tests.scons
resource/unittests/SConscript
service/easy-setup/enrollee/unittests/SConscript
service/easy-setup/mediator/csdk/unittests/SConscript
service/easy-setup/mediator/richsdk/unittests/SConscript
service/resource-container/unittests/SConscript
service/resource-encapsulation/src/common/SConscript
service/resource-encapsulation/src/resourceBroker/unittest/SConscript
service/resource-encapsulation/src/resourceCache/unittests/SConscript
service/resource-encapsulation/src/serverBuilder/SConscript
service/resource-encapsulation/unittests/SConscript
service/resource-hosting/unittest/SConscript
service/scene-manager/unittests/SConscript
service/things-manager/unittests/SConscript

index 6ecdcd1..98c173d 100644 (file)
@@ -12,8 +12,8 @@ target_os = env.get('TARGET_OS')
 src_dir = env.get('SRC_DIR')
 
 targets_need_gtest = ['darwin','linux']
-gtest_dir      = src_dir + '/extlibs/gtest/gtest-1.7.0'
-gtest_zip_file = src_dir + '/extlibs/gtest/gtest-1.7.0.zip'
+gtest_dir      = os.path.join(src_dir, 'extlibs', 'gtest', 'gtest-1.7.0')
+gtest_zip_file = os.path.join(src_dir, 'extlibs', 'gtest', 'gtest-1.7.0.zip')
 gtest_url      = 'https://googletest.googlecode.com/files/gtest-1.7.0.zip'
 
 if target_os in targets_need_gtest:
@@ -70,12 +70,14 @@ elif target_os == 'linux':
                        # Run configure on gtest
                        print 'Configuring google unit test'
                        if env.get('CROSS_COMPILE'):
-                               env.Configure(gtest_dir, './configure --host=' + env['CROSS_COMPILE'])
+                               env.Configure(gtest_dir, './configure --disable-shared --host=' + env['CROSS_COMPILE']);
                        else:
-                               env.Configure(gtest_dir, './configure')
+                               env.Configure(gtest_dir, './configure --disable-shared')
 
                        # Run make on gtest
                        print 'Making google unit test'
                        env.Configure(gtest_dir, 'make')
 
 
+env.AppendUnique(LIBPATH = [ os.path.join(gtest_dir , 'lib', '.libs')])
+env.PrependUnique(CPPPATH = [ os.path.join(gtest_dir, 'include')])
index bd225dd..b30dd64 100644 (file)
@@ -18,6 +18,8 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -31,13 +33,11 @@ build_dir = env.get('BUILD_DIR')
 ######################################################################
 unittests_env.PrependUnique(CPPPATH = [
                 os.path.join(pi_dir, 'include'),
-                '#extlibs/gtest/gtest-1.7.0/include',
                ])
 
 unittests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 unittests_env.PrependUnique(LIBS = ['-lpthread'])
 unittests_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-unittests_env.AppendUnique(LIBPATH = [os.path.join(src_dir, 'extlibs', 'gtest', 'gtest-1.7.0', 'lib', '.libs')])
 unittests_env.PrependUnique(LIBS = [
                'plugin_interface',
                'oc',
index 86e08a1..a936282 100644 (file)
@@ -18,6 +18,8 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -32,13 +34,11 @@ randomtest_env.PrependUnique(CPPPATH = [
         '../include',
                '../../logger/include',
                '../../../oc_logger/include',
-               '../../../../extlibs/gtest/gtest-1.7.0/include'
                ])
 
 randomtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 randomtest_env.AppendUnique(LIBS = ['-lpthread'])
 randomtest_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-randomtest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 randomtest_env.PrependUnique(LIBS = ['m',
                                     'octbstack',
                                     'uuid',
index 0b702ec..ca52619 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 Import('env')
 import os
@@ -28,11 +29,9 @@ src_dir = malloctest_env.get('SRC_DIR')
 # Build flags
 ######################################################################
 malloctest_env.PrependUnique(CPPPATH = [
-        '../include',
-        '#extlibs/gtest/gtest-1.7.0/include' ])
+        '../include'])
 
 malloctest_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource/c_common')])
-malloctest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 malloctest_env.PrependUnique(LIBS = ['c_common', 'gtest', 'gtest_main', 'pthread'])
 
 if env.get('LOGGING'):
index 9d30251..85474d3 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
+SConscript('#extlibs/gtest/SConscript')
 Import('env')
 import os
 
@@ -28,11 +28,9 @@ src_dir = stringtest_env.get('SRC_DIR')
 # Build flags
 ######################################################################
 stringtest_env.PrependUnique(CPPPATH = [
-        '../include',
-        '#extlibs/gtest/gtest-1.7.0/include' ])
+        '../include'])
 
 stringtest_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource/c_common')])
-stringtest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 stringtest_env.PrependUnique(LIBS = ['c_common', 'gtest', 'gtest_main', 'pthread'])
 
 if env.get('LOGGING'):
index 222b9e8..fb9cffc 100644 (file)
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
+SConscript('#extlibs/gtest/SConscript')
 
 Import('env')
 import os
@@ -30,11 +30,9 @@ src_dir = timetest_env.get('SRC_DIR')
 # Build flags
 ######################################################################
 timetest_env.PrependUnique(CPPPATH = [
-        '../include',
-        '#extlibs/gtest/gtest-1.7.0/include' ])
+        '../include'])
 
 timetest_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource/c_common')])
-timetest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 timetest_env.PrependUnique(LIBS = ['c_common', 'gtest', 'gtest_main', 'pthread'])
 timetest_env.Append(LIBS = ['rt']);
 
index 688a04f..e678f71 100644 (file)
@@ -18,6 +18,8 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -34,7 +36,6 @@ catest_env.PrependUnique(CPPPATH = [
                 '../../stack/include',
                 '../../extlibs/cjson',
                 '../../../oc_logger/include',
-                '../../../../extlibs/gtest/gtest-1.7.0/include'
                ])
 
 tmplist = catest_env['LINKFLAGS'][:]
@@ -45,7 +46,6 @@ if '-lpthread' in tmplist:
 catest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 catest_env.AppendUnique(LIBS = ['pthread'])
 catest_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-catest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 catest_env.PrependUnique(LIBS = ['m',
                                     'octbstack',
                                     'connectivity_abstraction',
index 6218806..3b8a798 100644 (file)
@@ -19,6 +19,7 @@
 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 #
 # SConscript file for Local PKI google tests
+SConscript('#extlibs/gtest/SConscript')
 
 Import('env')
 
@@ -42,7 +43,6 @@ pki_test_env.PrependUnique(CPPPATH = ['../include/',
                                '../../../../logger/include',
                                '../../../../stack/include',
                                '../../../../../oc_logger/include',
-                               '../../../../../../extlibs/gtest/gtest-1.7.0/include',
                                '../../../../../../extlibs/asn1cert',
                                '../../../../../../extlibs/tinydtls',
                                '../../../../../../extlibs/tinydtls/ecc',
@@ -51,7 +51,6 @@ pki_test_env.PrependUnique(CPPPATH = ['../include/',
 pki_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 pki_test_env.AppendUnique(LIBS = ['pthread'])
 pki_test_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-pki_test_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 
 pki_test_env.AppendUnique(LIBS = ['octbstack'])
 pki_test_env.AppendUnique(LIBS = ['CKManager'])
@@ -94,7 +93,6 @@ if env.get('TEST') == '1':
                        os.makedirs(result_dir)
                pki_test_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
                pki_test_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
-               pki_test_env.AppendENVPath('LD_LIBRARY_PATH', [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
                ut = pki_test_env.Command ('ut', None, out_dir + '/resource/csdk/security/unittest/unittest')
 AlwaysBuild ('ut')
 
index ee406d5..e65289e 100644 (file)
@@ -19,6 +19,8 @@
 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 #
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -39,14 +41,12 @@ sptest_env.PrependUnique(CPPPATH = [
                '../../../logger/include',
                '../../../stack/include',
                '../../../../oc_logger/include',
-               '../../../../../extlibs/gtest/gtest-1.7.0/include',
                '../include',
                '../include/internal'
                ])
 sptest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 sptest_env.AppendUnique(LIBS = ['-lpthread','-ldl'])
 sptest_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-sptest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 sptest_env.PrependUnique(LIBS = [   'ocpmapi',
                                     'oc',
                                     'ocsrm',
@@ -86,7 +86,6 @@ if env.get('TEST') == '1':
                        os.makedirs(result_dir)
                sptest_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
                sptest_env.AppendENVPath('LD_LIBRARY_PATH', [out_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')
 
index c431d77..eeb4021 100644 (file)
@@ -19,6 +19,8 @@
 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 #
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -42,7 +44,6 @@ srmtest_env.PrependUnique(CPPPATH = [
                '../../stack/include',
                '../../stack/include/internal',
                '../../../oc_logger/include',
-               '../../../../extlibs/gtest/gtest-1.7.0/include',
                '../../../../extlibs/cjson/',
                 '../provisioning/include',
 #              '../../../../extlibs/tinydtls/',
@@ -52,7 +53,6 @@ srmtest_env.PrependUnique(CPPPATH = [
 srmtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 srmtest_env.AppendUnique(LIBS = ['-lpthread'])
 srmtest_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-srmtest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 srmtest_env.PrependUnique(LIBS = ['ocsrm',
                                     'octbstack',
                                     'oc_logger',
@@ -115,6 +115,6 @@ if env.get('TEST') == '1':
                        os.makedirs(result_dir)
                srmtest_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
                srmtest_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
-               srmtest_env.AppendENVPath('LD_LIBRARY_PATH', ['./extlibs/gtest/gtest-1.7.0/lib/.libs'])
-               ut = srmtest_env.Command ('ut', None, out_dir + '/resource/csdk/security/unittest/unittest')
-               AlwaysBuild ('ut')
+               from tools.scons.RunTest import *
+               run_test(srmtest_env,'ut','resource/csdk/security/unittest/unittest')
+
index 507f011..006c9c7 100644 (file)
@@ -18,6 +18,8 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -39,13 +41,11 @@ stacktest_env.PrependUnique(CPPPATH = [
                '../../connectivity/external/inc',
                '../../extlibs/cjson',
                '../../../oc_logger/include',
-               '#extlibs/gtest/gtest-1.7.0/include'
                ])
 
 stacktest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 stacktest_env.AppendUnique(LIBS = ['-lpthread'])
 stacktest_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-stacktest_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 stacktest_env.PrependUnique(LIBS = ['m',
                                     'octbstack',
                                     'ocsrm',
index 3582960..aee150f 100755 (executable)
@@ -18,6 +18,8 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -43,7 +45,6 @@ provisiontests_env.PrependUnique(CPPPATH = [
                '../../csdk/ocsocket/include',
                '../../csdk/ocrandom/include',
                '../../csdk/logger/include',
-               '../../../extlibs/gtest/gtest-1.7.0/include',
                '../../../extlibs/hippomocks-master/HippoMocks',
                '../../../extlibs/hippomocks-master/HippoMocksTest'
                ])
@@ -51,7 +52,6 @@ provisiontests_env.PrependUnique(CPPPATH = [
 provisiontests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 provisiontests_env.AppendUnique(LIBS = ['-lpthread', '-ldl'])
 provisiontests_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-provisiontests_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 provisiontests_env.PrependUnique(LIBS = [
         'ocprovision',
                'oc',
@@ -101,7 +101,6 @@ if env.get('TEST') == '1':
                        os.makedirs(result_dir)
                provisiontests_env.AppendENVPath('GTEST_OUTPUT', ['xml:'+ result_dir])
                provisiontests_env.AppendENVPath('LD_LIBRARY_PATH', [out_dir])
-               provisiontests_env.AppendENVPath('LD_LIBRARY_PATH', ['./extlibs/gtest/gtest-1.7.0/lib/.libs'])
                ut = provisiontests_env.Command ('ut', None, out_dir + 'resource/provisioning/unittests/provisiontests')
                AlwaysBuild ('ut')
 
index 08a9ffb..a52cd61 100644 (file)
@@ -22,7 +22,7 @@
 # 'unit_test' script for building unit tests and libs
 #
 ##
-
+SConscript('#extlibs/gtest/SConscript')
 Import('env')
 
 target_os = env.get('TARGET_OS')
@@ -30,10 +30,6 @@ src_dir = env.get('SRC_DIR')
 build_dir = env.get('BUILD_DIR')
 
 if target_os == 'linux':
-       # Verify that 'google unit test' library is installed.  If not,
-       # get it and install it
-       SConscript(src_dir + '/extlibs/gtest/SConscript')
-
        # Verify that 'hippomocks' mocking code is installed.  If not,
        # get it and install it
        SConscript(src_dir + '/extlibs/hippomocks.scons')
@@ -61,10 +57,6 @@ if target_os == 'linux':
                SConscript('provisioning/unittests/SConscript')
 
 elif target_os == 'darwin':
-       # Verify that 'google unit test' library is installed.  If not,
-       # get it and install it
-       SConscript(src_dir + '/extlibs/gtest/SConscript')
-
        # Build C stack's unit tests.
        SConscript('csdk/stack/test/SConscript')
        SConscript('csdk/connectivity/test/SConscript')
index bb02198..e3378f7 100644 (file)
@@ -18,6 +18,7 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
 Import('env')
 import os
 import os.path
@@ -38,7 +39,6 @@ unittests_env.PrependUnique(CPPPATH = [
                '../csdk/ocsocket/include',
                '../c_common/ocrandom/include',
                '../csdk/logger/include',
-               '#extlibs/gtest/gtest-1.7.0/include',
                '#extlibs/hippomocks-master/HippoMocks',
                '#extlibs/hippomocks-master/HippoMocksTest'
                ])
@@ -46,7 +46,6 @@ unittests_env.PrependUnique(CPPPATH = [
 unittests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 unittests_env.AppendUnique(LIBS = ['-lpthread'])
 unittests_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-unittests_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 unittests_env.PrependUnique(LIBS = [
                'oc',
                'octbstack',
index 6dc60e1..1918714 100644 (file)
@@ -17,6 +17,8 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
+
 Import('env')
 import os
 import os.path
@@ -29,7 +31,6 @@ src_dir = enrollee_test_env.get('SRC_DIR')
 ######################################################################
 
 enrollee_test_env.PrependUnique(CPPPATH = [
-               enrollee_test_env.get('SRC_DIR') + '/extlibs/gtest/gtest-1.7.0/include',
                enrollee_test_env.get('SRC_DIR') + '/resource/c_common/ocrandom/include',
                enrollee_test_env.get('SRC_DIR') + '/resource/csdk/stack/include/internal',
                enrollee_test_env.get('SRC_DIR') + '/resource/csdk/connectivity/api',
@@ -51,7 +52,6 @@ enrollee_test_env.PrependUnique(CPPPATH = [
 enrollee_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
 enrollee_test_env.AppendUnique(LIBS = ['-lpthread'])
 enrollee_test_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-enrollee_test_env.AppendUnique(LIBPATH = [src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs'])
 enrollee_test_env.PrependUnique(LIBS = ['m',
                                     'octbstack',
                                     'ocsrm',
index 734f051..b5304a7 100644 (file)
@@ -18,6 +18,7 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
 ##
 # Mediator[CSDK] Unit Test build script
 ##
@@ -39,10 +40,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 
 target_os = env.get('TARGET_OS')
 if target_os == 'linux':
-    # Verify that 'google unit test' library is installed.  If not,
-    # get it and install it
-    SConscript(env.get('SRC_DIR') + '/extlibs/gtest/SConscript')
-
     # Verify that 'hippomocks' mocking code is installed.  If not,
     # get it and install it
     SConscript(env.get('SRC_DIR') + '/extlibs/hippomocks.scons')
@@ -53,18 +50,14 @@ mediator_csdk_test_env = lib_env.Clone()
 #unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 ######################################################################
 # Build flags
 ######################################################################
-gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
 
 mediator_csdk_test_env.AppendUnique(
         CPPPATH = [
                 src_dir + '/extlibs/hippomocks-master',
-                src_dir + '/extlibs/gtest/gtest-1.7.0/include',
                 '../inc',
                 '../../../inc',
         ])
@@ -82,8 +75,8 @@ mediator_csdk_test_env.PrependUnique(LIBS = [
     'oc_logger',
     'oc_logger_core',
     'connectivity_abstraction',
-    gtest,
-    gtest_main])
+    'gtest',
+    'gtest_main'])
 
 mediator_csdk_test_env.AppendUnique(LIBS = ['dl'])
 
index 099eddb..444fffa 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # Mediator[RichSDK] Unit Test build script
@@ -39,10 +40,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 
 target_os = env.get('TARGET_OS')
 if target_os == 'linux':
-    # Verify that 'google unit test' library is installed.  If not,
-    # get it and install it
-    SConscript(env.get('SRC_DIR') + '/extlibs/gtest/SConscript')
-
     # Verify that 'hippomocks' mocking code is installed.  If not,
     # get it and install it
     SConscript(env.get('SRC_DIR') + '/extlibs/hippomocks.scons')
@@ -53,18 +50,14 @@ mediator_rich_test_env = lib_env.Clone()
 #unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 ######################################################################
 # Build flags
 ######################################################################
-gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
 
 mediator_rich_test_env.AppendUnique(
         CPPPATH = [
                 src_dir + '/extlibs/hippomocks-master',
-                src_dir + '/extlibs/gtest/gtest-1.7.0/include',
                 '../inc',
                 '../../../inc',
         ])
@@ -84,8 +77,9 @@ mediator_rich_test_env.PrependUnique(LIBS = [
     'oc',
     'octbstack',
     'oc_logger',
-    gtest,
-    gtest_main])
+    'gtest',
+    'gtest_main'])
+
 
 mediator_rich_test_env.AppendUnique(LIBS = ['dl'])
 
index ecc5306..0d48171 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # ResourceContainer (rcs_container) Unit Test build script
@@ -76,16 +77,12 @@ target_os = env.get('TARGET_OS')
 
 ######################### unit test setting ##########################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 ######################################################################
 
 
 ######################################################################
 # Build flags
 ######################################################################
-gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
-
 container_gtest_env.AppendUnique(
     CPPPATH = [
         env.get('SRC_DIR')+'/extlibs',
@@ -116,8 +113,7 @@ if target_os == 'android':
     container_gtest_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     container_gtest_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
 
-container_gtest_env.PrependUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/hippomocks-master',
-                             gtest_dir + '/include'])
+container_gtest_env.PrependUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/hippomocks-master'])
 
 if int(containerJavaSupport):
     try:
@@ -127,7 +123,7 @@ if int(containerJavaSupport):
 
 container_gtest_env.AppendUnique(CCFLAGS = ['-Wnoexcept'])
 
-container_gtest_env.PrependUnique(LIBS = ['rcs_container', 'rcs_client', 'rcs_server', 'rcs_common', 'oc','octbstack', 'oc_logger', 'oc_logger_core', 'connectivity_abstraction', gtest, gtest_main])
+container_gtest_env.PrependUnique(LIBS = ['rcs_container', 'rcs_client', 'rcs_server', 'rcs_common', 'oc','octbstack', 'oc_logger', 'oc_logger_core', 'connectivity_abstraction', 'gtest', 'gtest_main'])
 
 container_gtest_env.AppendUnique(LIBS = ['dl'])
 
index 06efb88..93fb28c 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # rcs_common (primitiveResource and expiryTimer) build script
@@ -30,8 +31,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'li
 
 src_dir = lib_env.get('SRC_DIR')
 
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
-
 rcs_common_env = lib_env.Clone()
 target_os = env.get('TARGET_OS')
 
@@ -99,21 +98,17 @@ if target_os == 'linux':
 
        rcs_common_test_env.PrependUnique(CPPPATH = [
                env.get('SRC_DIR')+'/extlibs/hippomocks-master',
-               gtest_dir + '/include',
                'utils/include'
                ])
 
-       gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-       gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
-
        rcs_common_test_env.PrependUnique(LIBS = [
                'octbstack',
                'oc_logger',
                'connectivity_abstraction',
                'coap',
                'rcs_common',
-               gtest,
-               gtest_main,
+               'gtest',
+               'gtest_main',
                'pthread'
                ])
 
index 00012e6..a752f0a 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # ResourceBroker Unit Test build script
@@ -40,7 +41,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 #unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 broker_test_env = lib_env.Clone()
 target_os = env.get('TARGET_OS')
@@ -48,8 +48,6 @@ target_os = env.get('TARGET_OS')
 ######################################################################
 # Build flags
 ######################################################################
-gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
 
 broker_test_env.AppendUnique(CPPPATH = ['../include'])
 broker_test_env.AppendUnique(CPPPATH = ['../../../include'])
@@ -58,8 +56,7 @@ broker_test_env.AppendUnique(CPPPATH = ['../../common/expiryTimer/include'])
 broker_test_env.AppendUnique(CPPPATH = ['../../common/expiryTimer/src'])
 broker_test_env.AppendUnique(CPPPATH = ['../../common/utils/include'])
 
-broker_test_env.PrependUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/hippomocks-master',
-                             gtest_dir + '/include'])
+broker_test_env.PrependUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/hippomocks-master'])
 broker_test_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 
 broker_test_env.PrependUnique(LIBS = ['coap'])
@@ -69,8 +66,8 @@ broker_test_env.AppendUnique(LIBS = ['octbstack'])
 broker_test_env.AppendUnique(LIBS = ['oc'])
 broker_test_env.AppendUnique(LIBS = ['rcs_client'])
 broker_test_env.AppendUnique(LIBS = ['rcs_common'])
-broker_test_env.AppendUnique(LIBS = [gtest])
-broker_test_env.AppendUnique(LIBS = [gtest_main])
+broker_test_env.AppendUnique(LIBS = ['gtest'])
+broker_test_env.AppendUnique(LIBS = ['gtest_main'])
 
 if target_os not in ['windows', 'winrt']:
     broker_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
index 7a7d992..f733925 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # ResourceCache Unit Test build script
@@ -40,7 +41,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 # unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 cache_test_env = lib_env.Clone()
 target_os = env.get('TARGET_OS')
@@ -48,8 +48,6 @@ target_os = env.get('TARGET_OS')
 ######################################################################
 # Build flags
 ######################################################################
-gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
 
 cache_test_env.AppendUnique(CPPPATH = ['../include'])
 cache_test_env.AppendUnique(CPPPATH = ['../../../include'])
@@ -57,10 +55,9 @@ cache_test_env.AppendUnique(CPPPATH = ['../../common/primitiveResource/include']
 cache_test_env.AppendUnique(CPPPATH = ['../../common/expiryTimer/include'])
 cache_test_env.AppendUnique(CPPPATH = ['../../common/expiryTimer/src'])
 cache_test_env.AppendUnique(CPPPATH = ['../../common/utils/include'])
-cache_test_env.PrependUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/hippomocks-master',
-                             gtest_dir + '/include'])
+cache_test_env.PrependUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/hippomocks-master'])
 cache_test_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-cache_test_env.PrependUnique(LIBS = ['rcs_client', 'rcs_common', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', gtest, gtest_main])
+cache_test_env.PrependUnique(LIBS = ['rcs_client', 'rcs_common', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'gtest', 'gtest_main'])
 
 if target_os not in ['windows', 'winrt']:
     cache_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
index 563d1d6..2e045b3 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # rcs_server (Server Builder) project build script
@@ -30,8 +31,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'li
 
 src_dir = lib_env.get('SRC_DIR')
 
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
-
 server_builder_env = lib_env.Clone()
 target_os = env.get('TARGET_OS')
 
@@ -90,21 +89,17 @@ if target_os == 'linux':
 
        server_builder_test_env.AppendUnique(CPPPATH = [
                env.get('SRC_DIR')+'/extlibs/hippomocks-master',
-               gtest_dir + '/include',
                '../common/utils/include'
                ])
 
-       gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-       gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
-
        server_builder_test_env.PrependUnique(LIBS = [
                'rcs_server',
                'octbstack',
                'oc_logger',
                'connectivity_abstraction',
                'coap',
-               gtest,
-               gtest_main,
+               'gtest',
+               'gtest_main',
                'pthread',
                ])
 
index 7af50f7..46cde03 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # ResourceClient Unit Test build script
@@ -39,10 +40,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 
 target_os = env.get('TARGET_OS')
 if target_os == 'linux':
-    # Verify that 'google unit test' library is installed.  If not,
-    # get it and install it
-    SConscript(env.get('SRC_DIR') + '/extlibs/gtest/SConscript')
-
     # Verify that 'hippomocks' mocking code is installed.  If not,
     # get it and install it
     SConscript(env.get('SRC_DIR') + '/extlibs/hippomocks.scons')
@@ -53,18 +50,13 @@ rcs_test_env = lib_env.Clone()
 #unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 ######################################################################
 # Build flags
 ######################################################################
-gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
-
 rcs_test_env.AppendUnique(
         CPPPATH = [
                 src_dir + '/extlibs/hippomocks-master',
-                src_dir + '/extlibs/gtest/gtest-1.7.0/include',
                 '../include',
                 '../src/common/utils/include',
         ])
@@ -84,8 +76,8 @@ rcs_test_env.PrependUnique(LIBS = [
     'rcs_client',
     'rcs_server',
     'rcs_common',
-    gtest,
-    gtest_main])
+    'gtest',
+    'gtest_main'])
 
 rcs_test_env.AppendUnique(LIBS = ['dl'])
 
index 2b15b0a..31768b8 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # ResourceHosting Unit Test build script
@@ -40,7 +41,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 #unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 hosting_test_env = lib_env.Clone()
 target_os = env.get('TARGET_OS')
@@ -48,15 +48,12 @@ target_os = env.get('TARGET_OS')
 ######################################################################
 # Build flags
 ######################################################################
-GTest = File(gtest_dir + '/lib/.libs/libgtest.a')
-GTest_Main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
 
-#hosting_test_env.AppendUnique(LIBPATH = [gtest_dir + '/lib/.libs'])
 hosting_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
 hosting_test_env.AppendUnique(LIBS = [
        'resource_hosting', 'rcs_server', 'rcs_client','rcs_common',
        'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap',
-       GTest_Main, GTest])
+       'gtest_main', 'gtest'])
 
 if target_os not in ['windows', 'winrt']:
     hosting_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
@@ -65,8 +62,7 @@ if target_os == 'linux':
        hosting_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
        hosting_test_env.AppendUnique(LIBS = ['pthread'])
 
-hosting_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master',
-                             gtest_dir + '/include'])
+hosting_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master'])
 hosting_test_env.AppendUnique(CPPPATH = ['../src'])
 hosting_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/include'])
 hosting_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/src/common/primitiveResource/include'])
index 25d65d8..8c7583a 100755 (executable)
@@ -18,6 +18,8 @@
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+SConscript('#extlibs/gtest/SConscript')
+
 ##
 # SceneManager Unit Test build script
 ##
@@ -40,7 +42,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 #unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 scene_test_env = lib_env.Clone()
 target_os = env.get('TARGET_OS')
@@ -48,15 +49,12 @@ target_os = env.get('TARGET_OS')
 ######################################################################
 # Build flags
 ######################################################################
-GTest = File(gtest_dir + '/lib/.libs/libgtest.a')
-GTest_Main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
 
-#scene_test_env.AppendUnique(LIBPATH = [gtest_dir + '/lib/.libs'])
 scene_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
 scene_test_env.AppendUnique(LIBS = [
     'scene_manager', 'rcs_server', 'rcs_client','rcs_common',
     'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap',
-    GTest_Main, GTest])
+    'gtest_main',  'gtest'])
 
 if target_os not in ['windows', 'winrt']:
     scene_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
@@ -69,8 +67,7 @@ if not env.get('RELEASE'):
     scene_test_env.PrependUnique(LIBS = ['gcov'])
     scene_test_env.AppendUnique(CXXFLAGS = ['--coverage'])
 
-scene_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master',
-                             gtest_dir + '/include'])
+scene_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master'])
 scene_test_env.AppendUnique(CPPPATH = ['../include'])
 scene_test_env.AppendUnique(CPPPATH = ['../src'])
 scene_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/include'])
index 461103a..60237e8 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+SConscript('#extlibs/gtest/SConscript')
 
 ##
 # ThingsManager Unit Test build script
@@ -39,10 +40,6 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
 
 target_os = env.get('TARGET_OS')
 if target_os == 'linux':
-        # Verify that 'google unit test' library is installed.  If not,
-        # get it and install it
-        SConscript(env.get('SRC_DIR') + '/extlibs/gtest/SConscript')
-
         # Verify that 'hippomocks' mocking code is installed.  If not,
         # get it and install it
         SConscript(env.get('SRC_DIR') + '/extlibs/hippomocks.scons')
@@ -53,18 +50,13 @@ ThingsManager_gtest_env = lib_env.Clone()
 #unit test setting
 ######################################################################
 src_dir = lib_env.get('SRC_DIR')
-gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
 
 ######################################################################
 # Build flags
 ######################################################################
-gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
-gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
-
 ThingsManager_gtest_env.AppendUnique(
         CPPPATH = [
                 src_dir + '/extlibs/hippomocks-master',
-                src_dir + '/extlibs/gtest/gtest-1.7.0/include',
                 '../sdk/inc',
                 '../../../extlibs/timer'
         ])
@@ -83,8 +75,8 @@ ThingsManager_gtest_env.PrependUnique(LIBS = [
     'oc_logger_core',
     'oc',
     'octbstack',
-    gtest,
-    gtest_main])
+    'gtest',
+    'gtest_main'])
 
 ThingsManager_gtest_env.AppendUnique(LIBS = ['dl'])