From: Keebong Date: Fri, 12 Apr 2013 09:08:08 +0000 (+0900) Subject: Fixed device capability parsing X-Git-Tag: 2.2.1_release~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7987b8c8d247efef2fee9f2975dcb1a526945479;p=test%2Ftools%2FFtApp.git Fixed device capability parsing Change-Id: Ic2e9abc50f60093aedc9400f032f5bc132b48567 Signed-off-by: Keebong --- diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..fad7ffd --- /dev/null +++ b/.cproject @@ -0,0 +1,729 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..2cfbe42 --- /dev/null +++ b/.project @@ -0,0 +1,82 @@ + + + FtApp + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + sbi-make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/FtApp/Debug-Tizen-Emulator} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + true + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..fa2f512 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,78 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET (this_target FtApp) +SET (PKGID 2s4jm6firv) + +SET(CMAKE_INSTALL_PREFIX /usr) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) + +#ADD_SUBDIRECTORY(Plugins) + +INCLUDE_DIRECTORIES ( + /usr/include/minizip + /usr/include/chomium + /usr/include/osp + /usr/include/osp/base + /usr/include/osp/app + /usr/include/osp/io + /usr/include/osp/test + inc + ) + +SET (${this_target}_SOURCE_FILES + src/FtApp.cpp + src/FtAppEntry.cpp + src/FtAppForm.cpp + src/FtAppFrame.cpp + src/FtSoExecutor.cpp + src/FtConfiguration.cpp + src/FtConfParser.cpp + src/FtDeviceCapability.cpp + src/TsTcInfo.cpp + src/TestUtils.cpp + ) + +## SET EXTRA COMPILER FLAGS +IF("${ARCH}" MATCHES "arm") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIE -Wall -pthread -g3 -Wl,-rpath,/opt/apps/2s4jm6firv/lib/gtest/arm") +ELSE("${ARCH}" MATCHES "arm") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIE -Wall -pthread -g3 -Wl,-rpath,/opt/apps/2s4jm6firv/lib/gtest/x86") +ENDIF("${ARCH}" MATCHES "arm") + +## SET C COMPILER FLAGS +SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## SET CPP COMPILER FLAGS +SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + + + +## Create Library +SET(CMAKE_EXECUTABLE_SUFFIX ".exe") +ADD_EXECUTABLE (${this_target} ${${this_target}_SOURCE_FILES}) +SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output/${PKGID}/bin) + +TARGET_LINK_LIBRARIES(${this_target} -L/usr/lib/osp -losp-appfw -losp-uifw -L/usr/lib -lchromium -lminizip -ldl) +TARGET_LINK_LIBRARIES(${this_target} -Xlinker --allow-shlib-undefined -Xlinker --export-dynamic -pie) + +ADD_CUSTOM_COMMAND(TARGET ${this_target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${EXECUTABLE_OUTPUT_PATH}/${this_target}${CMAKE_EXECUTABLE_SUFFIX} ${EXECUTABLE_OUTPUT_PATH}/debug/${this_target}${CMAKE_EXECUTABLE_SUFFIX} + COMMAND ${CMAKE_STRIP} --strip-unneeded --remove-section .comment ${EXECUTABLE_OUTPUT_PATH}/${this_target}${CMAKE_EXECUTABLE_SUFFIX} + COMMENT "strip ${this_target}" +) + +INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/${this_target}.exe DESTINATION ../opt/usr/apps/${PKGID}/bin) +INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/debug/${this_target}.exe DESTINATION ../opt/usr/apps/debug/${PKGID}/bin) + +## Cory additional info +INSTALL(FILES ${CMAKE_SOURCE_DIR}/manifest.xml DESTINATION ../opt/usr/apps/${PKGID}/info) +IF("${ARCH}" MATCHES "arm") +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/gtest/arm DESTINATION ../opt/usr/apps/${PKGID}/lib/gtest) +ELSEIF("${ARCH}" MATCHES "x86") +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/gtest/x86 DESTINATION ../opt/usr/apps/${PKGID}/lib/gtest) +ENDIF("${ARCH}" MATCHES "arm") +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/data DESTINATION ../opt/usr/apps/${PKGID}) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ../opt/usr/apps/${PKGID}) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/shared DESTINATION ../opt/usr/apps/${PKGID}) + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..69b6c09 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,40 @@ +2013/03/20 +---------- +* The specific error reason of E_LIBRARY_NOT_FOUND is printed on console. + +* Device Capability feature added +In, capability.conf +Supported and unsupported can be listed up. + +In each test case .conf, +Each test case or test suite can specify its supported features to run and unsupported features to run. +e.g., +-UTcFlipP01:1:2.0 http://tizen.org/feature/camera.back !http://tizen.org/feature/camera.front + +This test case will be executed when camera.back is in supported list and camera.front is in unsupported list. + +* Flexible version control feature added +In conf, +-UTcConstructItem01:1:[2.0-5.0] +Which means that this specific test case runs on all versions from 2.0 to 5.0. +If 2.0, 3.0, 4.0, 5.0 and 6.0 are all versions, and specified as below means, this test will run on all versions. +-UTcConstructItem01:1 + +Also, +-UTcConstructItem01:[E4.0] -> runs on all versions except 4.0 +-UTcConstructItem01:[2.0-5.0][E4.0]-> runs on 2.0,3.0, 5.0 +-UTcConstructItem01:[2.0-4.0][6.0] -> runs on 2.0,3.0, 4.0, 6.0 +-UTcConstructItem01:[2.0-4.0][5.0-7.0] -> runs on 2.0,3.0, 4.0 and from 5.0 to 7.0 +-UTcConstructItem01:[2.0-] -> runs after 2.0 +-UTcConstructItem01:[-3.0] -> runs until 3.0 + + +2013/02/18 +---------- +* Custom key-value pair can be loaded from .conf file used in test case. +In conf, +[Custom] +AudioRecorderFilePath=/opt/storage/sdcard/uts-media/output/aduios/rec + +In TC, +String audioRecorderFilePath = TsMain::GetInstance()->GetValue("AudioRecorderFilePath"); diff --git a/LICENSE.Flora b/LICENSE.Flora new file mode 100644 index 0000000..9c95663 --- /dev/null +++ b/LICENSE.Flora @@ -0,0 +1,206 @@ +Flora License + +Version 1.0, May, 2012 + +http://floralicense.org/license/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and +all other entities that control, are controlled by, or are +under common control with that entity. For the purposes of +this definition, "control" means (i) the power, direct or indirect, +to cause the direction or management of such entity, +whether by contract or otherwise, or (ii) ownership of fifty percent (50%) +or more of the outstanding shares, or (iii) beneficial ownership of +such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice +that is included in or attached to the work (an example is provided +in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, +that is based on (or derived from) the Work and for which the editorial +revisions, annotations, elaborations, or other modifications represent, +as a whole, an original work of authorship. For the purposes of this License, +Derivative Works shall not include works that remain separable from, +or merely link (or bind by name) to the interfaces of, the Work and +Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor +for inclusion in the Work by the copyright owner or by an individual or +Legal Entity authorized to submit on behalf of the copyright owner. +For the purposes of this definition, "submitted" means any form of +electronic, verbal, or written communication sent to the Licensor or +its representatives, including but not limited to communication on +electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated +in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +"Tizen Certified Platform" shall mean a software platform that complies +with the standards set forth in the Compatibility Definition Document +and passes the Compatibility Test Suite as defined from time to time +by the Tizen Technical Steering Group and certified by the Tizen +Association or its designated agent. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work +solely as incorporated into a Tizen Certified Platform, where such +license applies only to those patent claims licensable by such +Contributor that are necessarily infringed by their Contribution(s) +alone or by combination of their Contribution(s) with the Work solely +as incorporated into a Tizen Certified Platform to which such +Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim +in a lawsuit) alleging that the Work or a Contribution incorporated +within the Work constitutes direct or contributory patent infringement, +then any patent licenses granted to You under this License for that +Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof pursuant to the copyright license +above, in any medium, with or without modifications, and in Source or +Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works + a copy of this License; and + 2. You must cause any modified files to carry prominent notices stating + that You changed the files; and + 3. You must retain, in the Source form of any Derivative Works that + You distribute, all copyright, patent, trademark, and attribution + notices from the Source form of the Work, excluding those notices + that do not pertain to any part of the Derivative Works; and + 4. If the Work includes a "NOTICE" text file as part of its distribution, + then any Derivative Works that You distribute must include a readable + copy of the attribution notices contained within such NOTICE file, + excluding those notices that do not pertain to any part of + the Derivative Works, in at least one of the following places: + within a NOTICE text file distributed as part of the Derivative Works; + within the Source form or documentation, if provided along with the + Derivative Works; or, within a display generated by the Derivative Works, + if and wherever such third-party notices normally appear. + The contents of the NOTICE file are for informational purposes only + and do not modify the License. + +You may add Your own attribution notices within Derivative Works +that You distribute, alongside or as an addendum to the NOTICE text +from the Work, provided that such additional attribution notices +cannot be construed as modifying the License. You may add Your own +copyright statement to Your modifications and may provide additional or +different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works +as a whole, provided Your use, reproduction, and distribution of +the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Flora License to your work + +To apply the Flora License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Flora License, Version 1.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://floralicense.org/license/ + + 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. + diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..9debbea --- /dev/null +++ b/NOTICE @@ -0,0 +1,3 @@ +Copyright (c) Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Flora License, Version 1. +Please, see the LICENSE.Flora file for Flora License terms and conditions. diff --git a/author-signature.xml b/author-signature.xml new file mode 100644 index 0000000..6aff1d4 --- /dev/null +++ b/author-signature.xml @@ -0,0 +1,51 @@ + + + + + + + + + +lpo8tUDs054eLlBQXiDPVDVKfw30ZZdtkRs1jd7H5K8= + + + +d3lKi4BNVSi0rYiMrIacjIJhvWP4rtTOt8RqXcYaBUASNS4acZdKtGRTcAi9vSt1h3CW+Y8gmhGF +3nmBDCxi3qyBiC/uaJdazjTCVGN+Of53M0E0uTL4imzU+UMECgAC2Y9mb7xLqehL7S6iOUBDjDJt +aGw24X9RguwPQ6sPUpk= + + + + +MIICiDCCAfGgAwIBAgIGAT3uVWhhMA0GCSqGSIb3DQEBBQUAMIGEMQswCQYDVQQGEwJLUjEOMAwG +A1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSAwHgYD +VQQLDBdUaXplbiBEZXZlbG9wZXIgVGVzdCBDQTEbMBkGA1UEAwwSVGl6ZW4gRGV2ZWxvcGVyIENB +MB4XDTEzMDQwOTEwMjY0N1oXDTQwMDgyNTEwMjY0NlowgYkxCzAJBgNVBAYTAktSMREwDwYDVQQI +DAhLeXVuZy1naTEOMAwGA1UEBwwFU3V3b24xEDAOBgNVBAoMB1NhbXN1bmcxDDAKBgNVBAsMA1NQ +RzEnMCUGCSqGSIb3DQEJARYYc3VuZ2d1bi5qdW5nQHNhbXN1bmcuY29tMQ4wDAYDVQQDDAVGdEFw +cDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAg43VXwzDa498f/+JiD38kDqiQ0Wx7/nEciwa +2pktcna8KwSSUYIghExLZmQLBfudkxBpDeq+iEQzFm5QtSrH3KwJX6Da/PYTS3W7C4XdrbAWShPk +SVyUp86P7u2Q+dwoAdPfqANm7DdTxQ4BUdtNtYcATQ9PHIu0Dk7OACBLb1kCAwEAATANBgkqhkiG +9w0BAQUFAAOBgQCe9h4VRqMmU+7OH8BHJiIwnbdvfWnyGBjVQ4BrcybeTu6A2IgTibY4n6eelW2g +FqxozI+fl5hW8wCRQNyDO2mef/WfopkJGbafpRv3eJfT2gKjJHRJEvaXutD3cPfvvOvzmMw0YijI +I3KhzIrbi3Fekg52nLkRZKHrqkQQvQfsOA== + + +MIICpzCCAhCgAwIBAgIJAKzDjmEF+1OXMA0GCSqGSIb3DQEBBQUAMIGTMQswCQYDVQQGEwJLUjEO +MAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSUw +IwYDVQQLDBxUaXplbiBUZXN0IERldmVsb3BlciBSb290IENBMSUwIwYDVQQDDBxUaXplbiBUZXN0 +IERldmVsb3BlciBSb290IENBMB4XDTEyMTAyOTEzMDEyMloXDTIyMTAyNzEzMDEyMlowgYQxCzAJ +BgNVBAYTAktSMQ4wDAYDVQQIDAVTdXdvbjEOMAwGA1UEBwwFU3V3b24xFjAUBgNVBAoMDVRpemVu +IFRlc3QgQ0ExIDAeBgNVBAsMF1RpemVuIERldmVsb3BlciBUZXN0IENBMRswGQYDVQQDDBJUaXpl +biBEZXZlbG9wZXIgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMyG0DSTHBgalQo1seDK +xpCU61gji+QQlxQkPQOvBrmuF6Z90zFCprTtg2sRjTLCNoRd75+VCCHuKGcrD27t7hwAekusPrpz +dsq5QoBMvNjGDM22lC45PJ4d86DEDY4erxeJ5aSQxqbfXK4pKe9NwxdkKuA8dTYZM1UcmhXs7YAL +AgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEACbr/OPNMJ+Ejrxfm/YjC +iRPpjJLnwXS2IDtitbxot6bEdZkZvOFXOC0Ca4GT+jtvOcSlU7tM3Mdd1MrKe1kkoVd1vhCV8V4C +K3/DPj8aN3rxfMfQitA6XMDcxzhsyMWz56OdifX50dvS/G/ad+kGhNhOOEKSE8zUyEDCGwqkfXk= + + + + + \ No newline at end of file diff --git a/data/FtApp.ini b/data/FtApp.ini new file mode 100755 index 0000000..d73f458 --- /dev/null +++ b/data/FtApp.ini @@ -0,0 +1,10 @@ +#global +LogFilePath=data/ +FtAppLogFileName=ftapputs.log +DTSLogFileName=ftapp_journal.dat +TestConfFilePath=data/ +TestConfFileName=ftapputs.conf +Platform=emulator +VersionFile=info/version.info +CompatFile=info/compat.info +DeviceCapabilityList=capability_m0_modem.conf diff --git a/data/capability_emul.conf b/data/capability_emul.conf new file mode 100644 index 0000000..ce093c1 --- /dev/null +++ b/data/capability_emul.conf @@ -0,0 +1,44 @@ +http://tizen.org/feature/camera +http://tizen.org/feature/camera.back +http://tizen.org/feature/camera.front +http://tizen.org/feature/database.encryption +http://tizen.org/feature/location +http://tizen.org/feature/location.gps +http://tizen.org/feature/location.wps +http://tizen.org/feature/microphone +http://tizen.org/feature/network.nfc +http://tizen.org/feature/opengles.texture_format.3dc +http://tizen.org/feature/opengles.texture_format.atc +http://tizen.org/feature/opengles.texture_format.etc +http://tizen.org/feature/opengles.texture_format.ptc +http://tizen.org/feature/opengles.texture_format.pvrtc +http://tizen.org/feature/opengles.texture_format.utc +http://tizen.org/feature/opengles +http://tizen.org/feature/opengles.version.1_1 +http://tizen.org/feature/opengles.version.2_0 +http://tizen.org/feature/platform.core.cpu.arch.x86 +http://tizen.org/feature/platform.core.fpu.arch.sse2 +http://tizen.org/feature/sensor.accelerometer +http://tizen.org/feature/sensor.gyroscope +http://tizen.org/feature/sensor.magnetometer +http://tizen.org/feature/sensor.photometer +http://tizen.org/feature/sensor.proximity +http://tizen.org/feature/sensor.tiltmeter +http://tizen.org/feature/sip.voip +http://tizen.org/feature/speech.recognition +http://tizen.org/feature/speech.synthesis +http://tizen.org/feature/network.telephony +http://tizen.org/feature/network.telephony.service.umts +http://tizen.org/feature/usb.accessory +http://tizen.org/feature/usb.host +http://tizen.org/feature/network.push +http://tizen.org/feature/screen.size.normal +http://tizen.org/feature/screen.coordinate_system.size.normal +http://tizen.org/feature/screen.size.normal.720.1280 +http://tizen.org/feature/screen.coordinate_system.physical.normal_720x1280 +http://tizen.org/feature/screen.coordinate_system.logical.normal +http://tizen.org/system/build.string=Tizen_EMULATOR_20130406.1551 +http://tizen.org/feature/network.telephony.sms +http://tizen.org/feature/graphics.acceleration +http://tizen.org/feature/screen.auto_rotation +http://tizen.org/feature/network.telephony.mms diff --git a/data/capability_full.conf b/data/capability_full.conf new file mode 100644 index 0000000..8b26e0b --- /dev/null +++ b/data/capability_full.conf @@ -0,0 +1,69 @@ +#list up supported features. +#if a feature is not listed in this file, the feature is considered as unsupport feature. +http://tizen.org/feature/camera +http://tizen.org/feature/camera.back +http://tizen.org/feature/camera.back.flash +http://tizen.org/feature/camera.front +http://tizen.org/feature/camera.front.flash +http://tizen.org/feature/data.encryption +http://tizen.org/feature/fmradio +http://tizen.org/feature/input.keyboard +http://tizen.org/feature/input.keyboard.layout +http://tizen.org/feature/location +http://tizen.org/feature/location.gps +http://tizen.org/feature/location.wps +http://tizen.org/feature/microphone +http://tizen.org/feature/multi_point_touch.point_count +http://tizen.org/feature/network.bluetooth +http://tizen.org/feature/network.nfc +http://tizen.org/feature/network.nfc.reserved_push +http://tizen.org/feature/network.push +http://tizen.org/feature/network.telephony +http://tizen.org/feature/network.telephony.mms +http://tizen.org/feature/network.telephony.sms.cbs +http://tizen.org/feature/network.wifi +http://tizen.org/feature/network.wifi.direct +http://tizen.org/feature/opengles.texture_format.3dc +http://tizen.org/feature/opengles.texture_format.atc +http://tizen.org/feature/opengles.texture_format.etc +http://tizen.org/feature/opengles.texture_format.ptc +http://tizen.org/feature/opengles.texture_format.pvrtc +http://tizen.org/feature/opengles.texture_format.utc +http://tizen.org/feature/opengles.version.1_1 +http://tizen.org/feature/opengles.version.2_0 +http://tizen.org/feature/platform.core.cpu.arch.armv7 +http://tizen.org/feature/platform.core.fpu.arch.sse2 +http://tizen.org/feature/platform.core.fpu.arch.sse3 +http://tizen.org/feature/platform.core.fpu.arch.ssse3 +http://tizen.org/feature/platform.core.fpu.arch.vfpv2 +http://tizen.org/feature/platform.core.fpu.arch.vfpv3 +http://tizen.org/feature/platform.core.cpu.arch.x86 +http://tizen.org/feature/platform.native.api.version +http://tizen.org/feature/platform.version +http://tizen.org/feature/platform.web.api.version +http://tizen.org/feature/screen.size.normal +http://tizen.org/feature/screen.size.normal.480.800 +http://tizen.org/feature/screen.size.normal.720.1280 +http://tizen.org/feature/sensor.accelerometer +http://tizen.org/feature/sensor.accelerometer.wakeup +http://tizen.org/feature/sensor.barometer +http://tizen.org/feature/sensor.barometer.wakeup +http://tizen.org/feature/sensor.gyroscope +http://tizen.org/feature/sensor.gyroscope.wakeup +http://tizen.org/feature/sensor.magnetometer +http://tizen.org/feature/sensor.magnetometer.wakeup +http://tizen.org/feature/sensor.photometer +http://tizen.org/feature/sensor.photometer.wakeup +http://tizen.org/feature/sensor.proximity +http://tizen.org/feature/sensor.proximity.wakeup +http://tizen.org/feature/sensor.tiltmeter +http://tizen.org/feature/sensor.tiltmeter.wakeup +http://tizen.org/feature/shell.appwidget +http://tizen.org/feature/sip.voip +http://tizen.org/feature/speech.recognition +http://tizen.org/feature/speech.synthesis +http://tizen.org/feature/vision.image_recognition +http://tizen.org/feature/vision.qrcode_generation +http://tizen.org/feature/vision.qrcode_recognition +http://tizen.org/feature/vision.face_recognition +http://tizen.org/feature/usb.accessory diff --git a/data/capability_m0_modem.conf b/data/capability_m0_modem.conf new file mode 100644 index 0000000..182dee8 --- /dev/null +++ b/data/capability_m0_modem.conf @@ -0,0 +1,47 @@ +http://tizen.org/feature/network.bluetooth +http://tizen.org/feature/camera +http://tizen.org/feature/camera.back +http://tizen.org/feature/camera.back.flash +http://tizen.org/feature/camera.front +http://tizen.org/feature/location +http://tizen.org/feature/location.gps +http://tizen.org/feature/network.nfc +http://tizen.org/feature/opengles.texture_format.3dc +http://tizen.org/feature/opengles.texture_format.atc +http://tizen.org/feature/opengles.texture_format.etc +http://tizen.org/feature/opengles.texture_format.ptc +http://tizen.org/feature/opengles.texture_format.pvrtc +http://tizen.org/feature/opengles.texture_format.utc +http://tizen.org/feature/opengles +http://tizen.org/feature/opengles.version.1_1 +http://tizen.org/feature/opengles.version.2_0 +http://tizen.org/feature/platform.core.cpu.arch.armv7 +http://tizen.org/feature/platform.core.fpu.arch.vfpv3 +http://tizen.org/feature/screen.output.hdmi +http://tizen.org/feature/sensor.accelerometer +http://tizen.org/feature/sensor.accelerometer.wakeup +http://tizen.org/feature/sensor.barometer +http://tizen.org/feature/sensor.gyroscope +http://tizen.org/feature/sensor.magnetometer +http://tizen.org/feature/sensor.photometer +http://tizen.org/feature/sensor.proximity +http://tizen.org/feature/sensor.tiltmeter +http://tizen.org/feature/sip.voip +http://tizen.org/feature/speech.recognition +http://tizen.org/feature/speech.synthesis +http://tizen.org/feature/usb.accessory +http://tizen.org/feature/usb.host +http://tizen.org/feature/network.wifi +http://tizen.org/feature/network.wifi.direct +http://tizen.org/feature/network.push +http://tizen.org/feature/screen.size.normal +http://tizen.org/feature/screen.coordinate_system.size.normal +http://tizen.org/feature/screen.size.normal.720.1280 +http://tizen.org/feature/screen.coordinate_system.physical.normal_720x1280 +http://tizen.org/feature/screen.coordinate_system.logical.normal +http://tizen.org/system/build.string=Tizen_Ref.Device-PQ_20130408.1842 +http://tizen.org/feature/graphics.acceleration +http://tizen.org/feature/screen.auto_rotation +http: //tizen.org/feature/network.telephony +http: //tizen.org/feature/network.telephony.mms +http: //tizen.org/feature/network.telephony.sms.cbs diff --git a/data/capability_m0_nomodem.conf b/data/capability_m0_nomodem.conf new file mode 100644 index 0000000..c17916e --- /dev/null +++ b/data/capability_m0_nomodem.conf @@ -0,0 +1,44 @@ +http://tizen.org/feature/network.bluetooth +http://tizen.org/feature/camera +http://tizen.org/feature/camera.back +http://tizen.org/feature/camera.back.flash +http://tizen.org/feature/camera.front +http://tizen.org/feature/location +http://tizen.org/feature/location.gps +http://tizen.org/feature/network.nfc +http://tizen.org/feature/opengles.texture_format.3dc +http://tizen.org/feature/opengles.texture_format.atc +http://tizen.org/feature/opengles.texture_format.etc +http://tizen.org/feature/opengles.texture_format.ptc +http://tizen.org/feature/opengles.texture_format.pvrtc +http://tizen.org/feature/opengles.texture_format.utc +http://tizen.org/feature/opengles +http://tizen.org/feature/opengles.version.1_1 +http://tizen.org/feature/opengles.version.2_0 +http://tizen.org/feature/platform.core.cpu.arch.armv7 +http://tizen.org/feature/platform.core.fpu.arch.vfpv3 +http://tizen.org/feature/screen.output.hdmi +http://tizen.org/feature/sensor.accelerometer +http://tizen.org/feature/sensor.accelerometer.wakeup +http://tizen.org/feature/sensor.barometer +http://tizen.org/feature/sensor.gyroscope +http://tizen.org/feature/sensor.magnetometer +http://tizen.org/feature/sensor.photometer +http://tizen.org/feature/sensor.proximity +http://tizen.org/feature/sensor.tiltmeter +http://tizen.org/feature/sip.voip +http://tizen.org/feature/speech.recognition +http://tizen.org/feature/speech.synthesis +http://tizen.org/feature/usb.accessory +http://tizen.org/feature/usb.host +http://tizen.org/feature/network.wifi +http://tizen.org/feature/network.wifi.direct +http://tizen.org/feature/network.push +http://tizen.org/feature/screen.size.normal +http://tizen.org/feature/screen.coordinate_system.size.normal +http://tizen.org/feature/screen.size.normal.720.1280 +http://tizen.org/feature/screen.coordinate_system.physical.normal_720x1280 +http://tizen.org/feature/screen.coordinate_system.logical.normal +http://tizen.org/system/build.string=Tizen_Ref.Device-PQ_20130408.1842 +http://tizen.org/feature/graphics.acceleration +http://tizen.org/feature/screen.auto_rotation diff --git a/gen_priv_pkg.sh b/gen_priv_pkg.sh new file mode 100755 index 0000000..b58c8af --- /dev/null +++ b/gen_priv_pkg.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +check_error() +{ + if [ "$1" -ne "0" ]; then + echo "=============================================================" + echo "ERROR : $2 - exit code ($1) " + echo "=============================================================" + exit $1 + fi +} +current_path=$PWD + +arch_arg=$1 + +if [ "$arch_arg" == "i" ]; then + arch=i586 +else + arch=armv7el +fi + +if [ -d ${current_path}/binaries_$arch ]; then + rm -rf ${current_path}/binaries_$arch +fi + +echo "$arch at Tizen:2.1:Test" +osc -c ~/oscrc_tizendev getbinaries Tizen:2.1:Test apps.FtApp standard $arch +check_error $? "Fail to push FtApp rpm package" + +cd ${current_path}/binaries +unrpm apps.FtApp-1.* +cd ${current_path}/binaries/opt/usr/apps/2s4jm6firv +cp ${current_path}/author-signature.xml ${current_path}/signature1.xml ./ + +sed -i 's/2.1/>2.0/g' ${current_path}/binaries/opt/usr/apps/2s4jm6firv/info/manifest.xml +zip -r ../FtAppCompat.zip bin data info lib res shared author-signature.xml signature1.xml +mv ../FtAppCompat.zip ../FtAppCompat.tpk +chmod +x ../FtAppCompat.tpk + +sed -i /\/d ${current_path}/binaries/opt/usr/apps/2s4jm6firv/info/manifest.xml +sed -i 's/2.0/>2.1/g' ${current_path}/binaries/opt/usr/apps/2s4jm6firv/info/manifest.xml +zip -r ../FtApp.zip bin data info lib res shared author-signature.xml signature1.xml +mv ../FtApp.zip ../FtApp.tpk +chmod +x ../FtApp.tpk + +while read line +do + sed -i /\/d ${current_path}/binaries/opt/usr/apps/2s4jm6firv/info/manifest.xml + tmp="http://tizen.org/privilege/$line" + cmd=" /$/ a $tmp" + cmd2="" + sed -i "${cmd}${cmd2}" ${current_path}/binaries/opt/usr/apps/2s4jm6firv/info/manifest.xml + zip -r ../FtApp-$line.zip bin data info lib res shared author-signature.xml signature1.xml + mv ../FtApp-$line.zip ../FtApp-$line.tpk + chmod +x ../FtApp-$line.tpk +done < ${current_path}/privilege.list + +mv ${current_path}/binaries ${current_path}/binaries_$arch + diff --git a/inc/FtApp.h b/inc/FtApp.h new file mode 100644 index 0000000..ddaaa52 --- /dev/null +++ b/inc/FtApp.h @@ -0,0 +1,75 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 _FTAPP_H_ +#define _FTAPP_H_ + +#include +#include +#include +#include + +/** + * [FtApp] UiApp must inherit from UiApp class + * which provides basic features necessary to define an UiApp. + */ +class FtApp + : public Tizen::App::UiApp + , public Tizen::System::IScreenEventListener +{ +public: + /** + * [Test] UiApp must have a factory method that creates an instance of itself. + */ + static Tizen::App::UiApp* CreateInstance(void); + +public: + FtApp(); + ~FtApp(); + +public: + // Called when the UiApp is initializing. + bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry); + + // Called when the UiApp initializing is finished. + bool OnAppInitialized(void); + + // Called when the UiApp is requested to terminate. + bool OnAppWillTerminate(void); + + // Called when the UiApp is terminating. + bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false); + + // Called when the UiApp's frame moves to the top of the screen. + void OnForeground(void); + + // Called when this UiApp's frame is moved from top of the screen to the background. + void OnBackground(void); + + // Called when the system memory is not sufficient to run the UiApp any further. + void OnLowMemory(void); + + // Called when the battery level changes. + void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel); + + // Called when the screen turns on. + void OnScreenOn(void); + + // Called when the screen turns off. + void OnScreenOff(void); +}; + +#endif diff --git a/inc/FtAppForm.h b/inc/FtAppForm.h new file mode 100644 index 0000000..4913dcc --- /dev/null +++ b/inc/FtAppForm.h @@ -0,0 +1,40 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 _FTAPPFORM_H_ +#define _FTAPPFORM_H_ + +#include +#include + +class FtAppForm + : public Tizen::Ui::Controls::Form +{ + +// Construction +public: + FtAppForm(void); + virtual ~FtAppForm(void); + bool Initialize(void); + + +public: + virtual result OnInitializing(void); + virtual result OnTerminating(void); + +}; + +#endif //_FTAPPFORM_H_ diff --git a/inc/FtAppFrame.h b/inc/FtAppFrame.h new file mode 100644 index 0000000..bb98682 --- /dev/null +++ b/inc/FtAppFrame.h @@ -0,0 +1,49 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 _FTAPPFRAME_H_ +#define _FTAPPFRAME_H_ + +#include +#include +#include + +class FtAppFrame + : public Tizen::Ui::Controls::Frame + , public Tizen::Base::Runtime::ITimerEventListener + , public Tizen::Ui::IWindowEventListener +{ + +// Construction +public: + FtAppFrame(void); + virtual ~FtAppFrame(void); + +// Implementation +protected: +public: + virtual result OnInitializing(void); + virtual result OnTerminating(void); + + virtual void OnWindowActivated(const Tizen::Ui::Window& source); + virtual void OnWindowDeactivated(const Tizen::Ui::Window& source); + virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer); + +private: + Tizen::Base::Runtime::Timer __timer; +}; + +#endif //_FTAPPFRAME_H_ diff --git a/inc/FtConfParser.h b/inc/FtConfParser.h new file mode 100644 index 0000000..0f77f5d --- /dev/null +++ b/inc/FtConfParser.h @@ -0,0 +1,92 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 _FT_CONF_PARSER_H_ +#define _FT_CONF_PARSER_H_ + +#include +#include +#include +#include + +#define MAX_VER_PLACE 5 + +using namespace Tizen::Io; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +extern bool gRetryFlag; + +class FtConfParser +{ +public: + FtConfParser(const String& confFilePath, const String& logPath, const String& versionString); + ~FtConfParser(void); + + void ReadLogFile(String& logPath); + bool LoadConf(void); + void SetShowLog(bool& showLog); + void GetCrashData(bool& crashedFlag, int& tsCount, int& tcCount); + bool ParseConfig(void); + void FilterOutExecutedTcBeforeCrash(void); + void FilterTcByCapability(const IList* pCapabilities); + Tizen::Base::Collection::ArrayListT< String >& GetSoFileList(void); + Tizen::Base::Collection::HashMap& GetTsInfoMap(void); + Tizen::Base::Collection::HashMap& GetTcInfoMap(void); + Tizen::Base::Collection::HashMap& GetCustomKeyValueMap(void); + +private: + bool IsComment(const Tizen::Base::String& buff, const Tizen::Base::String& strBuff); + void ClearConfList(void); + bool ClearAndCreateLogFile(void); + void ParseConfigTestSuiteCase(String& strBuff, bool& isFirstTcAfterCrash); + void ParseTestCaseInfo(const String& strBuff, String& tcName, int& loop, String& versionStr, String& features); + void SaveCustomKeyValueMap(); + + // For filtering tests based on version. + bool CheckVersion(const String& versionString); + void ParseToVersionIntegers(const String& verString, int verInfo[]); + void ParseVersionRange(const String& verString, int verLower[], int verUpper[]); + bool VersionEquals(const int verInfo[], const int verEqualTo[]); + bool VersionBetween(const int verInfo[], const int verLower[], const int verUpper[]); + +private: + bool __bMultiComments; + bool __crashedFlag; + bool __bDllLoad; + bool __isCompatMode; + int __crashedTsCount; + int __crashedTcCount; + int __dllCount; + int __dllEndCount; + int __dllStartCount; + String __confFilePath; + String __logPath; + String __crashedTsName; + String __crashedTcName; + String __firstSuiteName; + ArrayListT< String > __confEachLineList; + ArrayListT< String > __soFileList; + HashMap __tcInfoMap; + HashMap __tsInfoMap; + HashMap __mapExecutedTcBeforeCrashed; + HashMap __customKeyValueMap; + int __executedVerInfo[MAX_VER_PLACE]; +}; + + +#endif /* FTCONFPARSER_H_ */ diff --git a/inc/FtConfiguration.h b/inc/FtConfiguration.h new file mode 100644 index 0000000..1b7861c --- /dev/null +++ b/inc/FtConfiguration.h @@ -0,0 +1,79 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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. +// +/** + * @file FtConfiguration.h + */ + +#ifndef FTCONFIGURATION_H_ +#define FTCONFIGURATION_H_ + + +#include "FIo.h" +#include "FBase.h" +#include "FBaseCol.h" +#include "TestUtils.h" +#include "FBaseRtLibrary.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Io; + +#define FTAPP_CONFIG_FILE L"data/FtApp.ini" + +class FtConfiguration +{ +public: + FtConfiguration(); + ~FtConfiguration(); + + static FtConfiguration* Instance() + { + static FtConfiguration* pInstance = AllocateInstance(); + return pInstance; + } + ; + + static FtConfiguration* AllocateInstance() + { + FtConfiguration* pInstance = new FtConfiguration(); + return pInstance; + } + ; + + static void ReleaseInstance() + { + FtConfiguration* pInstance = Instance(); + if (pInstance) + { + delete pInstance; + pInstance = NULL; + } + } + ; + +public: + Registry reg; + + +public: + void LoadConfig(); + const String GetValue(const String& key); + + +}; + +#endif /* FTCONFIGURATION_H_ */ diff --git a/inc/FtDeviceCapability.h b/inc/FtDeviceCapability.h new file mode 100644 index 0000000..7acfa29 --- /dev/null +++ b/inc/FtDeviceCapability.h @@ -0,0 +1,36 @@ +// +// Open Service Platform +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 _FT_DEVICE_CAPABILITY_H_ +#define _FT_DEVICE_CAPABILITY_H_ + +#include +#include +#include +#include + +class FtDeviceCapability +{ +public: + static bool LoadConf(const Tizen::Base::String& confFilePath, Tizen::Base::Collection::ArrayList& supportList); + +private: + FtDeviceCapability(void); + ~FtDeviceCapability(void); +}; + +#endif diff --git a/inc/FtSoExecutor.h b/inc/FtSoExecutor.h new file mode 100644 index 0000000..2c4c320 --- /dev/null +++ b/inc/FtSoExecutor.h @@ -0,0 +1,130 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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. +// +/** + * @file FtSoExecutor.h + */ + +#ifndef _FT_SO_EXECUTOR_H_ +#define _FT_SO_EXECUTOR_H_ + +// Add +#include "TestUtils.h" +#include "FtConfParser.h" + +#include +#include +#include +#include +#include +#include + + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Io; + +class CFtSoExecutor +{ + +//public: + +// con & decon +public: + CFtSoExecutor(); + ~CFtSoExecutor(); + + static CFtSoExecutor* Instance() + { + static CFtSoExecutor* pInstance = AllocateInstance(); + return pInstance; + } + ; + + static CFtSoExecutor* AllocateInstance() + { + CFtSoExecutor* pInstance = new CFtSoExecutor(); + return pInstance; + } + ; + + static void ReleaseInstance() + { + CFtSoExecutor* pInstance = Instance(); + if (pInstance) + { + delete pInstance; + pInstance = NULL; + } + } + ; + + inline char* GetCStringN(String src) + { + char* pSrcStr = new char[src.GetLength() + 1]; + wcstombs(pSrcStr, src.GetPointer(), src.GetLength()); + pSrcStr[src.GetLength()] = '\0'; + return pSrcStr; + } + + void Start(); + bool LoadConf(); + bool ParseConfigAndExecuteTest(); + void LogToUi(const Tizen::Base::String& msg); + void WriteLog(Tizen::Base::String str); + void ExecuteTest(); + + +private: + bool HasNoMeaning(String buff, String strBuff); + bool IsMode(String& buff); + void ClearConfList(); + + bool RunTestSo(); + bool LoadSo(String soPath); + bool UnloadSo(); + bool ClearAndCreateLogFile(); + void PrintTimeInfo(); + void ReadLogFile(); + bool LoadConfRetry(); + bool LoadVersion(); + +private: + String __logPath; + String __logFileName; + + bool __bMultiComments; + bool __bDllLoad; + int __testMode; + bool __crashedFlag; + int __crashedTsCount; + int __crashedTcCount; + int __dllEndCount; + int __dllStartCount; + + ArrayListT< String > __confList; + String __preTSMode; + String __currentTS; + + String __testSuiteName; + + FtConfParser* __pParser; + Tizen::Base::Runtime::Library* __pLib; + Tizen::Ui::Controls::TextBox* __pTextBox; + bool __showLogFlag; +}; + +#endif //__FT_SO_EXECUTOR_H__ diff --git a/inc/TestUtils.h b/inc/TestUtils.h new file mode 100644 index 0000000..994ecd3 --- /dev/null +++ b/inc/TestUtils.h @@ -0,0 +1,46 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 TESTUTILS_H_ +#define TESTUTILS_H_ + +#include +#include +#include + +class TestUtils +{ +public: + TestUtils(); + virtual ~TestUtils(); + + /* IsSubStrEqual Compares up to num characters of the String Str1 to those of the String Str2 */ + static bool IsSubStrEqual(const Tizen::Base::String& Str1, const Tizen::Base::String& Str2, int size); + + /* StrContains checks whether SearchSubStr is present in CompleteStr */ + static bool StrContains(const Tizen::Base::String& CompleteStr, const Tizen::Base::String& SearchSubStr); + + /* FindFirstIndex returns the index of first occurrence of SearchSubStr in CompleteStr, starting from startIndex. If not occured, returns -1 */ + static int FindFirstIndex(const Tizen::Base::String& CompleteStr, const Tizen::Base::String& SearchSubStr, int startIndex); + + static Tizen::Base::String GetFirstToken(const Tizen::Base::String& CompleteStr, const Tizen::Base::String& SeparatorStr); + + static bool IsMeaningfulToParse(Tizen::Base::String& strBuff); + static bool IsModeToken(const Tizen::Base::String& strBuff); + +}; + +#endif /* TESTUTILS_H_ */ diff --git a/inc/TsTcInfo.h b/inc/TsTcInfo.h new file mode 100644 index 0000000..e9a5132 --- /dev/null +++ b/inc/TsTcInfo.h @@ -0,0 +1,99 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 _TS_TC_INFO_H_ +#define _TS_TC_INFO_H_ + +#include +#include +#include +#include + +using namespace Tizen::Io; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +const int MAX_VALUE = 1000; + +class TcInfo + : public Tizen::Base::Object +{ + + //Constructor and destructor +public: + //This is a default constructor for this class. + TcInfo(void); + + //This is the destructor for this class. + ~TcInfo(void); + + void SetOptionalFeatures(const String& features); + + virtual bool Equals(const Object& obj) const; + virtual int GetHashCode(void) const; + + // Operator + //Overload the assignment operator. + TcInfo& operator =(const TcInfo& rhs); + + //Overload the equivalent operator. + bool operator ==(const TcInfo& rhs) const; + + //Overload the not equivalent operator. + bool operator !=(const TcInfo& rhs) const; + +public: + String tsName; + String tcName; + int repeatCount; + String version; + ArrayList supportedFeaturesToRun; + ArrayList unsupportedFeaturesToRun; +}; + + +class TsInfo + : public Tizen::Base::Object +{ + + //Constructor and destructor +public: + //This is a default constructor for this class. + TsInfo(void); + + //This is the destructor for this class. + ~TsInfo(void); + + virtual bool Equals(const Object& obj) const; + virtual int GetHashCode(void) const; + + // Operator + //Overload the assignment operator. + TsInfo& operator =(const TsInfo& rhs); + + //Overload the equivalent operator. + bool operator ==(const TsInfo& rhs) const; + + //Overload the not equivalent operator. + bool operator !=(const TsInfo& rhs) const; + +public: + String tsName; + int repeatCount; +}; + +#endif diff --git a/lib/.gitignore b/lib/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/lib/gtest/arm/libgtest.so.0 b/lib/gtest/arm/libgtest.so.0 new file mode 120000 index 0000000..52abfb7 --- /dev/null +++ b/lib/gtest/arm/libgtest.so.0 @@ -0,0 +1 @@ +libgtest.so.0.0.0 \ No newline at end of file diff --git a/lib/gtest/arm/libgtest.so.0.0.0 b/lib/gtest/arm/libgtest.so.0.0.0 new file mode 100755 index 0000000..b78f453 Binary files /dev/null and b/lib/gtest/arm/libgtest.so.0.0.0 differ diff --git a/lib/gtest/x86/libgtest.so.0 b/lib/gtest/x86/libgtest.so.0 new file mode 120000 index 0000000..52abfb7 --- /dev/null +++ b/lib/gtest/x86/libgtest.so.0 @@ -0,0 +1 @@ +libgtest.so.0.0.0 \ No newline at end of file diff --git a/lib/gtest/x86/libgtest.so.0.0.0 b/lib/gtest/x86/libgtest.so.0.0.0 new file mode 100755 index 0000000..c5e2703 Binary files /dev/null and b/lib/gtest/x86/libgtest.so.0.0.0 differ diff --git a/manifest.xml b/manifest.xml new file mode 100755 index 0000000..b34c2b9 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,145 @@ + + + 2s4jm6firv + 1.0.0 + C++App + + + + + + x86 + vfpv3 + + + 2.1 + + http://tizen.org/privilege/privilegemanager.read + http://tizen.org/privilege/privacymanager.read + http://tizen.org/privilege/privacymanager.write + http://tizen.org/privilege/appwidgetprovider.install + http://tizen.org/privilege/shortcut.install + http://tizen.org/privilege/lockmanager + http://tizen.org/privilege/certificate.read + http://tizen.org/privilege/web.service + http://tizen.org/privilege/messaging.mms + http://tizen.org/privilege/callhistory.read + http://tizen.org/privilege/alarm + http://tizen.org/privilege/network.connection + http://tizen.org/privilege/content.write + http://tizen.org/privilege/nfc.admin + http://tizen.org/privilege/systeminfo + http://tizen.org/privilege/nfc.tag + http://tizen.org/privilege/appsetting + http://tizen.org/privilege/network.statistics.read + http://tizen.org/privilege/customnetaccount + http://tizen.org/privilege/packagesetting + http://tizen.org/privilege/nfc.p2p + http://tizen.org/privilege/application.kill + http://tizen.org/privilege/useridentity + http://tizen.org/privilege/audiorecorder + http://tizen.org/privilege/bluetooth.admin + http://tizen.org/privilege/camera + http://tizen.org/privilege/callforward + http://tizen.org/privilege/appusage + http://tizen.org/privilege/messaging.email + http://tizen.org/privilege/smstrigger + http://tizen.org/privilege/packageinfo + http://tizen.org/privilege/audiomanager.voipsession + http://tizen.org/privilege/bluetooth.health + http://tizen.org/privilege/packagemanager.install + http://tizen.org/privilege/web.privacy + http://tizen.org/privilege/calendar.read + http://tizen.org/privilege/content.read + http://tizen.org/privilege/socket + http://tizen.org/privilege/wifi.wifidirect.admin + http://tizen.org/privilege/bluetooth.spp + http://tizen.org/privilege/notification + http://tizen.org/privilege/systemsetting.write + http://tizen.org/privilege/drmservice + http://tizen.org/privilege/dns + http://tizen.org/privilege/audiomanager.route + http://tizen.org/privilege/wifi.read + http://tizen.org/privilege/location + http://tizen.org/privilege/videorecorder + http://tizen.org/privilege/application.launch + http://tizen.org/privilege/power + http://tizen.org/privilege/contact.write + http://tizen.org/privilege/push + http://tizen.org/privilege/bluetooth.gap + http://tizen.org/privilege/ime + http://tizen.org/privilege/imemanager + http://tizen.org/privilege/systemsetting.read + http://tizen.org/privilege/network.account + http://tizen.org/privilege/wifi.wifidirect.read + http://tizen.org/privilege/nfc.common + http://tizen.org/privilege/setting + http://tizen.org/privilege/wifi.admin + http://tizen.org/privilege/telephonymanager + http://tizen.org/privilege/calendar.write + http://tizen.org/privilege/callhistory.write + http://tizen.org/privilege/contact.read + http://tizen.org/privilege/inputmanager + http://tizen.org/privilege/bluetoothmanager + http://tizen.org/privilege/wappush + http://tizen.org/privilege/bluetooth.opp + http://tizen.org/privilege/http + http://tizen.org/privilege/cellbroadcast + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/messaging.sms + http://tizen.org/privilege/vibrator + http://tizen.org/privilege/uimanager + http://tizen.org/privilege/network.statistics.write + http://tizen.org/privilege/netstatisticsmanager + http://tizen.org/privilege/network.statistics + http://tizen.org/privilege/audiomanager.session + http://tizen.org/privilege/notificationmanager + http://tizen.org/privilege/download + http://tizen.org/privilege/networkmanager + http://tizen.org/privilege/certificate.write + http://tizen.org/privilege/platforminfo + http://tizen.org/privilege/telephony + http://tizen.org/privilege/account.read + http://tizen.org/privilege/account.write + http://tizen.org/privilege/userprofile.read + http://tizen.org/privilege/userprofile.write + http://tizen.org/privilege/wifimanager + http://tizen.org/privilege/geolocationpermission.read + http://tizen.org/privilege/geolocationpermission.write + http://tizen.org/privilege/bookmark.read + http://tizen.org/privilege/bookmark.write + http://tizen.org/privilege/nfcmanager + + + + + + FtApp + + + mainmenu.png + + + + + account_icon.png + account_icon_small.png + + + AccountTest + + + http://tizen.org/account/capability/contact + + + + + + metadata-value + Test + Arch + + + + + diff --git a/oscrc_tizendev b/oscrc_tizendev new file mode 100644 index 0000000..ee365c9 --- /dev/null +++ b/oscrc_tizendev @@ -0,0 +1,123 @@ +[general] +# URL to access API server, e.g. https://api.tizendev.org +# you also need a section [https://api.tizendev.org] with the credentials +apiurl = https://api.tizendev.org +# Downloaded packages are cached here. Must be writable by you. +#packagecachedir = /var/tmp/osbuild-packagecache +# Wrapper to call build as root (sudo, su -, ...) +#su-wrapper = sudo +# rootdir to setup the chroot environment +# can contain %(repo)s, %(arch)s, %(project)s, %(package)s and %(apihost)s (apihost is the hostname +# extracted from currently used apiurl) for replacement, e.g. +# /srv/oscbuild/%(repo)s-%(arch)s or +# /srv/oscbuild/%(repo)s-%(arch)s-%(project)s-%(package)s +#build-root = /var/tmp/build-root +# compile with N jobs (default: "getconf _NPROCESSORS_ONLN") +#build-jobs = N +# build-type to use - values can be (depending on the capabilities of the 'build' script) +# empty - chroot build +# kvm - kvm VM build (needs build-device, build-swap, build-memory) +# xen - xen VM build (needs build-device, build-swap, build-memory) +# experimental: +# qemu - qemu VM build +# lxc - lxc build +#build-type = +# build-device is the disk-image file to use as root for VM builds +# e.g. /var/tmp/FILE.root +#build-device = /var/tmp/FILE.root +# build-swap is the disk-image to use as swap for VM builds +# e.g. /var/tmp/FILE.swap +#build-swap = /var/tmp/FILE.swap +# build-memory is the amount of memory used in the VM +# value in MB - e.g. 512 +#build-memory = 512 +# build-vmdisk-rootsize is the size of the disk-image used as root in a VM build +# values in MB - e.g. 4096 +#build-vmdisk-rootsize = 4096 +# build-vmdisk-swapsize is the size of the disk-image used as swap in a VM build +# values in MB - e.g. 1024 +#build-vmdisk-swapsize = 1024 +# build-vmdisk-filesystem is the file system type of the disk-image used in a VM build +# values are ext3(default) ext4 xfs reiserfs btrfs +#build-vmdisk-filesystem = ext4 +# Numeric uid:gid to assign to the "abuild" user in the build-root +# or "caller" to use the current users uid:gid +# This is convenient when sharing the buildroot with ordinary userids +# on the host. +# This should not be 0 +# build-uid = +# extra packages to install when building packages locally (osc build) +# this corresponds to osc build's -x option and can be overridden with that +# -x '' can also be given on the command line to override this setting, or +# you can have an empty setting here. +#extra-pkgs = vim gdb strace +# build platform is used if the platform argument is omitted to osc build +#build_repository = openSUSE_Factory +# default project for getpac or bco +#getpac_default_project = openSUSE:Factory +# alternate filesystem layout: have multiple subdirs, where colons were. +#checkout_no_colon = 0 +# change filesystem layout: avoid checkout within a project or package dir. +#checkout_rooted = 0 +# local files to ignore with status, addremove, .... +#exclude_glob = .osc CVS .svn .* _linkerror *~ #*# *.orig *.bak *.changes.vctmp.* +# keep passwords in plaintext. +# Set to 0 to obfuscate passwords. It's no real security, just +# prevents most people from remembering your password if they watch +# you editing this file. +plaintext_passwd = 1 +# limit the age of requests shown with 'osc req list'. +# this is a default only, can be overridden by 'osc req list -D NNN' +# Use 0 for unlimted. +#request_list_days = 0 +# show info useful for debugging +#debug = 1 +# show HTTP traffic useful for debugging +#http_debug = 1 +# number of retries on HTTP transfer +#http_retries = 3 +# Skip signature verification of packages used for build. +#no_verify = 1 +# jump into the debugger in case of errors +#post_mortem = 1 +# print call traces in case of errors +#traceback = 1 +# use KDE/Gnome/MacOS/Windows keyring for credentials if available +use_keyring = 0 +# check for unversioned/removed files before commit +#check_filelist = 1 +# check for pending requests after executing an action (e.g. checkout, update, commit) +#check_for_request_on_action = 0 +# what to do with the source package if the submitrequest has been accepted. If +# nothing is specified the API default is used +#submitrequest_on_accept_action = cleanup|update|noupdate +# template for an accepted submitrequest +#submitrequest_accepted_template = Hi %(who)s,\n +# thanks for working on:\t%(tgt_project)s/%(tgt_package)s. +# SR %(reqid)s has been accepted.\n\nYour maintainers +# template for a declined submitrequest +#submitrequest_declined_template = Hi %(who)s,\n +# sorry your SR %(reqid)s (request type: %(type)s) for +# %(tgt_project)s/%(tgt_package)s has been declined because... +#review requests interactively (default: off) +#request_show_review = 1 +# if a review is accepted in interactive mode and a group +# was specified the review will be accepted for this group (default: off) +#review_inherit_group = 1 + +[https://api.tizendev.org] +user=obs_viewer +pass=obs_viewer +sslcertck=0 +# set aliases for this apiurl +# aliases = foo, bar +# email used in .changes, unless the one from osc meta prj will be used +# email = +# additional headers to pass to a request, e.g. for special authentication +#http_headers = Host: foofoobar, +# User: mumblegack +# Plain text password +#pass = +# Force using of keyring for this API +#keyring = 1 +trusted_prj=Tizen:Base Tizen:2.1:Base diff --git a/packaging/apps.FtApp.spec b/packaging/apps.FtApp.spec new file mode 100755 index 0000000..d835519 --- /dev/null +++ b/packaging/apps.FtApp.spec @@ -0,0 +1,76 @@ +%define debug_package %{nil} +%define __strip /bin/true + +Name: apps.FtApp +Summary: FtApp application +Version: 1.2.1.0 +Release: 1 +Group: TO_BE/FILLED_IN +License: TO BE FILLED IN +Source0: %{name}-%{version}.tar.gz +BuildRequires: cmake +BuildRequires: pkgconfig(osp-appfw) +BuildRequires: pkgconfig(osp-uifw) +BuildRequires: osp-appfw-internal-devel +BuildRequires: osp-uifw-internal-devel +BuildRequires: pkgconfig(osp-uifw) +BuildRequires: osp-uifw-internal-devel +BuildRequires: pkgconfig(osp-image-core) +BuildRequires: osp-image-core-internal-devel +BuildRequires: pkgconfig(chromium) +BuildRequires: pkgconfig(minizip) + + +%description +FtApp application + +%package debug +Summary: FtApp application (Development) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description debug +FtApp application (DEV) + +%prep +%setup -q + +%build +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +%ifarch %{ix86} +CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=x86 +%else +CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=arm +%endif + +# Call make instruction with smp support +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +%make_install + +%post +rm -f /etc/ld.so.cache +%ifarch %{ix86} +echo "/opt/usr/apps/2s4jm6firv/lib/gtest/x86" > /etc/ld.so.conf.d/FtApp.conf +%else +echo "/opt/usr/apps/2s4jm6firv/lib/gtest/arm" > /etc/ld.so.conf.d/FtApp.conf +%endif +/sbin/ldconfig +APP_ID=2s4jm6firv +echo "pkgcmd -q -i -t tpk -p /opt/usr/apps/"${APP_ID} +pkgcmd -q -i -t tpk -p /opt/usr/apps/${APP_ID} + +%postun +/bin/rm -f /etc/ld.so.cache +/sbin/ldconfig +APP_ID=2s4jm6firv +echo "/usr/etc/package-manager/backend/tpk -u "${APP_ID} +/usr/etc/package-manager/backend/tpk -u ${APP_ID} + +%files +/opt/usr/apps/* + +%files debug +/opt/usr/apps/debug/* diff --git a/privilege.list b/privilege.list new file mode 100644 index 0000000..3267f71 --- /dev/null +++ b/privilege.list @@ -0,0 +1,111 @@ +account.read +account.write +alarm +antivirus +application.kill +application.launch +appmanager.certificate +appmanager.kill +appmanager.launch +appsetting +appusage +appwidgetprovider.install +audiomanager.route +audiorecorder +bluetooth.admin +bluetooth.gap +bluetooth.health +bluetooth.opp +bluetooth.spp +bluetoothmanager +bookmark.read +bookmark.write +calendar.read +calendar.write +callforward +callhistory.read +callhistory.write +camera +cellbroadcast +certificate.read +certificate.write +contact.read +contact.write +content.read +content.write +customnetaccount +datacontrol.consumer +datasync +dns +download +drmservice +filesystem.read +filesystem.write +geolocationpermission.read +geolocationpermission.write +http +ime +imemanager +inputmanager +internet +location +lockmanager +messageport +messaging.email +messaging.mms +messaging.read +messaging.sms +messaging.write +netstatisticsmanager +network.account +network.connection +network.statistics +network.statistics.read +networkbearerselection +networkmanager +nfc.admin +nfc.common +nfc.p2p +nfc.tag +nfcmanager +notification +notificationmanager +package.info +packageinfo +packagemanager.info +packagemanager.install +packagemanager.setting +packagesetting +platforminfo +power +privacymanager.read +privacymanager.write +privilegemanager.read +push +setting +settingmanager +settingmanager +shortcut.install +smstrigger +socket +system +systeminfo +systemmanager +systemsetting.read +systemsetting.write +telephony +telephonymanager +uimanager +useridentity +userprofile.read +userprofile.write +vibrator +videorecorder +wappush +web.privacy +web.service +wifi.admin +wifi.read +wifi.wifidirect.admin +wifi.wifidirect.read +wifimanager \ No newline at end of file diff --git a/res/eng-GB.xml b/res/eng-GB.xml new file mode 100644 index 0000000..bb2b764 --- /dev/null +++ b/res/eng-GB.xml @@ -0,0 +1,7 @@ + + + + UTsAppResource + diff --git a/res/font/Chococooky.ttf b/res/font/Chococooky.ttf new file mode 100644 index 0000000..bc7f553 Binary files /dev/null and b/res/font/Chococooky.ttf differ diff --git a/res/screen-density-high/icon_application.png b/res/screen-density-high/icon_application.png new file mode 100644 index 0000000..1b67a87 Binary files /dev/null and b/res/screen-density-high/icon_application.png differ diff --git a/res/screen-size-normal/IDF_FTAPPFORM.xml b/res/screen-size-normal/IDF_FTAPPFORM.xml new file mode 100644 index 0000000..edae2c2 --- /dev/null +++ b/res/screen-size-normal/IDF_FTAPPFORM.xml @@ -0,0 +1,30 @@ + + + + + + 480 +
+ + + + +
+ + +
+ + + + + + + + + + + + +
diff --git a/res/screen-size-normal/IDF_FTAPPPOPUP.xml b/res/screen-size-normal/IDF_FTAPPPOPUP.xml new file mode 100644 index 0000000..f994cd8 --- /dev/null +++ b/res/screen-size-normal/IDF_FTAPPPOPUP.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/shared/res/screen-density-xhigh/mainmenu.png b/shared/res/screen-density-xhigh/mainmenu.png new file mode 100644 index 0000000..983c883 Binary files /dev/null and b/shared/res/screen-density-xhigh/mainmenu.png differ diff --git a/shared/trusted/nofile.dummy b/shared/trusted/nofile.dummy new file mode 100644 index 0000000..e69de29 diff --git a/signature1.xml b/signature1.xml new file mode 100644 index 0000000..207c581 --- /dev/null +++ b/signature1.xml @@ -0,0 +1,72 @@ + + + + + + +6tJ9YuvJwrp722dwh24GQwD3D3nYykTgbuuMcd4N5ro= + + + + + + +u/jU3U4Zm5ihTMSjKGlGYbWzDfRkGphPPHx3gJIYEJ4= + + + +JVhFmNstbNqOH3gvyuUSyGTN8ubMo2/3z+qlP8TLTiYXKgdYGDuDqKL/LgaHHD3fIEdhL/fw/ctS +2gvfVFQQhjpt3hbP3DLEieVVQArTFFWkzxcXSJ0wsneOJSJCMaoU7QFLixrLgRCwkdF9yqhUBmWg +Zr2sHUwd4fjMueqB4uc= + + + + +MIICtzCCAiACCQCX7BAlwjllkTANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCS1IxDjAMBgNV +BAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6ZW4gVGVzdCBDQTEiMCAGA1UE +CwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEyMDAGA1UEAwwpVGl6ZW4gUGFydG5lci1NYW51 +ZmFjdHVyZXIgRGlzdHJpYnV0b3IgQ0EwHhcNMTIxMjEzMDU0NDI3WhcNMjIxMjExMDU0NDI3WjCB +oTELMAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwN +VGl6ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTE2MDQGA1UE +AwwtVGl6ZW4gUGFydG5lci1NYW51ZmFjdHVyZXIgRGlzdHJpYnV0b3IgU2lnbmVyMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQC2O0i2ou9Pa8KI+RVu6/1QAMichy8YqDtpM4cogiX+tYfafN/v +4l7q9sQdotaFPLWPR1HNtG6O6SKWZmM/Hp2U+S3vDeylEhex/IopWF9RZMPJFyKr9bJnlzTqiZuz +qItlXOZZBHhUL73v6OxqYg2BsA88jLtCoZWVAkoKDX93ZQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB +AJ5vn+dEhnZFuRdIMUt8TwQzXSxPMqNmR8+fcwwzAacxeOTgeK1C+DqE31vead/c8CVDMurZHQbs +qH/Ala6FomTm1q0uuM3Ll2qZaPkI3qr+h37YD4AI5scyIlP7ppApcdPRSkDgqfXkika62Q9M0+MN +nxl8+AvEukgC6qcd90oL + + +MIICtzCCAiACCQCX7BAlwjllkTANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCS1IxDjAMBgNV +BAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6ZW4gVGVzdCBDQTEiMCAGA1UE +CwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEyMDAGA1UEAwwpVGl6ZW4gUGFydG5lci1NYW51 +ZmFjdHVyZXIgRGlzdHJpYnV0b3IgQ0EwHhcNMTIxMjEzMDU0NDI3WhcNMjIxMjExMDU0NDI3WjCB +oTELMAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwN +VGl6ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTE2MDQGA1UE +AwwtVGl6ZW4gUGFydG5lci1NYW51ZmFjdHVyZXIgRGlzdHJpYnV0b3IgU2lnbmVyMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQC2O0i2ou9Pa8KI+RVu6/1QAMichy8YqDtpM4cogiX+tYfafN/v +4l7q9sQdotaFPLWPR1HNtG6O6SKWZmM/Hp2U+S3vDeylEhex/IopWF9RZMPJFyKr9bJnlzTqiZuz +qItlXOZZBHhUL73v6OxqYg2BsA88jLtCoZWVAkoKDX93ZQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB +AJ5vn+dEhnZFuRdIMUt8TwQzXSxPMqNmR8+fcwwzAacxeOTgeK1C+DqE31vead/c8CVDMurZHQbs +qH/Ala6FomTm1q0uuM3Ll2qZaPkI3qr+h37YD4AI5scyIlP7ppApcdPRSkDgqfXkika62Q9M0+MN +nxl8+AvEukgC6qcd90oL + + +MIICzzCCAjigAwIBAgIJAMNp1nbwir4GMA0GCSqGSIb3DQEBBQUAMIGiMQswCQYDVQQGEwJLUjEO +MAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSIw +IAYDVQQLDBlUaXplbiBEaXN0cmlidXRvciBUZXN0IENBMTcwNQYDVQQDDC5UaXplbiBQYXJ0bmVy +LU1hbnVmYWN0dXJlciBEaXN0cmlidXRvciBSb290IENBMB4XDTEyMTIxMzA1NDQyMFoXDTIyMTIx +MTA1NDQyMFowgZ0xCzAJBgNVBAYTAktSMQ4wDAYDVQQIDAVTdXdvbjEOMAwGA1UEBwwFU3V3b24x +FjAUBgNVBAoMDVRpemVuIFRlc3QgQ0ExIjAgBgNVBAsMGVRpemVuIERpc3RyaWJ1dG9yIFRlc3Qg +Q0ExMjAwBgNVBAMMKVRpemVuIFBhcnRuZXItTWFudWZhY3R1cmVyIERpc3RyaWJ1dG9yIENBMIGf +MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMni4Qmv96ww/De92kYhtzpas7viwyYoFTTuvcmayD +FBuDoaHqrSDsrb9M7qrR4N9higg1mT8a9J8CUhPLKhlifK9OwyQsZS+8xVfPfogIJ3wumfjLl5zi +nqpkSe2ernxOTU+PB5lWU8toKbnJO3+jchm14DjCQ4ZoqG26qbG5pQIDAQABoxAwDjAMBgNVHRME +BTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAA9lsDyArDR9balTfqrjN241nVqyLqPOP+MFRjGWrIlI +yLDcw2/L9hxguD8XhgAanaQUzS06XM6BajDjcSiJrohjoMFkB09M+r5fVkrhkT29oABsKXO87+p8 +JbbbIfdwMUrAjXsrjMUzJ3J6fn86/dn/PcuMAkCgrD069IzpE8NM + + + + + \ No newline at end of file diff --git a/src/FtApp.cpp b/src/FtApp.cpp new file mode 100644 index 0000000..ee7c4c7 --- /dev/null +++ b/src/FtApp.cpp @@ -0,0 +1,104 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 "FtApp.h" +#include "FtAppFrame.h" + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::System; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; + +FtApp::FtApp() +{ +} + +FtApp::~FtApp() +{ +} + +UiApp* +FtApp::CreateInstance(void) +{ + // Create the instance through the constructor. + return new FtApp(); +} + +bool +FtApp::OnAppInitializing(AppRegistry& appRegistry) +{ + // Create a Frame + FtAppFrame* pFtAppFrame = new FtAppFrame(); + pFtAppFrame->Construct(); + pFtAppFrame->SetName(L"FtApp"); + AddFrame(*pFtAppFrame); + + return true; +} + +bool +FtApp::OnAppInitialized(void) +{ + return true; +} + +bool +FtApp::OnAppWillTerminate(void) +{ + return true; +} + + +bool +FtApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination) +{ + return true; +} + +void +FtApp::OnForeground(void) +{ +} + +void +FtApp::OnBackground(void) +{ +} + +void +FtApp::OnLowMemory(void) +{ +} + +void +FtApp::OnBatteryLevelChanged(BatteryLevel batteryLevel) +{ +} + +void +FtApp::OnScreenOn(void) +{ +} + +void +FtApp::OnScreenOff(void) +{ + // TODO: + // Unless there is a strong reason to do otherwise, release resources (such as 3D, media, and sensors) to allow the device to enter the sleep mode to save the battery. + // Invoking a lengthy asynchronous method within this listener method can be risky, because it is not guaranteed to invoke a callback before the device enters the sleep mode. + // Similarly, do not perform lengthy operations in this listener method. Any operation must be a quick one. +} diff --git a/src/FtAppEntry.cpp b/src/FtAppEntry.cpp new file mode 100644 index 0000000..dd147ec --- /dev/null +++ b/src/FtAppEntry.cpp @@ -0,0 +1,79 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 "FtApp.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +bool gRetryFlag = false; + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +_OSP_EXPORT_ int OspMain(int argc, char* pArgv[]); +#ifdef _PROFILE +extern void start_profile(void); +extern void end_profile(void); +#else +#define start_profile() +#define end_profile() +#endif + + +/** + * The entry function of bada application called by the operating system. + */ +int +OspMain(int argc, char* pArgv[]) +{ + result r = E_SUCCESS; + + AppLog("Application started."); + ArrayList* pArgs = new ArrayList(); + pArgs->Construct(); + + String retryArg(pArgv[1]); + + if (retryArg.CompareTo(L"-r") == 0) + { + gRetryFlag = true; + } + for (int i = 0; i < argc; i++) + { + pArgs->Add(*(new String(pArgv[i]))); + } + start_profile(); + r = Tizen::App::UiApp::Execute(FtApp::CreateInstance, pArgs); + if (IsFailed(r)) + { + AppLogException("Application execution failed-[%s].", GetErrorMessage(r)); + r &= 0x0000FFFF; + } + end_profile(); + + pArgs->RemoveAll(true); + delete pArgs; + AppLog("Application finished."); + + return static_cast< int >(r); +} +#ifdef __cplusplus +} +#endif // __cplusplus diff --git a/src/FtAppForm.cpp b/src/FtAppForm.cpp new file mode 100644 index 0000000..7465760 --- /dev/null +++ b/src/FtAppForm.cpp @@ -0,0 +1,55 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 "FtAppForm.h" + +using namespace Tizen::Base; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; + +FtAppForm::FtAppForm(void) +{ + +} + +FtAppForm::~FtAppForm(void) +{ +} + +bool +FtAppForm::Initialize() +{ + // Construct an XML form + Construct(L"IDF_FTAPPFORM"); + + return true; +} + +result +FtAppForm::OnInitializing(void) +{ + result r = E_SUCCESS; + + return r; +} + +result +FtAppForm::OnTerminating(void) +{ + result r = E_SUCCESS; + + return r; +} diff --git a/src/FtAppFrame.cpp b/src/FtAppFrame.cpp new file mode 100644 index 0000000..afdd707 --- /dev/null +++ b/src/FtAppFrame.cpp @@ -0,0 +1,93 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 "FtAppFrame.h" +#include "FtAppForm.h" +#include "FtSoExecutor.h" + + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::Base::Runtime; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; + +#define TIMER_VAL 500 + +FtAppFrame::FtAppFrame(void) +{ +} + +FtAppFrame::~FtAppFrame(void) +{ +} + +result +FtAppFrame::OnInitializing(void) +{ + result r = E_SUCCESS; + + // Add window event listener + AddWindowEventListener(*this); + + // Create a form + FtAppForm* pFtAppForm = new FtAppForm(); + pFtAppForm->Initialize(); + + // Add the form to the frame + AddControl(*pFtAppForm); + + // Set the current form + SetCurrentForm(*pFtAppForm); + + // Draw and Show the form + pFtAppForm->Draw(); + pFtAppForm->Show(); + + __timer.Construct(*this); + __timer.Start(TIMER_VAL); + + return r; +} + +void +FtAppFrame::OnTimerExpired(Timer& timer) +{ + CFtSoExecutor ftApp; + ftApp.Start(); + UiApp::GetInstance()->Terminate(); +} + + +result +FtAppFrame::OnTerminating(void) +{ + result r = E_SUCCESS; + + return r; +} + +void +FtAppFrame::OnWindowActivated(const Tizen::Ui::Window& source) +{ + +} + +void +FtAppFrame::OnWindowDeactivated(const Tizen::Ui::Window& source) +{ + +} diff --git a/src/FtConfParser.cpp b/src/FtConfParser.cpp new file mode 100644 index 0000000..cada0e6 --- /dev/null +++ b/src/FtConfParser.cpp @@ -0,0 +1,1032 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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. +// +/** + * @file FtConfParser.cpp + */ +#include +#include "FtConfParser.h" +#include "TsTcInfo.h" + +using namespace std; + +const int START_DLL_LENGTH = 11; +const int START_TESTCASE_LENGTH = 12; +const int MAX_COUNT = 4; +const int TS_POS_IN_LOG = 7; + +const int COMMENT_LEN = 2; +const int WCHAR_LEN = 2; +const int THIRD_INDEX = 3; + +const char* FTCONFIG_TC_PREFIX = "-"; +const char* FTCONFIG_MODE_TESTDLLSTART = "[DLL_START]"; +const char* FTCONFIG_MODE_TESTDLLEND = "[DLL_END]"; +const char* FTCONFIG_MODE_TESTSUITE = "[TestSuite]"; +const char* FTCONFIG_MODE_PROJECT = "[Project]"; +const char* FTCONFIG_SHOW_PROGRESS_MODE = "show-test-progress"; +const char* FTCONFIG_MODE_CUSTOM = "[Custom]"; + + +FtConfParser::FtConfParser(const String& confFilePath, const String& logPath, const String& versionString) + : __bMultiComments(false) + , __crashedFlag(false) + , __bDllLoad(false) + , __isCompatMode(false) + , __crashedTsCount(0) + , __crashedTcCount(0) + , __dllCount(0) + , __dllEndCount(0) + , __dllStartCount(0) + , __confFilePath(confFilePath) + , __logPath(logPath) + , __tcInfoMap(SingleObjectDeleter) + , __tsInfoMap(SingleObjectDeleter) + , __mapExecutedTcBeforeCrashed(SingleObjectDeleter) + , __customKeyValueMap(SingleObjectDeleter) +{ + printf("[FTAPP] FtConfParser - FtApp is executed as an app version [%ls]\n", versionString.GetPointer()); + + if (versionString.Equals("2.0C", false)) + { + __isCompatMode = true; + } + else + { + ParseToVersionIntegers(versionString, __executedVerInfo); + } + __confEachLineList.Construct(MAX_VALUE); + __tcInfoMap.Construct(MAX_VALUE); + __tsInfoMap.Construct(MAX_VALUE); + __mapExecutedTcBeforeCrashed.Construct(MAX_VALUE); + __customKeyValueMap.Construct(MAX_VALUE); +} + +FtConfParser::~FtConfParser() +{ + __confEachLineList.RemoveAll(); + ClearConfList(); +} + +void +FtConfParser::ReadLogFile(String& logPath) +{ + File logFile; + result r = logFile.Construct(logPath, L"a+"); + if (IsFailed(r)) + { + printf("logFile construct Failed... \n"); + return; + } + + if (!logFile.IsFileExist(logPath)) + { + return; + } + + // check for TestFinished + String finish(L"Test Finished\n"); + String temp; + + // read last line + r = logFile.Read(temp); + String lastLine; + int count = 1; + __crashedFlag = true; + while (r != E_END_OF_FILE) + { + count++; + lastLine = temp; + r = logFile.Read(temp); + // first test suite name in the log file is in 7th line + if (count == TS_POS_IN_LOG) + { + int index; + r = temp.IndexOf(':', 0, index); + if (r == E_SUCCESS) + { + temp.SubString(index + 1, __firstSuiteName); + } + } + if (0 == lastLine.CompareTo(finish)) + { + // if previous test was completed, clear log file + char logPathCStr[logPath.GetLength() + 1]; + wcstombs(logPathCStr, logPath.GetPointer(), logPath.GetLength()); + logPathCStr[logPath.GetLength()] = '\0'; + remove(logPathCStr); + __crashedFlag = false; + break; + } + else + { + // parse last line + if (!lastLine.StartsWith(L"Case START", 0)) + { + continue; + } + + String strTemp; + result res = lastLine.SubString(START_TESTCASE_LENGTH, strTemp); + String delim(L":"); + // Create a StringTokenizer instance + Tizen::Base::Utility::StringTokenizer strTok(strTemp, delim); + int cnt = strTok.GetTokenCount(); + if (cnt >= MAX_COUNT) + { + String tsCount = L""; + String tcCount = L""; + strTok.GetNextToken(__crashedTsName); + strTok.GetNextToken(__crashedTcName); + + // __testSuiteName:__testCaseName + String* strConcat = new String(__crashedTsName + L":" + __crashedTcName); + __mapExecutedTcBeforeCrashed.Add(*strConcat, *(new Integer(0))); + + strTok.GetNextToken(tsCount); + res = Integer::Parse(tsCount, __crashedTsCount); + if (IsFailed(res)) + { + __crashedTsCount = 0; + } + strTok.GetNextToken(tcCount); + res = Integer::Parse(tcCount, __crashedTcCount); + if (IsFailed(res)) + { + __crashedTcCount = 0; + } + } + else + { + printf("[FTAPP] Failed to load the crashed information and cannot continue the test"); + } + } + } + printf("[FTAPP] #### previously crashed TC: %ls %ls %d %d\n" + , __crashedTsName.GetPointer(), __crashedTcName.GetPointer(), __crashedTsCount, __crashedTcCount); +} + +bool +FtConfParser::LoadConf() +{ + String buff = L""; + __dllCount = 0; + File confFile; + result res = confFile.Construct(__confFilePath, L"r"); + + if (IsFailed(res)) + { + return false; + } + + String tmpContents = L""; + printf("\n[FTAPP] FtConfParser - Load conf file: %ls \n", __confFilePath.GetPointer()); + + // read by line + while (confFile.Read(buff) != E_END_OF_FILE) + { + String strBuff(buff); + + if (TestUtils::IsMeaningfulToParse(strBuff) == false) + { + continue; + } + + __confEachLineList.Add(strBuff); + + if (strBuff.GetLength() >= START_DLL_LENGTH) + { + if (TestUtils::IsSubStrEqual(strBuff, FTCONFIG_MODE_TESTDLLSTART, + (strBuff.GetLength() - 1))) + { + __dllCount++; + } + } + + } + + return true; + +} + +void +FtConfParser::SetShowLog(bool& showLog) +{ + String buff = L""; + File confFile; + result res = confFile.Construct(__confFilePath, L"r"); + if (IsFailed(res)) + { + res = confFile.Construct(__confFilePath, L"r"); + // check legacy conf file name + if (IsFailed(res)) + { + return; + } + } + while (E_END_OF_FILE != confFile.Read(buff)) + { + String strBuff(buff); + if (TestUtils::IsMeaningfulToParse(strBuff) == false) + { + continue; + } + + int index; + res = strBuff.IndexOf(':', 0, index); + if (res == E_SUCCESS) + { + String temp; + String value; + strBuff.SubString(0, index, temp); + if (temp.CompareTo(FTCONFIG_SHOW_PROGRESS_MODE) == 0) + { + strBuff.SubString(index + 1, value); + value.Remove((value.GetLength() - 1), 1); + if (value.CompareTo(L"false") == 0) + { + showLog = false; + break; + } + } + } + } + +} + +void +FtConfParser::GetCrashData(bool& crashedFlag, int& tsCount, int& tcCount) +{ + crashedFlag = __crashedFlag; + tsCount = __crashedTsCount; + tcCount = __crashedTcCount; +} + + +void +FtConfParser::ClearConfList() +{ + if (__confEachLineList.GetCount() > 0) + { + __confEachLineList.RemoveAll(); + } +} + +bool +FtConfParser::ClearAndCreateLogFile() +{ + File logFile; + if (!__crashedFlag) + { + printf("[FTAPP] FtConfParser - Remove previous LogFile\n"); + remove((char*) __logPath.GetPointer()); + } + result res = logFile.Construct(__logPath, L"a+"); + if (IsFailed(res)) + { + printf("[FTAPP] FtConfParser - Create LogFile error\n"); + return false; + } + return true; + +} + +bool +FtConfParser::IsComment(const String& buff, const String& strBuff) +{ + if (buff.GetLength() == 0) + { + return false; + } + if (buff.StartsWith(L"/*", 0)) + { + if (TestUtils::StrContains(strBuff, L"*/")) + { + __bMultiComments = false; + } + else + { + __bMultiComments = true; + } + return true; + } + if ((buff.CompareTo(L"*/") != 0) && __bMultiComments) + { + __bMultiComments = false; + return true; + } + if (__bMultiComments) + { + return true; + } + // / <- the begin of comments + if (buff.GetLength() >= COMMENT_LEN && buff.StartsWith(L"/", 0) + && buff.StartsWith(L"/", 1)) + { + return true; + } + else + { + return false; + } +} + +bool +FtConfParser::ParseConfig() +{ + if (__confEachLineList.GetCount() <= 0) + { + printf("[FTAPP] FtConfParser - Parse&Execute: confList size 0\n"); + return true; + } + + // Clear previous log & Set OverflowFlag + if (!ClearAndCreateLogFile()) + { + return false; + } + + String strMode = L""; + + // DLL_START + // move to the first node + printf("[FTAPP] CFtConfParser::ParseConfig: __confEachLineList->count = %d \n", + __confEachLineList.GetCount()); + String count(__confEachLineList.GetCount()); + + bool isFirstTcAfterCrash = false; + unique_ptr< IEnumeratorT< String > > pEnumConfEachLine(__confEachLineList.GetEnumeratorN()); + if (pEnumConfEachLine == null) + { + return false; + } + while (pEnumConfEachLine->MoveNext() == E_SUCCESS) + { + String strBuff; + pEnumConfEachLine->GetCurrent(strBuff); + + String ModeBuff = strBuff; + if (IsComment(ModeBuff, strBuff)) + { + continue; + } + else if (TestUtils::IsModeToken(ModeBuff)) + { + strMode = ModeBuff; + if (TestUtils::IsSubStrEqual(strMode, FTCONFIG_MODE_TESTDLLEND, + strMode.GetLength())) + { + __dllEndCount++; + if (__dllEndCount == __dllStartCount) + { + // current implementation can have only one DLL in a conf file + break; + } + __dllEndCount = 0; + __dllStartCount = 0; + + } + else if (TestUtils::IsSubStrEqual(strMode, FTCONFIG_MODE_CUSTOM, + strMode.GetLength() - 1)) + { + SaveCustomKeyValueMap(); + } + } + else // mode else + { + // [Project] + if (TestUtils::IsSubStrEqual(strMode, FTCONFIG_MODE_PROJECT, + strMode.GetLength())) + { + // print ProjectName + String projectName = L"ProjectName: "; + if (strBuff.GetLength() > 1) + { + projectName += strBuff; + } + else + { + projectName += L"DEFAULT_NAME"; + } + Tizen::Base::String msg; + msg.Format(projectName.GetLength() + WCHAR_LEN, L"%ls\n", + projectName.GetPointer()); + // nothing really do for the project name at this moment. + + } + else if (TestUtils::IsSubStrEqual(strMode, + FTCONFIG_MODE_TESTDLLSTART, strMode.GetLength() - 1)) + { + // DLL START + __dllStartCount++; + // Seperate dll name & loop + int index = TestUtils::FindFirstIndex(strBuff, L":", 0); + if (((TestUtils::StrContains(strBuff, L":\\")) + || TestUtils::StrContains(strBuff, L":/")) + && index < THIRD_INDEX) + { + index = TestUtils::FindFirstIndex(strBuff, L":", THIRD_INDEX); + } + int loop = 1; + if (index > 0) + { + String loopStr; + strBuff.SubString(index + 1, + strBuff.GetLength() - index, loopStr); + strBuff.SubString(0, index, strBuff); + if (loopStr.GetLength() > 0) + { + loop = atoi((char*) loopStr.GetPointer()); + } + } + if (loop == 0) + { + // skip loading the so file + continue; + } + __soFileList.Add(strBuff); + + isFirstTcAfterCrash = (__crashedFlag && gRetryFlag); + + } + else if (TestUtils::IsSubStrEqual(strMode, + FTCONFIG_MODE_TESTSUITE, (strMode.GetLength() - 1))) + { + // [TESTSUITE] + ParseConfigTestSuiteCase(strBuff, isFirstTcAfterCrash); + } + } // mode else + + } // while + + return true; +} + +void +FtConfParser::FilterOutExecutedTcBeforeCrash() +{ + unique_ptr< IMapEnumerator > pMapEnum(__mapExecutedTcBeforeCrashed.GetMapEnumeratorN()); + + ArrayList tsTobeDel(SingleObjectDeleter); + tsTobeDel.Construct(); + ArrayList tcTobeDel(SingleObjectDeleter); + tcTobeDel.Construct(); + + while (pMapEnum->MoveNext() == E_SUCCESS) + { + String* pExecutedTcName = static_cast< String* >(pMapEnum->GetKey()); + + String tsTemp; + String tcTemp; + String delim(L":"); + + TsInfo* pTsInfo = new TsInfo();; + TcInfo* pTcInfo = new TcInfo();; + + Tizen::Base::Utility::StringTokenizer strTok(*pExecutedTcName, delim); + strTok.GetNextToken(tsTemp); + strTok.GetNextToken(tcTemp); + + pTsInfo->tsName = tsTemp; + pTcInfo->tsName = tsTemp; + pTcInfo->tcName = tcTemp; + + if (!tsTemp.Equals(__crashedTsName)) + { + tsTobeDel.Add(pTsInfo); + } + + tcTobeDel.Add(pTcInfo); + } + + for (int i = 0; i < tsTobeDel.GetCount(); ++i) + { + TsInfo* pTsInfo = static_cast< TsInfo* >(tsTobeDel.GetAt(i)); + AppAssert(__tsInfoMap.Remove(*pTsInfo) == E_SUCCESS); + } + + for (int i = 0; i < tcTobeDel.GetCount(); ++i) + { + TcInfo* pTcInfo = static_cast< TcInfo* >(tcTobeDel.GetAt(i)); + AppAssert(__tcInfoMap.Remove(*pTcInfo) == E_SUCCESS); + } +} + +void +FtConfParser::FilterTcByCapability(const IList* pCapabilities) +{ + AppLog("supported optional features\n"); + for(int i = 0; i < pCapabilities->GetCount(); ++i) + { + const String* pStr = static_cast< const String* >(pCapabilities->GetAt(i)); + AppLog("\t%ls\n", pStr->GetPointer()); + } + + unique_ptr< IMapEnumerator > pMapEnum(__tcInfoMap.GetMapEnumeratorN()); + ArrayList tcTobeDel(NoOpDeleter); + tcTobeDel.Construct(); + + while (pMapEnum->MoveNext() == E_SUCCESS) + { + TcInfo* pTcInfo = static_cast< TcInfo* >(pMapEnum->GetKey()); + + for(int i = 0; i < pTcInfo->supportedFeaturesToRun.GetCount(); ++i) + { + const String* pStr = static_cast< const String* >(pTcInfo->supportedFeaturesToRun.GetAt(i)); + // if one of supported features to run is not supported as device capability, + // then filter it out. + if (!pCapabilities->Contains(*pStr)) + { + AppLog("filtered out a TC with must supported feature that is NOT supported: %ls <%ls>", + pTcInfo->tcName.GetPointer(), pStr->GetPointer()); + tcTobeDel.Add(pTcInfo); + break; + } + } + + for(int i = 0; i < pTcInfo->unsupportedFeaturesToRun.GetCount(); ++i) + { + const String* pStr = static_cast< const String* >(pTcInfo->unsupportedFeaturesToRun.GetAt(i)); + // if one of unsupported features to run is supported as device capability, + // then filter it out. + if (pCapabilities->Contains(*pStr)) + { + AppLog("filtered out a TC with must NOT supported feature that is supported: %ls <%ls>", + pTcInfo->tcName.GetPointer(), pStr->GetPointer()); + tcTobeDel.Add(pTcInfo); + break; + } + } + } + + for (int i = 0; i < tcTobeDel.GetCount(); ++i) + { + TcInfo* pTcInfo = static_cast< TcInfo* >(tcTobeDel.GetAt(i)); + AppAssert(__tcInfoMap.Remove(*pTcInfo) == E_SUCCESS); + } +} + +void +FtConfParser::ParseTestCaseInfo(const String& strBuff, String& tcName, int& loop, String& versionStr, String& features) +{ + int loopIndex = TestUtils::FindFirstIndex(strBuff, L":", 0); + int verIndex = TestUtils::FindFirstIndex(strBuff, L":", loopIndex + 1); + + // get tcName; + if (loopIndex > 0) + { + String loopStr; + int loopLength; + + int featureIndex = -1; + bool colonAfterFeature = false; + if (strBuff.IndexOf(L'<', 0, featureIndex) == E_SUCCESS) + { + //there is no version index after '<' + if (featureIndex < verIndex) + { + colonAfterFeature = true; + } + } + + if (verIndex >= 0 && !colonAfterFeature) // one more ':' after loop info + { + loopLength = verIndex - loopIndex - 1; + strBuff.SubString(verIndex + 1, strBuff.GetLength() - (verIndex + 1), versionStr); + versionStr.Trim(); + } + else // there is no more ':' after loop info + { + int tempIndex; + wchar_t tempChar; + + for (tempIndex = loopIndex + 1; tempIndex < strBuff.GetLength(); tempIndex++) + { + strBuff.GetCharAt(tempIndex, tempChar); + + if (tempChar >= '0' && tempChar <= '9') + { + continue; + } + else + { + break; + } + } + + loopLength = tempIndex - loopIndex - 1; + + if (loopLength <= 0) + { + loopLength = 1; + } + versionStr = ""; + } + + strBuff.SubString(loopIndex + 1, loopLength, loopStr); + + if (loopStr.GetLength() > 0) + { + loop = atoi((char*) loopStr.GetPointer()); + } + strBuff.SubString(0, loopIndex, tcName); + + // get feature strings + int featureFirstIndex = 0; + if (strBuff.IndexOf(L'<', 0, featureFirstIndex) == E_SUCCESS) // find first index of "<" + { + int featureLastIndex = 0; + result r = strBuff.LastIndexOf(L'>', strBuff.GetLength() - 1, featureLastIndex); + if (featureFirstIndex < featureLastIndex && r == E_SUCCESS) // find last index of ">" + { + strBuff.SubString(featureFirstIndex, featureLastIndex - featureFirstIndex + 1, features); + } + } + } +} + +void +FtConfParser::ParseConfigTestSuiteCase(String& strBuff, bool& isFirstTcAfterCrash) +{ + static String curTsName = L""; + + if (strBuff.StartsWith(FTCONFIG_TC_PREFIX, 0)) + { + // Test Case + if (strBuff.GetLength() > 0) + { + // tc name + int tmpMinusIndex; + result rtmp = strBuff.IndexOf(L"-", 0, tmpMinusIndex); + + // if find '-' within first 10th character, remove it + if (rtmp == E_SUCCESS && tmpMinusIndex < 10) + { + rtmp = strBuff.Remove(tmpMinusIndex, 1); + if (rtmp != E_SUCCESS) + { + printf("[FTAPP] TC name replace failed - to empty string \n"); + } + } + + // tc loop if exists + int loop = 1; + String versionStr = L""; + String tcName = L""; + String features = L""; + + // get TC info from buffer. + ParseTestCaseInfo(strBuff, tcName, loop, versionStr, features); + + if (loop > 0 && CheckVersion(versionStr)) + { + // add to the TcInfo list + TcInfo* pTcInfo = new TcInfo(); + pTcInfo->tsName = curTsName; + pTcInfo->tcName = tcName; + pTcInfo->repeatCount = loop; + pTcInfo->version = versionStr; + pTcInfo->SetOptionalFeatures(features); + + __tcInfoMap.Add(*pTcInfo, *(new Integer(0))); + + if (isFirstTcAfterCrash) + { + printf("[FTAPP] FtConfParser - TS: %ls, TC: %ls\n", + curTsName.GetPointer(), strBuff.GetPointer()); + isFirstTcAfterCrash = false; + __crashedTcCount += 1; + if (curTsName.CompareTo(__crashedTsName) != 0) + { + __crashedTsCount += 1; + __crashedTcCount = 0; + } + printf("[FTAPP] #### Retry will be started from TC: %ls %ls %d %d\n" + , curTsName.GetPointer(), strBuff.GetPointer(), __crashedTsCount, __crashedTcCount); + + } + } + } + } + // Test suite + else + { + int index = TestUtils::FindFirstIndex(strBuff, L":", 0); + int loop = 1; + if (index > 0) + { + String loopStr; + strBuff.SubString(index + 1, + strBuff.GetLength() - (index + 1), loopStr); + strBuff.SubString(0, index, strBuff); + if (loopStr.GetLength() > 0) + { + loop = atoi((char*) loopStr.GetPointer()); + } + } + if (loop > 0) + { + // add to the TsInfo List + TsInfo* pTsInfo = new TsInfo(); + pTsInfo->tsName = strBuff; + pTsInfo->repeatCount = loop; + __tsInfoMap.Add(*pTsInfo, *(new Integer(0))); + } + curTsName = strBuff; + } +} + +void +FtConfParser::SaveCustomKeyValueMap() +{ + String buff = L""; + File confFile; + result res = confFile.Construct(__confFilePath, L"r"); + if (IsFailed(res)) + { + return; + } + while (confFile.Read(buff) != E_END_OF_FILE) + { + + String strBuff(buff); + if (TestUtils::IsMeaningfulToParse(strBuff) == false) + { + continue; + } + buff.Remove((buff.GetLength() - 1), 1); + int index; + res = buff.IndexOf('=', 0, index); + if (res == E_SUCCESS) + { + String key; + String value; + buff.SubString(0, index, key); + buff.SubString(index + 1, value); + + __customKeyValueMap.Add(new String(key), new String(value)); + } + } +} + +bool +FtConfParser::CheckVersion(const String& versionString) +{ + if (versionString.GetLength() == 0) + { + return true; + } + + if (__isCompatMode) + { + return (versionString.Contains("2.0C") || versionString.Contains("2.0c")); + } + + ArrayList verExceptList(SingleObjectDeleter); + ArrayList verRangeList(SingleObjectDeleter); + ArrayList verExactList(SingleObjectDeleter); + verExceptList.Construct(); + verRangeList.Construct(); + verExactList.Construct(); + + // separate each elements [] + Utility::StringTokenizer strTok(versionString, "[]"); + String token; + bool isFoundCompatTc = false; + while (strTok.HasMoreTokens()) + { + strTok.GetNextToken(token); + + if (token.Equals("2.0C", false) || token.Equals("[2.0C]", false)) + { + isFoundCompatTc = true; + } + else if (token[0] == 'E') //exceptions + { + token.Remove(0,1); + verExceptList.Add(new String(token)); + } + else if (token.Contains("-")) //version with range + { + verRangeList.Add(new String(token)); + } + else + { + verExactList.Add(new String(token)); + } + + } + + // check except versions + for (int i = 0; i < verExceptList.GetCount(); ++i) + { + String* pStr = static_cast< String* >(verExceptList.GetAt(i)); + int vi[MAX_VER_PLACE] = {-1}; + ParseToVersionIntegers(*pStr, vi); + + if (VersionEquals(__executedVerInfo, vi)) + { + return false; // matched exception version is always not good to execute. + } + } + + // check exact versions + for (int i = 0; i < verExactList.GetCount(); ++i) + { + String* pStr = static_cast< String* >(verExactList.GetAt(i)); + int vi[MAX_VER_PLACE] = {-1}; + ParseToVersionIntegers(*pStr, vi); + + if (VersionEquals(__executedVerInfo, vi)) + { + return true; // matched to exact version is always good to execute. + } + } + + // check range versions + for (int i = 0; i < verRangeList.GetCount(); ++i) + { + int verLower[MAX_VER_PLACE] = {Integer::VALUE_MIN}; + int verUpper[MAX_VER_PLACE] = {Integer::VALUE_MAX}; + + ParseVersionRange(*static_cast< String* >(verRangeList.GetAt(i)), verLower, verUpper); + + if (VersionBetween(__executedVerInfo, verLower, verUpper)) + { + return true; // matched to exact version is always good to execute. + } + } + + if (verExactList.GetCount() == 0 && verRangeList.GetCount() == 0 && !isFoundCompatTc) + { + return true; + } + + return false; +} + +bool +FtConfParser::VersionEquals(const int verInfo[], const int verEqualTo[]) +{ + for (int i = 0; i < MAX_VER_PLACE; ++i) + { + int info = verInfo[i]; + int equalTo = verEqualTo[i]; + if (verInfo[i] == -1) + { + info = 0; + } + + if (verEqualTo[i] == -1) + { + equalTo = 0; + } + + if (info != equalTo) + { + return false; + } + } + return true; +} + +bool +FtConfParser::VersionBetween(const int verInfo[], const int verLower[], const int verUpper[]) +{ + int lower = verLower[0]; + int upper = verUpper[0]; + + for (int i = 0; i < MAX_VER_PLACE; ++i) + { + if (lower > verInfo[i] || upper < verInfo[i]) + { + return false; + } + + if (i == MAX_VER_PLACE - 1) + { + return true; + } + + if (lower < verInfo[i] || verLower[i] < 0) + { + lower = Integer::VALUE_MIN; + } + else // lower == verInfo[i] + { + lower = verLower[i+1]; + } + + if (verInfo[i] < upper || verUpper[i] < 0) + { + upper = Integer::VALUE_MAX; + } + else // verInfo[i] == upper + { + upper = verUpper[i+1]; + } + + } + return true; +} + +void +FtConfParser::ParseVersionRange(const String& verString, int verLower[], int verUpper[]) +{ + // [-1.2] + if (verString[0] == L'-') + { + verLower[0] = 0; + verLower[1] = 0; + verLower[2] = 0; + verLower[3] = 0; + verLower[4] = 0; + String tmp(verString); + tmp.Remove(0,1); + ParseToVersionIntegers(tmp, verUpper); + return; + } + else if(verString[verString.GetLength()-1] == L'-') // [1.2-] + { + verUpper[0] = Integer::VALUE_MAX; + verUpper[1] = Integer::VALUE_MAX; + verUpper[2] = Integer::VALUE_MAX; + verUpper[3] = Integer::VALUE_MAX; + verUpper[4] = Integer::VALUE_MAX; + String tmp(verString); + tmp.Remove(verString.GetLength()-1,1); + ParseToVersionIntegers(tmp, verLower); + return; + } + + // [1.2-1.3] + Utility::StringTokenizer strTok(verString, "-"); + String token; + + AppAssertf(strTok.HasMoreTokens(), "Parsing error of version range specification 1 [%ls]", verString.GetPointer()); + strTok.GetNextToken(token); + ParseToVersionIntegers(token, verLower); + + AppAssertf(strTok.HasMoreTokens(), "Parsing error of version range specification 2 [%ls]", verString.GetPointer()); + strTok.GetNextToken(token); + ParseToVersionIntegers(token, verUpper); +} + +void +FtConfParser::ParseToVersionIntegers(const String& verString, int verInfo[]) +{ + Utility::StringTokenizer strTok(verString, "."); + String token; + for (int i = 0; i < MAX_VER_PLACE; ++i) + { + int parsed = -1; + if (strTok.HasMoreTokens()) + { + strTok.GetNextToken(token); + if (Integer::Parse(token, parsed) != E_SUCCESS) + { + break; + } + } + verInfo[i] = parsed; + } +} + +HashMap& +FtConfParser::GetTcInfoMap() +{ + return __tcInfoMap; +} + +ArrayListT< String >& +FtConfParser::GetSoFileList() +{ + return __soFileList; +} + + +HashMap& +FtConfParser::GetTsInfoMap() +{ + return __tsInfoMap; +} + +HashMap& +FtConfParser::GetCustomKeyValueMap() +{ + return __customKeyValueMap; +} + diff --git a/src/FtConfiguration.cpp b/src/FtConfiguration.cpp new file mode 100644 index 0000000..e055407 --- /dev/null +++ b/src/FtConfiguration.cpp @@ -0,0 +1,60 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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. +// +/** + * @file FtConfiguration.cpp + */ +#include "FtConfiguration.h" +#include "FtSoExecutor.h" +#include "FIo.h" +#include + +using namespace Tizen::App; + +FtConfiguration::FtConfiguration() +{ + +} + +FtConfiguration::~FtConfiguration() +{ + +} + +void +FtConfiguration::LoadConfig() +{ + + String configFile(App::GetInstance()->GetAppRootPath() + FTAPP_CONFIG_FILE); + result r; + + r = reg.Construct(configFile, REG_OPEN_READ_ONLY, 0); + if (IsFailed(r)) + printf("REGISTRY CONSTRUCT FAILED\n"); + +} + +const String +FtConfiguration::GetValue(const String& key) +{ + String keyValue(L""); + result r; + r = reg.GetValue(L"global", key, keyValue); + if (IsFailed(r)) + printf(" GetValue Failed \n"); + + return keyValue; +} diff --git a/src/FtDeviceCapability.cpp b/src/FtDeviceCapability.cpp new file mode 100644 index 0000000..0a264af --- /dev/null +++ b/src/FtDeviceCapability.cpp @@ -0,0 +1,58 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 "FtDeviceCapability.h" + +using namespace std; +using namespace Tizen::Io; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +bool +FtDeviceCapability::LoadConf(const String& confFilePath, ArrayList& capabilities) +{ + String buff = L""; + File confFile; + result res = confFile.Construct(confFilePath, L"r"); + + if (IsFailed(res)) + { + printf("\n[FTAPP] FtDeviceCapability - Cannot load the conf file %ls\n", confFilePath.GetPointer()); + return false; + } + + String tmpContents = L""; + printf("\n[FTAPP] FtDeviceCapability - Load a capability configuration file: %ls\n", + confFilePath.GetPointer()); + + //read by line + while (confFile.Read(buff) != E_END_OF_FILE) + { + String strLine(buff); + + if (!TestUtils::IsMeaningfulToParse(strLine)) + { + continue; + } + + capabilities.Add(new String(strLine)); + } + + return true; +} + + diff --git a/src/FtSoExecutor.cpp b/src/FtSoExecutor.cpp new file mode 100644 index 0000000..957ef13 --- /dev/null +++ b/src/FtSoExecutor.cpp @@ -0,0 +1,383 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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. +// +/** + * @file FtSoExecutor.cpp + * This file contains declarations of GTFManager class. + */ +#include +#include +#include +#include +#include +#include + +#include "FIo.h" +#include "FAppApp.h" +#include "FtSoExecutor.h" +#include "FBaseInteger.h" +#include "FtConfiguration.h" +#include "TsTcInfo.h" +#include "FtDeviceCapability.h" + +using namespace std; +using namespace Tizen::Base; +using namespace Tizen::Io; +using namespace Tizen::Base::Runtime; +using namespace Tizen::App; +using namespace Tizen::Ui::Controls; + +// // // // // // // // // // // // // // // // // // // // // // // // // // // +// function pointer type of test suite dll +typedef int (*PFnTSExport)(void); +typedef int (*PFnTSExport_int)(int); +typedef int (*PFnTSExport_str)(const char*); +typedef int (*PFnTSExport_bool_int_int)(bool, int, int); +typedef int (*PFnTSExport_str_int)(const char*, int); +typedef int (*PFnTSExport_bool)(bool); +typedef int (*PFnTSExport_str_str_int)(const char*, const char*, int); +typedef int (*PFnTSExport_str_str)(const char*, const char*); + +PFnTSExport pFnStartTSMain_Drv = null; +PFnTSExport_int pFnSetLoop_Drv = null; +PFnTSExport_str_int pFnSetTSLoop_Drv = null; +PFnTSExport_str_str_int pFnSetTCLoop_Drv = null; +PFnTSExport_str_str pFnAddKeyValue_Drv = null; +PFnTSExport_str pFnSetLogFilePath_Drv = null; +PFnTSExport_str pFnSetLogFileName_Drv = null; +PFnTSExport_bool_int_int pFnSetContinueMode_Drv = null; +PFnTSExport_bool pFnSetShowLog_Drv = null; +// // // // // // // // // // // // // // // // // // // // // // // // // // // + +CFtSoExecutor::CFtSoExecutor() + : __bMultiComments(false) + , __bDllLoad(false) + , __testMode(-1) + , __crashedFlag(false) + , __crashedTsCount(0) + , __crashedTcCount(0) + , __dllEndCount(0) + , __dllStartCount(0) + , __pLib(null) + , __showLogFlag(true) +{ + FtConfiguration* FtConf = FtConfiguration::Instance(); + FtConf->LoadConfig(); + + String homePath = App::GetInstance()->GetAppRootPath(); + + String confFilePath = homePath + FtConf->GetValue(L"TestConfFilePath") + FtConf->GetValue(L"TestConfFileName"); + __logPath = homePath + FtConf->GetValue(L"LogFilePath"); + __logFileName = FtConf->GetValue(L"FtAppLogFileName"); + String logPath = __logPath + __logFileName; + + + String versionString; + + if (File::IsFileExist(homePath + FtConf->GetValue(L"CompatFile"))) + { + versionString = "2.0C"; + } + else + { + File verFile; + result res = verFile.Construct(homePath + FtConf->GetValue(L"VersionFile"), L"r"); + + if (!IsFailed(res)) + { + result r = verFile.Read(versionString); + if (!IsFailed(r)) + { + versionString.Trim(); + } + } + } + + __pParser = new FtConfParser(confFilePath, logPath, versionString); + __pParser->SetShowLog(__showLogFlag); + + + ScrollPanel* scrollPanel = static_cast< ScrollPanel* >(UiApp::GetInstance()-> + GetFrame(L"FtApp")->GetCurrentForm()->GetControl(L"IDC_SCROLLPANEL1")); + + __pTextBox = static_cast< TextBox* >(scrollPanel->GetControl(L"IDC_TEXTBOX1")); +} + +CFtSoExecutor::~CFtSoExecutor() +{ + delete __pParser; +} + +void +CFtSoExecutor::Start() +{ + if (gRetryFlag) + { + LogToUi("[FTAPP] Execution : '-r ' option Enabled \n"); + String logPath = __logPath + __logFileName; + // pass the absolute path for log file + __pParser->ReadLogFile(logPath); + } + else + { + __crashedFlag = false; + String logPath = __logPath + __logFileName; + unique_ptr< char[] > pLogPathCStr(GetCStringN(logPath)); + remove(pLogPathCStr.get()); + } + + + // load ftapp uts configuration + if (__pParser->LoadConf() == false) + { + LogToUi("[FTAPP] CFtSoExecutor:: ##### Failed to load ftapputs.conf ####\n"); + return; + } + + // parse configuration and execute test + __pParser->ParseConfig(); + + if (gRetryFlag) + { + __pParser->FilterOutExecutedTcBeforeCrash(); + } + + // load device capability + ArrayList capabilities(SingleObjectDeleter); + capabilities.Construct(); + bool loaded = FtDeviceCapability::LoadConf(FtConfiguration::Instance()->GetValue(L"DeviceCapabilityList"), capabilities); + + IEnumerator* pEnum = capabilities.GetEnumeratorN(); + + printf("[FTAPP] ## Parsed feature list - START ##\n"); + while (pEnum->MoveNext() == E_SUCCESS) + { + printf("[%ls]\n", (static_cast< String* >(pEnum->GetCurrent()))->GetPointer()); + } + printf("[FTAPP] ## Parsed feature list - END ##\n"); + + if (loaded) + { + // filter out optional features based on device capability + __pParser->FilterTcByCapability(&capabilities); + } + + ExecuteTest(); +} + +void +CFtSoExecutor::ExecuteTest() +{ + ArrayListT< String >& soFileList = __pParser->GetSoFileList(); + + // load so file + int count = soFileList.GetCount(); + for (int i = 0; i < count; ++i) + { + String obj; + soFileList.GetAt(i, obj); + __bDllLoad = LoadSo(obj); + if (__bDllLoad == false) + { + LogToUi(L"[FTAPP] FtSoExecutor - failed load .so file \n"); + LogToUi(L"[FTAPP] FtSoExecutor - Testing finished abnormally\n"); + return; + } + LogToUi(L"[FTAPP] FtSoExecutor - LoadSo done \n"); + } + + // set TestSuite Loop Info + unique_ptr< IMapEnumerator > pTsMapEnum(__pParser->GetTsInfoMap().GetMapEnumeratorN()); + + while (pTsMapEnum->MoveNext() == E_SUCCESS) + { + TsInfo* pTsInfo = static_cast< TsInfo* >(pTsMapEnum->GetKey()); + unique_ptr< char[] > pTsCStr(GetCStringN((*pTsInfo).tsName)); + pFnSetTSLoop_Drv(pTsCStr.get(), (*pTsInfo).repeatCount); + } + + // set TestCase Loop info + unique_ptr< IMapEnumerator > pTcMapEnum(__pParser->GetTcInfoMap().GetMapEnumeratorN()); + + while (pTcMapEnum->MoveNext() == E_SUCCESS) + { + TcInfo* pTi = static_cast< TcInfo* >(pTcMapEnum->GetKey()); + unique_ptr< char[] > pTsCStr(GetCStringN((*pTi).tsName)); + unique_ptr< char[] > pTcCStr(GetCStringN((*pTi).tcName)); + pFnSetTCLoop_Drv(pTsCStr.get(), pTcCStr.get(), (*pTi).repeatCount); + + } + + // set custom key-value read from conf + unique_ptr< IMapEnumerator > pCkvMapEnum(__pParser->GetCustomKeyValueMap().GetMapEnumeratorN()); + while (pCkvMapEnum->MoveNext() == E_SUCCESS) + { + String* key = static_cast< String* >(pCkvMapEnum->GetKey()); + String* value = static_cast< String* >(pCkvMapEnum->GetValue()); + unique_ptr< char[] > pKey(GetCStringN(*key)); + unique_ptr< char[] > pValue(GetCStringN(*value)); + + pFnAddKeyValue_Drv(pKey.get(), pValue.get()); + } + + // set continuous mode + if (gRetryFlag) + { + bool crashedFlag = false; + int crashedTsCount = 0; + int crashedTcCount = 0; + __pParser->GetCrashData(crashedFlag, crashedTsCount, crashedTcCount); + + if (crashedFlag && pFnSetContinueMode_Drv != null) + { + pFnSetContinueMode_Drv(true, crashedTsCount, crashedTsCount); + } + } + + delete __pParser; + __pParser = null; + + // Finally Run the Test's + RunTestSo(); +} + +bool +CFtSoExecutor::RunTestSo() +{ + if (__bDllLoad == false) + { + return false; + } + // start + if (pFnStartTSMain_Drv()) + { + LogToUi(L"[FTAPP] FtSoExecutor - StartTSMain - finished \n"); + } + else + { + LogToUi(L"[FTAPP] FtSoExecutor -StartTSMain - Fail \n"); + } + return UnloadSo(); +} + + +bool +CFtSoExecutor::LoadSo(String fileName) +{ + if (fileName.GetLength() <= 0) + { + return false; + } + + String soPath = App::GetInstance()->GetAppRootPath() + L"data/" + fileName; + + soPath.Replace(L"mytestapp", L"ftapp"); + printf("[FTAPP] FtSoExecutor - About to load library: %ls \n", soPath.GetPointer()); + // // // // // // // // // // // // // // // // // // // // // // // / + // load SO + __pLib = new Library(); + result r = __pLib->Construct(soPath); + switch (r) + { + case E_SUCCESS: + { + pFnStartTSMain_Drv = (PFnTSExport) __pLib->GetProcAddress(L"StartTSMain"); + pFnSetLoop_Drv = (PFnTSExport_int) __pLib->GetProcAddress(L"SetLoop"); + pFnSetTSLoop_Drv = (PFnTSExport_str_int) __pLib->GetProcAddress(L"SetTSLoop"); + pFnSetShowLog_Drv = (PFnTSExport_bool) __pLib->GetProcAddress(L"SetShowLog"); + pFnSetTCLoop_Drv = (PFnTSExport_str_str_int) __pLib->GetProcAddress(L"SetTCLoop"); + pFnAddKeyValue_Drv = (PFnTSExport_str_str) __pLib->GetProcAddress(L"AddKeyValue"); + pFnSetLogFilePath_Drv = (PFnTSExport_str) __pLib->GetProcAddress(L"SetLogFilePath"); + pFnSetLogFileName_Drv = (PFnTSExport_str) __pLib->GetProcAddress(L"SetLogFileName"); + pFnSetContinueMode_Drv = (PFnTSExport_bool_int_int) __pLib->GetProcAddress(L"SetContinueMode"); + + if (pFnStartTSMain_Drv == null || pFnSetLogFileName_Drv == null || pFnSetLoop_Drv == null + || pFnSetTSLoop_Drv == null || pFnSetTCLoop_Drv == null || pFnSetShowLog_Drv == null) + { + LogToUi(L"[FTAPP] FtSoExecutor - Failed to get symbol address.\n"); + return false; + } + + pFnSetShowLog_Drv(__showLogFlag); + LogToUi(L"[FTAPP] Succeeded to load library\n"); + + unique_ptr< char[] > pLogPathCStr(GetCStringN(__logPath)); + if (!pFnSetLogFilePath_Drv(pLogPathCStr.get())) + { + LogToUi("[FTAPP] FtSoExecutor - Failed to set log file path. \n"); + return false; + } + unique_ptr< char[] > pLogFileNameCStr(GetCStringN(__logFileName)); + if (!pFnSetLogFileName_Drv(pLogFileNameCStr.get())) + { + LogToUi(L"[FTAPP] FtSoExecutor - Failed to set log file name. \n"); + return false; + } + + return true; + } + break; + case E_LIBRARY_NOT_FOUND: + { + LogToUi(L"[FTAPP] FtSoExecutor - Failed to load library with E_LIBRARY_NOT_FOUND\n"); + unique_ptr< char[] > pLibPath(GetCStringN(soPath)); + dlopen(pLibPath.get(), RTLD_NOW); + printf("[FTAPP] FtSoExecutor - [E_LIBRARY_NOT_FOUND] %s\n", dlerror()); + return false; + } + break; + case E_PRIVILEGE_DENIED: + { + LogToUi(L"[FTAPP] FtSoExecutor - Failed to load library with E_PRIVILEGE_DENIED\n"); + return false; + } + break; + default: + // Do nothing + break; + } + return true; +} + +bool +CFtSoExecutor::UnloadSo() +{ + // init fp for dll + pFnStartTSMain_Drv = null; + pFnSetLoop_Drv = null; + pFnSetTSLoop_Drv = null; + pFnSetTCLoop_Drv = null; + pFnSetLogFilePath_Drv = null; + pFnSetLogFileName_Drv = null; + pFnSetContinueMode_Drv = null; + pFnSetShowLog_Drv = null; + // delete __pLib; + return true; +} + +void +CFtSoExecutor::LogToUi(const Tizen::Base::String& msg) +{ + if (__showLogFlag) + { + AppLog("%ls", msg.GetPointer()); + printf("%ls", msg.GetPointer()); + __pTextBox->AppendText(msg); + __pTextBox->Draw(); + __pTextBox->Show(); + } + +} diff --git a/src/TestUtils.cpp b/src/TestUtils.cpp new file mode 100644 index 0000000..56bf0cb --- /dev/null +++ b/src/TestUtils.cpp @@ -0,0 +1,157 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 "TestUtils.h" +#include + +using namespace Tizen::Base; +using namespace Tizen::Text; + +TestUtils::TestUtils() +{ +} + +TestUtils::~TestUtils() +{ +} + + +bool +TestUtils::IsSubStrEqual(const String& Str1, const String& Str2, int size) +{ + String tempStr1Sub(L""); + String tempStr2Sub(L""); + + Str1.SubString(0, size, tempStr1Sub); + Str2.SubString(0, size, tempStr2Sub); + + if (tempStr1Sub.CompareTo(tempStr2Sub) == 0) + { + return true; + } + else + { + return false; + } +} + +bool +TestUtils::StrContains(const String& CompleteStr, const String& SearchSubStr) +{ + return FindFirstIndex(CompleteStr, SearchSubStr, 0) >= 0 ? true : false; +} + +int +TestUtils::FindFirstIndex(const String& CompleteStr, const String& SearchSubStr, int startIndex) +{ + int bFoundAt = -1; + int len1 = CompleteStr.GetLength(); + int len2 = SearchSubStr.GetLength(); + if (len1 < len2 || len1 == 0 || len2 == 0 || startIndex > len1 - len2) + { + return bFoundAt; + } + --len1; + --len2; + for (int i = startIndex; i <= len1 - len2; i++) + { + String tempStr; + CompleteStr.SubString(i, len2 + 1, tempStr); + if (SearchSubStr.CompareTo(tempStr) == 0) + { + bFoundAt = i; + return bFoundAt; + } + } + return bFoundAt; +} + +String +TestUtils::GetFirstToken(const String& CompleteStr, const String& SeparatorStr) +{ + //String retVal(L""); + int len1 = CompleteStr.GetLength(); + int len2 = SeparatorStr.GetLength(); + + if (len1 < len2 || len1 == 0 || len2 == 0) + { + String retVal(L""); + return retVal; + } + + String tempStr; + if (CompleteStr.StartsWith(SeparatorStr, 0)) + { + int startIndex = len2; + int secondSepStart = FindFirstIndex(CompleteStr, SeparatorStr, startIndex); + CompleteStr.SubString(startIndex, secondSepStart, tempStr); + return tempStr; + } + else + { + int sepStart = FindFirstIndex(CompleteStr, SeparatorStr, 0); + if (sepStart != -1) + { + CompleteStr.SubString(0, sepStart, tempStr); + } + else + { + tempStr = CompleteStr; + } + return tempStr; + } +} + +bool +TestUtils::IsMeaningfulToParse(String& strBuff) +{ + if (strBuff.GetLength() <= 0) + { + return false; + } + else if (strBuff.StartsWith(L"\0", 0)) + { + return false; + } + else if (strBuff.StartsWith(L"\n", 0)) + { + return false; + } + + if (strBuff.StartsWith(L"\r", 0)) + { + return false; + } + if (strBuff.StartsWith(L"#", 0)) + { + return false; + } + if (strBuff.StartsWith(L"//", 0)) + { + return false; + } + strBuff.Replace(L"\n", L""); + strBuff.Replace(L"\r", L""); + + return true; +} + + +bool +TestUtils::IsModeToken(const String& strBuff) +{ + return strBuff.StartsWith(L"[", 0) ? true : false; +} diff --git a/src/TsTcInfo.cpp b/src/TsTcInfo.cpp new file mode 100644 index 0000000..7d16044 --- /dev/null +++ b/src/TsTcInfo.cpp @@ -0,0 +1,200 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// 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 "TsTcInfo.h" +#include + +using namespace Tizen::Io; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +TcInfo::TcInfo() + : repeatCount(0) + , supportedFeaturesToRun(SingleObjectDeleter) + , unsupportedFeaturesToRun(SingleObjectDeleter) +{ + supportedFeaturesToRun.Construct(); + unsupportedFeaturesToRun.Construct(); +} + +TcInfo::~TcInfo() +{ +} + +void +TcInfo::SetOptionalFeatures(const String& features) +{ + supportedFeaturesToRun.RemoveAll(true); + unsupportedFeaturesToRun.RemoveAll(true); + + if (features.GetLength() <= 0) + { + return; + } + // separate each elements + Utility::StringTokenizer strTok(features, "<> "); + String token; + while (strTok.HasMoreTokens()) + { + strTok.GetNextToken(token); + if (token[0] == '!') // not supported optional features + { + token.Remove(0,1); + unsupportedFeaturesToRun.Add(new String(token)); + } + else // supported optional features + { + supportedFeaturesToRun.Add(new String(token)); + } + + } + +} + +bool +TcInfo::Equals(const Object& obj) const +{ + const TcInfo* tempTcInfo = static_cast< const TcInfo* >(&obj); + bool res = false; + if ((this->tsName.Equals((*tempTcInfo).tsName)) && (this->tcName.Equals((*tempTcInfo).tcName))) + { + res = true; + } + return res; +} + +int +TcInfo::GetHashCode() const +{ + String hashString = this->tsName + this->tcName; + int res = hashString.GetLength(); + wchar_t tmpch; + + for (int strLen = 0; strLen < hashString.GetLength(); strLen++) + { + hashString.GetCharAt(strLen, tmpch); + res += (tmpch * strLen); + } + res %= MAX_VALUE; + return res; +} + +TcInfo& +TcInfo::operator =(const TcInfo& rhs) +{ + this->tsName = rhs.tsName; + this->tcName = rhs.tcName; + this->repeatCount = rhs.repeatCount; + this->version = rhs.version; + this->supportedFeaturesToRun.RemoveAll(true); + this->unsupportedFeaturesToRun.RemoveAll(true); + this->supportedFeaturesToRun.InsertItemsFrom(rhs.supportedFeaturesToRun, 0); + this->supportedFeaturesToRun.InsertItemsFrom(rhs.unsupportedFeaturesToRun, 0); + + return *this; +} + +bool +TcInfo::operator ==(const TcInfo& rhs) const +{ + bool res = false; + if (((this->tsName).CompareTo(rhs.tsName) == 0) && ((this->tcName).CompareTo(rhs.tcName) == 0)) + { + res = true; + } + return res; +} + +bool +TcInfo::operator !=(const TcInfo& rhs) const +{ + bool res = false; + if (this->tcName.CompareTo(rhs.tcName) != 0) + { + res = true; + } + return res; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +TsInfo::TsInfo() + : repeatCount(0) +{ +} + +TsInfo::~TsInfo() +{ +} + +bool +TsInfo::Equals(const Object& obj) const +{ + const TsInfo* tempTcInfo = static_cast< const TsInfo* >(&obj); + bool res = false; + if (this->tsName.Equals((*tempTcInfo).tsName)) + { + res = true; + } + return res; +} + +int +TsInfo::GetHashCode() const +{ + String hashString = this->tsName; + int res = hashString.GetLength(); + wchar_t tmpch; + + for (int strLen = 0; strLen < hashString.GetLength(); strLen++) + { + hashString.GetCharAt(strLen, tmpch); + + res += (tmpch * strLen); + } + res %= MAX_VALUE; + return res; +} + +TsInfo& +TsInfo::operator =(const TsInfo& rhs) +{ + this->tsName = rhs.tsName; + this->repeatCount = rhs.repeatCount; + return *this; +} + +bool +TsInfo::operator ==(const TsInfo& rhs) const +{ + bool res = false; + if (this->tsName.CompareTo(rhs.tsName) == 0) + { + res = true; + } + return res; +} + +bool +TsInfo::operator !=(const TsInfo& rhs) const +{ + bool res = false; + if (this->tsName.CompareTo(rhs.tsName) != 0) + { + res = true; + } + return res; +} diff --git a/tslist.txt b/tslist.txt new file mode 100755 index 0000000..bb5720b --- /dev/null +++ b/tslist.txt @@ -0,0 +1,69 @@ +uts-ads-controls +osp-uts-app +osp-uts-base +osp-uts-base-runtime +osp-uts-base-collection +osp-uts-base-utility +uts-commerce-store +osp-uts-content +osp-uts-enriched-text +osp-uts-graphics +osp-uts-io +osp-uts-locales +osp-uts-locations +osp-uts-locations-controls +osp-uts-locations-services +osp-uts-media-audio +osp-uts-media-camera +osp-uts-media-codec +osp-uts-media-drm +osp-uts-media-image +osp-uts-media-openal +osp-uts-media-player +osp-uts-media-recorder +osp-uts-media-tone-player +osp-uts-messaging +osp-uts-net +osp-uts-net-bluetooth +osp-uts-net-http +osp-uts-net-nfc +osp-uts-net-socket +osp-uts-net-wifi +uts-net-wifi-direct +osp-uts-pthread +osp-uts-security +osp-uts-social +osp-uts-social-addressbook +osp-uts-social-calendarbook +osp-uts-standard-c-newlib +uts-standard-cpp-algorithms +uts-standard-cpp-containers +uts-standard-cpp-diagnostics +uts-standard-cpp-io +uts-standard-cpp-iobuffer +uts-standard-cpp-iostream +uts-standard-cpp-iterators +uts-standard-cpp-locale-char +uts-standard-cpp-locale-wchar +uts-standard-cpp-numerics +uts-standard-cpp-strings +uts-standard-cpp-support +uts-standard-cpp-util +osp-uts-system +osp-uts-telephony +osp-uts-test +osp-uts-text +osp-uts-ui +osp-uts-ui-animations +osp-uts-ui-controls01 +osp-uts-ui-controls02 +osp-uts-ui-controls03 +osp-uts-ui-controls04 +osp-uts-ui-flash +osp-uts-ui-layout +osp-uts-ui-scenes +osp-uts-uix +osp-uts-uix-service +osp-uts-web +osp-uts-web-json +osp-uts-xml