xref: /oneTBB/cmake/android/test_launcher.cmake (revision b15aabb3)
1# Copyright (c) 2020-2021 Intel Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15include(${CMAKE_CURRENT_LIST_DIR}/environment.cmake)
16
17# transfer data to device
18execute_on_device("mkdir -m 755 -p ${ANDROID_DEVICE_TESTING_DIRECTORY}")
19
20file (GLOB_RECURSE BINARIES_LIST "${BINARIES_PATH}/*.so*" "${BINARIES_PATH}/${TEST_NAME}")
21foreach(BINARY_FILE ${BINARIES_LIST})
22    transfer_data(${BINARY_FILE})
23endforeach()
24
25# execute binary
26execute_on_device("chmod -R 755 ${ANDROID_DEVICE_TESTING_DIRECTORY}")
27execute_on_device("LD_LIBRARY_PATH=${ANDROID_DEVICE_TESTING_DIRECTORY} ${ANDROID_DEVICE_TESTING_DIRECTORY}/${TEST_NAME}")
28