-
Notifications
You must be signed in to change notification settings - Fork 608
Simplify cmake test invocation #7043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7043
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 0dcd11c with merge base 047fd37 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
4173529
to
2b57c6c
Compare
CMakeLists.txt
Outdated
if(BUILD_TESTING) | ||
# This contains the list of tests which are always built | ||
add_subdirectory(extension/evalue_util/test) | ||
add_subdirectory(extension/kernel_util/test) | ||
add_subdirectory(extension/memory_allocator/test) | ||
add_subdirectory(extension/parallel/test) | ||
add_subdirectory(extension/pytree/test) | ||
add_subdirectory(kernels/portable/test) | ||
add_subdirectory(kernels/portable/cpu/util/test) | ||
add_subdirectory(kernels/prim_ops/test) | ||
add_subdirectory(kernels/test) | ||
add_subdirectory(runtime/core/exec_aten/testing_util/test) | ||
add_subdirectory(runtime/core/exec_aten/util/test) | ||
add_subdirectory(runtime/core/portable_type/test) | ||
add_subdirectory(runtime/core/test) | ||
add_subdirectory(runtime/executor/test) | ||
add_subdirectory(runtime/kernel/test) | ||
add_subdirectory(runtime/platform/test) | ||
add_subdirectory(test/utils) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move these into test.cmake
@@ -610,7 +614,7 @@ cmake_dependent_option( | |||
) | |||
|
|||
# Add googletest if any test targets should be built | |||
if(EXECUTORCH_BUILD_GTESTS) | |||
if(BUILD_TESTING) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not EXECUTORCH_BUILD_TESTS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUILD_TESTING
is from cmake system to recognize whether test config is on or not. It will be enabled when we include ctest (see https://github.com/pytorch/executorch/pull/7043/files#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR318-R320)
b707f58
to
2835a24
Compare
@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
We can build the test while building the lib, just in one pass.
3dfc419
to
b7c050e
Compare
@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@kirklandsign has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary
We can build the test while building the lib, just in one pass.
After this, developers can run tests while they develop. Both can be built at the same time. For developers, when they write their code, it's easy for them to test out. Just add
-DEXECUTORCH_BUILD_TESTS=ON
to their cmake config. The test target will be built automatically in cmake-out and they can run it.NOTE: examples/models/llama/tokenizer/test and extension/llm/tokenizer/test can't use this right now. They don't have a good triggering path, and can't be triggered from root either. Use the old trigger path for them.
Test plan
Method 1: script for all tests
Method 2: go to cmake-out and test
Method 3: test specific target
For example, we want to test kernel_resolution_test in runtime/core