From: Minji Park Date: Fri, 26 Feb 2016 13:23:42 +0000 (+0900) Subject: Add Scene Manager Remote-side unittests X-Git-Tag: 1.2.0+RC1~584^2^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30a45666116643f9602866b105b0b9f4879535e1;p=platform%2Fupstream%2Fiotivity.git Add Scene Manager Remote-side unittests Change-Id: Iba00a577962442529b51943f77617edc3a027cc0 Signed-off-by: Minji Park Reviewed-on: https://gerrit.iotivity.org/gerrit/5233 Tested-by: jenkins-iotivity Reviewed-by: Hun-je Yeon Reviewed-by: Uze Choi --- diff --git a/service/scene-manager/unittests/RemoteSceneActionTest.cpp b/service/scene-manager/unittests/RemoteSceneActionTest.cpp new file mode 100644 index 0000000..9a65e1b --- /dev/null +++ b/service/scene-manager/unittests/RemoteSceneActionTest.cpp @@ -0,0 +1,215 @@ +//****************************************************************** +// +// Copyright 2015 Samsung Electronics All Rights Reserved. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +#include +#include + +#include "RemoteSceneList.h" + +#include "UnitTestHelper.h" +#include "SceneCommons.h" +#include "SceneList.h" +#include "RCSResourceObject.h" +#include "RCSRemoteResourceObject.h" +#include "OCPlatform.h" + +using namespace std; +using namespace OIC::Service; +using namespace OC; + +constexpr int DEFAULT_WAITTIME = 2000; + +constexpr char RESOURCE_URI[]{ "/a/light" }; +constexpr char RESOURCE_TYPE[]{ "core.light" }; +constexpr char KEY[]{ "power" }; +constexpr char VALUE[]{ "off" }; + +static int lightNum = 0; + +class RemoteSceneActionTest : public TestWithMock +{ +protected: + void SetUp() + { + TestWithMock::SetUp(); + + SceneList::getInstance()->getName(); + createListServer(); + + RemoteSceneList::createInstance(pListResource, std::bind( + &RemoteSceneActionTest::onRemoteSceneListCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneList->addNewSceneCollection(std::bind( + &RemoteSceneActionTest::onRemoteSceneCollectionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneCollection->addNewScene("Test Scene", std::bind( + &RemoteSceneActionTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + } + + void createListServer() + { + std::vector< std::string > vecRT{ SCENE_LIST_RT }; + std::vector< std::string > vecIF{ OC_RSRVD_INTERFACE_DEFAULT, OC::BATCH_INTERFACE }; + + pListResource = SceneUtils::createRCSResourceObject( + "coap://" + SceneUtils::getNetAddress() + SCENE_LIST_URI, + SCENE_CONNECTIVITY, vecRT, vecIF); + } + + void createLightServer() + { + RCSResourceObject::Ptr pResource = RCSResourceObject::Builder( + RESOURCE_URI, RESOURCE_TYPE, DEFAULT_INTERFACE).build(); + pResource->setAttribute(KEY, RCSResourceAttributes::Value(VALUE)); + + pLightResource + = SceneUtils::createRCSResourceObject( + "coap://" + SceneUtils::getNetAddress() + RESOURCE_URI + + "/" + std::to_string(lightNum++), + SCENE_CONNECTIVITY, pResource->getTypes(), pResource->getInterfaces()); + } + + void waitForCallback(int waitingTime = DEFAULT_WAITTIME) + { + std::unique_lock< std::mutex > lock{ mutex }; + cond.wait_for(lock, std::chrono::milliseconds{ waitingTime }); + } + +public: + RCSRemoteResourceObject::Ptr pListResource; + RemoteSceneList::Ptr pSceneList; + RemoteSceneCollection::Ptr pSceneCollection; + RemoteScene::Ptr pScene; + RemoteSceneAction::Ptr pSceneAction; + RCSRemoteResourceObject::Ptr pLightResource; + std::condition_variable cond; + std::mutex mutex; + + void onRemoteSceneListCreated(RemoteSceneList::Ptr remoteSceneList, int) + { + pSceneList = std::move(remoteSceneList); + cond.notify_all(); + } + + void onRemoteSceneCollectionCreated(RemoteSceneCollection::Ptr remoteSceneCol, int) + { + pSceneCollection = remoteSceneCol; + cond.notify_all(); + } + + void onRemoteSceneCreated(RemoteScene::Ptr remoteScene, int) + { + pScene = remoteScene; + cond.notify_all(); + } + + void onRemoteSceneActionCreated(RemoteSceneAction::Ptr remoteSceneAction, int) + { + pSceneAction = remoteSceneAction; + cond.notify_all(); + } + + void onActionUpdated(int) + { + cond.notify_all(); + } +}; + +TEST_F(RemoteSceneActionTest, createSceneAction) +{ + createLightServer(); + + pScene->addNewSceneAction(pLightResource, KEY, RCSResourceAttributes::Value(VALUE), + std::bind(&RemoteSceneActionTest::onRemoteSceneActionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + ASSERT_NE(nullptr, pSceneAction); +} + +TEST_F(RemoteSceneActionTest, createSceneActionWithEmptyRCSRemoteResourceObjectPtr) +{ + ASSERT_THROW(pScene->addNewSceneAction(nullptr, KEY, RCSResourceAttributes::Value(VALUE), + std::bind(&RemoteSceneActionTest::onRemoteSceneActionCreated, this, + placeholders::_1, placeholders::_2)), RCSInvalidParameterException); +} + +TEST_F(RemoteSceneActionTest, getAllRemoteSceneActions) +{ + createLightServer(); + + pScene->addNewSceneAction(pLightResource, KEY, RCSResourceAttributes::Value(VALUE), + std::bind(&RemoteSceneActionTest::onRemoteSceneActionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + vector< RemoteSceneAction::Ptr > actions + = pScene->getRemoteSceneActions(); + + ASSERT_EQ((unsigned int)1, actions.size()); + ASSERT_TRUE(actions.at(0)->getExecutionParameter().contains(KEY)); + ASSERT_EQ(VALUE, actions.at(0)->getExecutionParameter().at(KEY).get< string >()); +} + +TEST_F(RemoteSceneActionTest, getRemoteSceneAction) +{ + createLightServer(); + + pScene->addNewSceneAction(pLightResource, KEY, RCSResourceAttributes::Value(VALUE), + std::bind(&RemoteSceneActionTest::onRemoteSceneActionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + RemoteSceneAction::Ptr action = pScene->getRemoteSceneAction(pLightResource); + + ASSERT_TRUE(action->getExecutionParameter().contains(KEY)); + ASSERT_EQ(VALUE, action->getExecutionParameter().at(KEY).get< string >()); +} + +TEST_F(RemoteSceneActionTest, updateSceneAction) +{ + createLightServer(); + + pScene->addNewSceneAction(pLightResource, KEY, RCSResourceAttributes::Value(VALUE), + std::bind(&RemoteSceneActionTest::onRemoteSceneActionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneAction->setExecutionParameter( + KEY, RCSResourceAttributes::Value("on"), std::bind( + &RemoteSceneActionTest::onActionUpdated, this, placeholders::_1)); + + waitForCallback(); + + ASSERT_EQ("on", pSceneAction->getExecutionParameter().at(KEY).get< string >()); +} diff --git a/service/scene-manager/unittests/RemoteSceneCollectionTest.cpp b/service/scene-manager/unittests/RemoteSceneCollectionTest.cpp new file mode 100644 index 0000000..bcc0888 --- /dev/null +++ b/service/scene-manager/unittests/RemoteSceneCollectionTest.cpp @@ -0,0 +1,165 @@ +//****************************************************************** +// +// Copyright 2016 Samsung Electronics All Rights Reserved. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +#include +#include + +#include "RemoteSceneList.h" + +#include "UnitTestHelper.h" +#include "SceneCommons.h" +#include "SceneList.h" +#include "RCSResourceObject.h" +#include "RCSRemoteResourceObject.h" +#include "OCPlatform.h" + +using namespace std; +using namespace OIC::Service; +using namespace OC; + +constexpr int DEFAULT_WAITTIME = 2000; + +class RemoteSceneCollectionTest : public TestWithMock +{ +protected: + void SetUp() + { + TestWithMock::SetUp(); + + SceneList::getInstance()->getName(); + createListServer(); + + RemoteSceneList::createInstance(pListResource, std::bind( + &RemoteSceneCollectionTest::onRemoteSceneListCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + } + + void createListServer() + { + std::vector< std::string > vecRT{ SCENE_LIST_RT }; + std::vector< std::string > vecIF{ OC_RSRVD_INTERFACE_DEFAULT, OC::BATCH_INTERFACE }; + + pListResource = SceneUtils::createRCSResourceObject( + "coap://" + SceneUtils::getNetAddress() + SCENE_LIST_URI, + SCENE_CONNECTIVITY, vecRT, vecIF); + } + + void waitForCallback(int waitingTime = DEFAULT_WAITTIME) + { + std::unique_lock< std::mutex > lock{ mutex }; + cond.wait_for(lock, std::chrono::milliseconds{ waitingTime }); + } + +public: + RCSRemoteResourceObject::Ptr pListResource; + RemoteSceneList::Ptr pSceneList; + RemoteSceneCollection::Ptr pSceneCollection; + std::condition_variable cond; + std::mutex mutex; + + void onRemoteSceneListCreated(RemoteSceneList::Ptr remoteSceneList, int) + { + pSceneList = std::move(remoteSceneList); + cond.notify_all(); + } + + void onRemoteSceneCollectionCreated(RemoteSceneCollection::Ptr remoteSceneCol, int) + { + pSceneCollection = remoteSceneCol; + cond.notify_all(); + } + + void onRemoteSceneCreated(RemoteScene::Ptr, int) + { + cond.notify_all(); + } + + void onSetName(int) + { + cond.notify_all(); + } +}; + +TEST_F(RemoteSceneCollectionTest, addNewRemoteSceneCollection) +{ + pSceneList->addNewSceneCollection(std::bind( + &RemoteSceneCollectionTest::onRemoteSceneCollectionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneCollection->addNewScene("Default", std::bind( + &RemoteSceneCollectionTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + EXPECT_NE(nullptr, pSceneCollection); +} + +TEST_F(RemoteSceneCollectionTest, getRemoteSceneCollectionList) +{ + std::vector< RemoteSceneCollection::Ptr > sceneCollections + = pSceneList->getRemoteSceneCollections(); + + bool getCollectionsOK = true; + + if (!sceneCollections.empty()) + { + for (const auto &it : sceneCollections) + { + if (it->getId() == "") + { + getCollectionsOK = false; + break; + } + } + } + else + { + getCollectionsOK = false; + } + + ASSERT_TRUE(getCollectionsOK); +} + +TEST_F(RemoteSceneCollectionTest, setAndGetSceneCollectionName) +{ + pSceneList->addNewSceneCollection(std::bind( + &RemoteSceneCollectionTest::onRemoteSceneCollectionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneCollection->addNewScene("Default", std::bind( + &RemoteSceneCollectionTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneCollection->setName("Kitchen", std::bind( + &RemoteSceneCollectionTest::onSetName, this, placeholders::_1)); + + waitForCallback(); + + EXPECT_EQ("Kitchen", pSceneCollection->getName()); +} \ No newline at end of file diff --git a/service/scene-manager/unittests/RemoteSceneListTest.cpp b/service/scene-manager/unittests/RemoteSceneListTest.cpp new file mode 100644 index 0000000..b2575b7 --- /dev/null +++ b/service/scene-manager/unittests/RemoteSceneListTest.cpp @@ -0,0 +1,106 @@ +//****************************************************************** +// +// Copyright 2016 Samsung Electronics All Rights Reserved. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +#include +#include + +#include "RemoteSceneList.h" + +#include "UnitTestHelper.h" +#include "SceneCommons.h" +#include "SceneList.h" +#include "RCSRemoteResourceObject.h" +#include "OCPlatform.h" + +using namespace std; +using namespace OIC::Service; +using namespace OC; + +constexpr int DEFAULT_WAITTIME = 2000; + +class RemoteSceneListTest : public TestWithMock +{ +protected: + void SetUp() + { + TestWithMock::SetUp(); + SceneList::getInstance()->getName(); + } + + void createListServer() + { + std::vector< std::string > vecRT{ SCENE_LIST_RT }; + std::vector< std::string > vecIF{ OC_RSRVD_INTERFACE_DEFAULT, OC::BATCH_INTERFACE }; + + pListResource = SceneUtils::createRCSResourceObject( + "coap://" + SceneUtils::getNetAddress() + SCENE_LIST_URI, + SCENE_CONNECTIVITY, vecRT, vecIF); + } + + void waitForCallback(int waitingTime = DEFAULT_WAITTIME) + { + std::unique_lock< std::mutex > lock{ mutex }; + cond.wait_for(lock, std::chrono::milliseconds{ waitingTime }); + } + +public: + RCSRemoteResourceObject::Ptr pListResource; + RemoteSceneList::Ptr pSceneList; + std::condition_variable cond; + std::mutex mutex; + + void onRemoteSceneListCreated(RemoteSceneList::Ptr remoteSceneList, int) + { + pSceneList = std::move(remoteSceneList); + cond.notify_all(); + } + + void onSetName(int) + { + cond.notify_all(); + } +}; + +TEST_F(RemoteSceneListTest, createRemoteSceneListInstance) +{ + createListServer(); + RemoteSceneList::createInstance(pListResource, std::bind( + &RemoteSceneListTest::onRemoteSceneListCreated, this, placeholders::_1, placeholders::_2)); + + waitForCallback(); + + EXPECT_NE(nullptr, pSceneList); +} + +TEST_F(RemoteSceneListTest, setAndGetRemoteSceneListName) +{ + createListServer(); + RemoteSceneList::createInstance(pListResource, std::bind( + &RemoteSceneListTest::onRemoteSceneListCreated, this, placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneList->setName("Test Scene List", std::bind( + &RemoteSceneListTest::onSetName, this, placeholders::_1)); + + waitForCallback(); + + EXPECT_EQ("Test Scene List", pSceneList->getName()); +} \ No newline at end of file diff --git a/service/scene-manager/unittests/RemoteSceneTest.cpp b/service/scene-manager/unittests/RemoteSceneTest.cpp new file mode 100644 index 0000000..c51ed61 --- /dev/null +++ b/service/scene-manager/unittests/RemoteSceneTest.cpp @@ -0,0 +1,209 @@ +//****************************************************************** +// +// Copyright 2015 Samsung Electronics All Rights Reserved. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +#include +#include + +#include "RemoteSceneList.h" + +#include "UnitTestHelper.h" +#include "SceneCommons.h" +#include "SceneList.h" +#include "RCSResourceObject.h" +#include "RCSRemoteResourceObject.h" +#include "OCPlatform.h" + +using namespace std; +using namespace OIC::Service; +using namespace OC; + +constexpr int DEFAULT_WAITTIME = 2000; + +constexpr char RESOURCE_URI[]{ "/a/light" }; +constexpr char RESOURCE_TYPE[]{ "core.light" }; +constexpr char KEY[]{ "power" }; +constexpr char VALUE[]{ "off" }; + +static int lightNum = 0; + +class RemoteSceneTest : public TestWithMock +{ +protected: + void SetUp() + { + TestWithMock::SetUp(); + executionSucceeded = false; + + SceneList::getInstance()->getName(); + createListServer(); + + RemoteSceneList::createInstance(pListResource, std::bind( + &RemoteSceneTest::onRemoteSceneListCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneList->addNewSceneCollection(std::bind( + &RemoteSceneTest::onRemoteSceneCollectionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pSceneCollection->addNewScene("Default", std::bind( + &RemoteSceneTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + } + + void createListServer() + { + std::vector< std::string > vecRT{ SCENE_LIST_RT }; + std::vector< std::string > vecIF{ OC_RSRVD_INTERFACE_DEFAULT, OC::BATCH_INTERFACE }; + + pListResource = SceneUtils::createRCSResourceObject( + "coap://" + SceneUtils::getNetAddress() + SCENE_LIST_URI, + SCENE_CONNECTIVITY, vecRT, vecIF); + } + + void createLightServer() + { + RCSResourceObject::Ptr pResource = RCSResourceObject::Builder( + RESOURCE_URI, RESOURCE_TYPE, DEFAULT_INTERFACE).build(); + pResource->setAttribute(KEY, RCSResourceAttributes::Value(VALUE)); + + pLightResource + = SceneUtils::createRCSResourceObject( + "coap://" + SceneUtils::getNetAddress() + RESOURCE_URI + + "/" + std::to_string(lightNum++), + SCENE_CONNECTIVITY, pResource->getTypes(), pResource->getInterfaces()); + } + + void waitForCallback(int waitingTime = DEFAULT_WAITTIME) + { + std::unique_lock< std::mutex > lock{ mutex }; + cond.wait_for(lock, std::chrono::milliseconds{ waitingTime }); + } + +public: + RCSRemoteResourceObject::Ptr pListResource; + RemoteSceneList::Ptr pSceneList; + RemoteSceneCollection::Ptr pSceneCollection; + RemoteScene::Ptr pScene; + RCSRemoteResourceObject::Ptr pLightResource; + bool executionSucceeded; + std::condition_variable cond; + std::mutex mutex; + + void onRemoteSceneListCreated(RemoteSceneList::Ptr remoteSceneList, int) + { + pSceneList = std::move(remoteSceneList); + cond.notify_all(); + } + + void onRemoteSceneCollectionCreated(RemoteSceneCollection::Ptr remoteSceneCol, int) + { + pSceneCollection = remoteSceneCol; + cond.notify_all(); + } + + void onRemoteSceneCreated(RemoteScene::Ptr remoteScene, int) + { + pScene = remoteScene; + cond.notify_all(); + } + + void onRemoteSceneActionCreated(RemoteSceneAction::Ptr, int) + { + cond.notify_all(); + } + + void onRemoteSceneExecuted(string, int) + { + executionSucceeded = true; + cond.notify_all(); + } +}; + +TEST_F(RemoteSceneTest, addNewRemoteScene) +{ + pSceneCollection->addNewScene("Test Scene", std::bind( + &RemoteSceneTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + ASSERT_NE(nullptr, pScene); + ASSERT_EQ("Test Scene", pScene->getName()); +} + +TEST_F(RemoteSceneTest, createNewRemoteSceneWithEmptyName) +{ + ASSERT_THROW( + pSceneCollection->addNewScene("", std::bind( + &RemoteSceneTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2));, RCSInvalidParameterException); +} + +TEST_F(RemoteSceneTest, getRemoteSceneBySceneName) +{ + pSceneCollection->addNewScene("Test Scene", std::bind( + &RemoteSceneTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + auto scene = pSceneCollection->getRemoteScene("Test Scene"); + + EXPECT_NE(nullptr, scene); + EXPECT_EQ("Test Scene", scene->getName()); +} + +TEST_F(RemoteSceneTest, getAllRemoteScenes) +{ + pSceneCollection->addNewScene("Test Scene", std::bind( + &RemoteSceneTest::onRemoteSceneCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + auto scenes = pSceneCollection->getRemoteScenes(); + + ASSERT_EQ((unsigned int)2, scenes.size()); + ASSERT_NE(scenes.end(), scenes.find("Test Scene")); +} + +TEST_F(RemoteSceneTest, executeRemoteScene) +{ + createLightServer(); + + pScene->addNewSceneAction(pLightResource, KEY, RCSResourceAttributes::Value(VALUE), + std::bind(&RemoteSceneTest::onRemoteSceneActionCreated, this, + placeholders::_1, placeholders::_2)); + + waitForCallback(); + + pScene->execute(std::bind( + &RemoteSceneTest::onRemoteSceneExecuted, this, placeholders::_1, placeholders::_2)); + + waitForCallback(); + + ASSERT_TRUE(executionSucceeded); +} \ No newline at end of file diff --git a/service/scene-manager/unittests/SConscript b/service/scene-manager/unittests/SConscript index a0a41d0..25d65d8 100755 --- a/service/scene-manager/unittests/SConscript +++ b/service/scene-manager/unittests/SConscript @@ -1,6 +1,6 @@ #****************************************************************** # -# Copyright 2015 Samsung Electronics All Rights Reserved. +# Copyright 2016 Samsung Electronics All Rights Reserved. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # @@ -104,9 +104,29 @@ Alias("scene_action_test", scene_action_test) env.AppendTarget('scene_action_test') scene_test_env.InstallTarget(scene_action_test, 'scene_action_test') +remote_scene_list_test_src = env.Glob('./RemoteSceneListTest.cpp') +remote_scene_list_test = scene_test_env.Program('remote_scene_list_test', remote_scene_list_test_src) +Alias("remote_scene_list_test", remote_scene_list_test) +env.AppendTarget('remote_scene_list_test') + +remote_scene_col_test_src = env.Glob('./RemoteSceneCollectionTest.cpp') +remote_scene_col_test = scene_test_env.Program('remote_scene_col_test', remote_scene_col_test_src) +Alias("remote_scene_col_test", remote_scene_col_test) +env.AppendTarget('remote_scene_col_test') + +remote_scene_test_src = env.Glob('./RemoteSceneTest.cpp') +remote_scene_test = scene_test_env.Program('remote_scene_test', remote_scene_test_src) +Alias("remote_scene_test", remote_scene_test) +env.AppendTarget('remote_scene_test') + +remote_scene_action_test_src = env.Glob('./RemoteSceneActionTest.cpp') +remote_scene_action_test = scene_test_env.Program('remote_scene_action_test', remote_scene_action_test_src) +Alias("remote_scene_action_test", remote_scene_action_test) +env.AppendTarget('remote_scene_action_test') + #target_os = env.get('TARGET_OS') #if target_os == 'linux': # from tools.scons.RunTest import * # run_test(scene_test_env, # '', -# 'service/scene-manager/unittest/scene_test') +# 'service/scene-manager/unittest/scene_test') \ No newline at end of file