[tests][common][webapi-plugins.spec] Changed common unit tests files structure. 42/211142/5
authorMichal Michalski <m.michalski2@partner.samsung.com>
Tue, 30 Jul 2019 09:30:12 +0000 (11:30 +0200)
committerMichal Michalski <m.michalski2@partner.samsung.com>
Thu, 1 Aug 2019 06:04:54 +0000 (08:04 +0200)
New structure allows better modularization of unit tests.

[Verification] webapi_common_tests are built successfully and pass.

Signed-off-by: Michal Michalski <m.michalski2@partner.samsung.com>
Change-Id: Icad5cca7739716bde7c09092f4d1d73fca1972a0

packaging/webapi-plugins.spec
src/common/common_ut.gyp
src/common/ut/json-utils.cc [moved from src/common/ut/bundle_ut.cc with 98% similarity]
src/common/ut/json-utils.h [new file with mode: 0644]
src/common/ut/main.cc [new file with mode: 0644]

index 6733b91..8af0459 100644 (file)
@@ -1201,7 +1201,7 @@ mkdir -p %{buildroot}%{crosswalk_extensions_path}/mobile
 # tizen ut mobile
 %if "%{?tizen_ut_build}"  == "1"
 mkdir -p %{buildroot}/usr/bin
-install -p -m 755 out/bin_mobile/bundle_ut %{buildroot}/usr/bin/
+install -p -m 755 out/bin_mobile/webapi_common_tests %{buildroot}/usr/bin/
 %endif
 
 install -p -m 644 out/bin_mobile/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/mobile
@@ -1339,7 +1339,7 @@ fi
 # UT files
 %if "%{?tizen_ut_build}" == "1"
 %license GTEST.BSD-3-Clause
-/usr/bin/bundle_ut
+/usr/bin/webapi_common_tests
 %endif
 
 # mobile-extension-emulator
index 1ceb42f..61db8ad 100644 (file)
@@ -4,7 +4,7 @@
   ],
   'targets': [
     {
-      'target_name': 'bundle_ut',
+      'target_name': 'webapi_common_tests',
       'type': 'executable',
       'dependencies': [
         'common.gyp:tizen_common'
@@ -19,7 +19,8 @@
         '../googletest/src/gtest-all.cc',
         '../googlemock/src/gmock-all.cc',
         'ut/common_ut_extension.cc',
-        'ut/bundle_ut.cc'
+        'ut/json-utils.cc',
+        'ut/main.cc'
       ],
       'libraries': [
         '-lbundle',
similarity index 98%
rename from src/common/ut/bundle_ut.cc
rename to src/common/ut/json-utils.cc
index 0155d4d..935b776 100644 (file)
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
-#include "tizen.h"
-
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
+#include "common/ut/json-utils.h"
+
 #include "bundle.h"
 #include "bundle_internal.h"
 #include "common/json-utils.h"
@@ -396,7 +396,3 @@ TEST_F(BundleToJsonTest, BytesArrayConversion) {
   EXPECT_EQ(bytes[2].get<double>(), value[1][2]);
 }
 
-int main(int argc, char* argv[]) {
-  ::testing::InitGoogleTest(&argc, argv);
-  return RUN_ALL_TESTS();
-}
diff --git a/src/common/ut/json-utils.h b/src/common/ut/json-utils.h
new file mode 100644 (file)
index 0000000..653a821
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd 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.
+ */
+#ifndef COMMON_UT_JSON_UTILS_H
+#define COMMON_UT_JSON_UTILS_H
+
+class JsonToBundleTest;
+class BundleToJsonTest;
+
+#endif // COMMON_UT_JSON_UTILS_H
diff --git a/src/common/ut/main.cc b/src/common/ut/main.cc
new file mode 100644 (file)
index 0000000..044ac9f
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd 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 "gtest/gtest.h"
+
+#include "common/ut/json-utils.h"
+
+#include "tizen.h"
+
+int main(int argc, char* argv[]) {
+  ::testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
+