[Cmake-commits] CMake branch, next, updated. v3.7.2-2549-gc13efe3

Brad King brad.king at kitware.com
Sat Feb 4 08:20:44 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  c13efe3208f32cba458eb89dde44f3fe29828a7e (commit)
       via  8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa (commit)
       via  9d34e51cdb7ccc74eaf851f1784433616bc9c31a (commit)
      from  3d4e6340f31d9c5b15ad0a748a7295eaea7e8943 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c13efe3208f32cba458eb89dde44f3fe29828a7e
commit c13efe3208f32cba458eb89dde44f3fe29828a7e
Merge: 3d4e634 8a5cb84
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Feb 4 08:20:41 2017 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Feb 4 08:20:41 2017 -0500

    Merge topic 'androidtestutilities_cleanup' into next
    
    8a5cb84b AndroidTestUtilities: do not require ExternalData unconditionally
    9d34e51c AndroidTestUtilities: ignore exit status of ls


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa
commit 8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Fri Feb 3 15:44:51 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Feb 4 08:16:24 2017 -0500

    AndroidTestUtilities: do not require ExternalData unconditionally
    
    Attempting to use AndroidTestUtilities to simply install some local
    files on device can result in the following error:
    
        Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set
    
    We no longer require these ExternalData-specific variables to be set if
    no such remote data files are requested.
    
    Fixes: #16529

diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake
index a0a74fa..62d04f3 100644
--- a/Modules/AndroidTestUtilities.cmake
+++ b/Modules/AndroidTestUtilities.cmake
@@ -110,11 +110,18 @@ function(android_add_test_data test_name)
   endforeach()
 
   set(DATA_TARGET_NAME "${test_name}")
-  ExternalData_Expand_Arguments(
-    ${DATA_TARGET_NAME}
-    extern_data_output
-    ${AST_FILES})
-  ExternalData_Add_Target(${DATA_TARGET_NAME})
+  string(FIND "${AST_FILES}" "DATA{" data_files_found)
+  if(${data_files_found} GREATER "-1")
+    # Use ExternalData if any DATA{} files were found.
+    ExternalData_Expand_Arguments(
+      ${DATA_TARGET_NAME}
+      extern_data_output
+      ${AST_FILES})
+    ExternalData_Add_Target(${DATA_TARGET_NAME})
+  else()
+    add_custom_target(${DATA_TARGET_NAME} ALL)
+    set(extern_data_output ${AST_FILES})
+  endif()
 
   # For regular files on Linux, just copy them directly.
   foreach(path ${AST_FILES})
diff --git a/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake b/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake
index f0ae24b..7d031d4 100644
--- a/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake
+++ b/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake
@@ -18,3 +18,4 @@ endfunction()
 run_ATU(SetupTest1 "")
 run_ATU(SetupTest2 "tests")
 run_ATU(SetupTest3 "tests")
+run_ATU(SetupTest4 "")
diff --git a/Tests/RunCMake/AndroidTestUtilities/SetupTest4.cmake b/Tests/RunCMake/AndroidTestUtilities/SetupTest4.cmake
new file mode 100644
index 0000000..9a27266
--- /dev/null
+++ b/Tests/RunCMake/AndroidTestUtilities/SetupTest4.cmake
@@ -0,0 +1,13 @@
+enable_testing()
+include(AndroidTestUtilities)
+
+find_program(adb_executable adb)
+
+set(test_files "data/a.txt")
+
+set(ANDROID 1)
+
+android_add_test_data(setup_test
+  FILES ${test_files}
+  DEVICE_TEST_DIR "/data/local/tests/example1"
+  DEVICE_OBJECT_STORE "/sdcard/.ExternalData/SHA")
diff --git a/Tests/RunCMake/AndroidTestUtilities/SetupTest4Build-check.cmake b/Tests/RunCMake/AndroidTestUtilities/SetupTest4Build-check.cmake
new file mode 100644
index 0000000..ef7569d
--- /dev/null
+++ b/Tests/RunCMake/AndroidTestUtilities/SetupTest4Build-check.cmake
@@ -0,0 +1,5 @@
+include(${CMAKE_CURRENT_LIST_DIR}/check.cmake)
+compare_build_to_expected(FILES
+  "data/a.txt"
+  )
+check_for_setup_test()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d34e51cdb7ccc74eaf851f1784433616bc9c31a
commit 9d34e51cdb7ccc74eaf851f1784433616bc9c31a
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Fri Feb 3 13:22:36 2017 -0500
Commit:     Zack Galbreath <zack.galbreath at kitware.com>
CommitDate: Fri Feb 3 13:22:36 2017 -0500

    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.

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()

-----------------------------------------------------------------------

Summary of changes:
 Modules/AndroidTestUtilities.cmake                    |   17 ++++++++++++-----
 .../AndroidTestUtilities/PushToAndroidDevice.cmake    |    4 +++-
 .../RunCMake/AndroidTestUtilities/RunCMakeTest.cmake  |    1 +
 .../{SetupTest1.cmake => SetupTest4.cmake}            |    4 ----
 ...1Build-check.cmake => SetupTest4Build-check.cmake} |    0
 5 files changed, 16 insertions(+), 10 deletions(-)
 copy Tests/RunCMake/AndroidTestUtilities/{SetupTest1.cmake => SetupTest4.cmake} (71%)
 copy Tests/RunCMake/AndroidTestUtilities/{SetupTest1Build-check.cmake => SetupTest4Build-check.cmake} (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list