summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2017-02-03 18:22:36 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2017-02-03 18:22:36 (GMT)
commit9d34e51cdb7ccc74eaf851f1784433616bc9c31a (patch)
tree2849e5bfc0b8f7a80caf708e2ee2af36e8d99ed7 /Modules
parentfb26fcb261c927687f66b556df83ff6546f9bbd9 (diff)
downloadCMake-9d34e51cdb7ccc74eaf851f1784433616bc9c31a.zip
CMake-9d34e51cdb7ccc74eaf851f1784433616bc9c31a.tar.gz
CMake-9d34e51cdb7ccc74eaf851f1784433616bc9c31a.tar.bz2
AndroidTestUtilities: ignore exit status of ls
adb used to suffer from a bug where `adb shell` would return 0 irrespective the exit status of the underlying process that it executed. This is now fixed for newer versions of Android (N+). As a result, attempting to `adb shell ls` a nonexistent file can now result in a non-zero exit status. Updating check_device_file_exists to ignore the exit status of `adb shell` fixes this bug for newer Android devices.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/AndroidTestUtilities/PushToAndroidDevice.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
index d8ca730..04529b1 100644
--- a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
+++ b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
@@ -39,7 +39,9 @@ function(android_push_test_files_to_device)
# if(file_exists) will return true.
macro(check_device_file_exists device_file file_exists)
set(${file_exists} "")
- execute_adb_command(shell ls ${device_file})
+ execute_process(
+ COMMAND ${adb_executable} shell ls ${device_file}
+ OUTPUT_VARIABLE out_var ERROR_VARIABLE out_var)
if(NOT out_var) # when a directory exists but is empty the output is empty
set(${file_exists} "YES")
else()