Skip to content

[cmake][test] Add a add_glow_test function and 'check' target #1104

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

Merged
merged 1 commit into from
Jun 6, 2018
Merged

[cmake][test] Add a add_glow_test function and 'check' target #1104

merged 1 commit into from
Jun 6, 2018

Conversation

qcolombet
Copy link
Contributor

Introduce the add_glow_test function that on top of adding the test
to the list of tests to be run with ctest, it will register the
dependencies on the actual executable.
Thanks to this information, the new 'check' target can re-build
the test executables if needed and then run the test.

In other words, the combination of those two additions act like
ninja all && ninja test, except we don't have to think about it.

@qcolombet
Copy link
Contributor Author

Note: This is a proof-of-concept of how we could solve issue [https://github.com//issues/1086].

Let me know if I should carry on. In particular, if we decide to use this check target, I would probably need to update the read me.

CMakeLists.txt Outdated
@@ -75,3 +76,9 @@ add_subdirectory(tests)
add_custom_target(dependency_graph
"${CMAKE_COMMAND}" "--graphviz=dependency_graph" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")

# Fecth the dependencies for all the tests.

This comment was marked as off-topic.

@@ -67,7 +67,7 @@ target_link_libraries(MLTest
ExecutionEngine
gtest
testMain)
add_test(MLTest ${GLOW_BINARY_DIR}/tests/MLTest)
add_glow_test(MLTest COMMAND ${GLOW_BINARY_DIR}/tests/MLTest)

This comment was marked as off-topic.

This comment was marked as off-topic.

Introduce the add_glow_test function that on top of adding the test
to the list of tests to be run with ctest, it will register the
dependencies on the actual executable.
Thanks to this information, the new 'check' target can re-build
the test executables if needed and then run the test.

In other words, the combination of those two additions act like
`ninja all && ninja test`, except we don't have to think about it.
@qcolombet qcolombet merged commit 1116b5a into pytorch:master Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants