Skip to content

[cmake] Support running tests on Android device with ctest - #2363

Merged
antiagainst merged 5 commits into
iree-org:mainfrom
antiagainst:android-cmake-tests
Jul 1, 2020
Merged

antiagainst merged 5 commits into
iree-org:mainfrom
antiagainst:android-cmake-tests

Conversation

@antiagainst

Copy link
Copy Markdown
Member

This commit adds test targets for pushing and running cross
compilation artifacts on Android devices. This makes testing
with Android devices easier: now we just need to run ctest
under the cross compilation build directory.

This commit adds test targets for pushing and running cross
compilation artifacts on Android devices. This makes testing
with Android devices easier: now we just need to run `ctest`
under the cross compilation build directory.
Comment on lines +111 to +112
# Case for cross-compiling towards Android.
if(ANDROID)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty long function now, could refactor this block into a helper to save on some indentation. WDYT?

if(ANDROID)
  helper_function(args...)
  return()
endif()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. I might get to this later.

Comment thread build_tools/cmake/iree_cc_test.cmake Outdated
set_tests_properties(${_PERMISSION_NAME} PROPERTIES DEPENDS ${_PUSH_NAME})
set_tests_properties(${_RUN_NAME} PROPERTIES DEPENDS ${_PERMISSION_NAME})
endif()
return()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loses the labels below. Can you preserve those? Maybe set a _TEST_NAME variable in either branch of an if that creates either an android or a normal test and then have the test properties.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Actually what are these labels used for?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering mostly. Also just nice to have. cmake will give you runtime and such by label

Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
@antiagainst
antiagainst requested a review from GMNGeoffrey July 1, 2020 00:24
Comment thread build_tools/cmake/run_android_test.sh Resolved
Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
Comment thread build_tools/cmake/iree_cc_test.cmake Resolved
@GMNGeoffrey

Copy link
Copy Markdown
Member

Ignore the failing android_arm64_cmake check. I pointed a manual run at the wrong PR 🤦

@antiagainst
antiagainst merged commit f505f59 into iree-org:main Jul 1, 2020
@antiagainst
antiagainst deleted the android-cmake-tests branch July 1, 2020 11:23
ScottTodd pushed a commit to ScottTodd/iree that referenced this pull request Jul 6, 2020
…2363)

This commit adds test targets for pushing and running cross
compilation artifacts on Android devices. This makes testing
with Android devices easier: now we just need to run `ctest`
under the cross compilation build directory.
@GMNGeoffrey GMNGeoffrey mentioned this pull request Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants