Modify Sconscript for auto Unittest when scons-build. 72/2072/3
authorHeewon Park <h_w.park@samsung.com>
Mon, 3 Aug 2015 14:00:48 +0000 (23:00 +0900)
committerHabib Virji <habib.virji@samsung.com>
Mon, 3 Aug 2015 14:18:39 +0000 (14:18 +0000)
add unittest execute option(TEST) into the SConscript file(common/serverbuilder/client).

Change-Id: I9196775765590af0074d020e066e9cd66b213815
Signed-off-by: Heewon Park <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2072
Reviewed-by: Habib Virji <habib.virji@samsung.com>
Tested-by: Habib Virji <habib.virji@samsung.com>
service/resource-encapsulation/src/common/SConscript [changed mode: 0644->0755]
service/resource-encapsulation/src/serverBuilder/SConscript [changed mode: 0644->0755]
service/resource-encapsulation/unittests/SConscript [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 3997142..bcc9b6c
@@ -123,3 +123,10 @@ rcs_common_test_src = [
 rcs_common_test = rcs_common_test_env.Program('rcs_common_test', rcs_common_test_src)
 Alias("rcs_common_test", rcs_common_test)
 env.AppendTarget('rcs_common_test')
+
+if env.get('TEST') == '1':
+    target_os = env.get('TARGET_OS')
+    if target_os == 'linux':
+        from tools.scons.RunTest import *
+        run_test(rcs_common_test_env, '',
+                'service/resource-encapsulation/src/common/rcs_common_test')
old mode 100644 (file)
new mode 100755 (executable)
index ec6bdd4..98e0cb7
@@ -110,3 +110,10 @@ server_builder_test_src = env.Glob('unittests/*.cpp')
 server_builder_test = server_builder_test_env.Program('rcs_server_test', server_builder_test_src)
 Alias("rcs_server_test", server_builder_test)
 env.AppendTarget('rcs_server_test')
+
+if env.get('TEST') == '1':
+    target_os = env.get('TARGET_OS')
+    if target_os == 'linux':
+        from tools.scons.RunTest import *
+        run_test(server_builder_test_env, '',
+                'service/resource-encapsulation/src/serverBuilder/rcs_server_test')
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 72a869c..ddea23a
@@ -98,6 +98,12 @@ ResourceClient_gtest_env.AppendUnique(LIBS = ['dl'])
 ResourceClient_gtest_src = env.Glob('./*.cpp')
 
 ResourceClient_test = ResourceClient_gtest_env.Program('ResourceClientTest', ResourceClient_gtest_src)
-Alias("ResourceClient_Test", ResourceClient_test)
+Alias("ResourceClientTest", ResourceClient_test)
 env.AppendTarget('ResourceClient_test')
 
+if env.get('TEST') == '1':
+    target_os = env.get('TARGET_OS')
+    if target_os == 'linux':
+        from tools.scons.RunTest import *
+        run_test(ResourceClient_gtest_env, '',
+                'service/resource-encapsulation/unittests/ResourceClientTest')
\ No newline at end of file