Mousius commented on pull request #8809:
URL: https://github.com/apache/tvm/pull/8809#issuecomment-903972516


   Hi @junrushao1994,
   
   Could you elaborate on what further you'd be interested in seeing? The 
current documentation references running the C++ tests using the 
`./tests/script/task_cpp_unittest.sh` which this change allows to continue 
transparently 
(https://github.com/apache/tvm/blob/main/docs/install/from_source.rst).
   
   As far as what this patch actually does, `make cpptest` will now build a 
single `cpptest` binary from `${TEST_SRCS}`, which `gtest_discover_tests` will 
scan to find the actual GTest tests and generate `add_test` and 
`set_tests_properties` behind the scenes in CMake, such as:
   ```
   add_test( Array.Iterator /workspaces/tvm-sandbox-micro/src/tvm/build/cpptest 
[==[--gtest_filter=Array.Iterator]==] --gtest_also_run_disabled_tests)
   set_tests_properties( Array.Iterator PROPERTIES WORKING_DIRECTORY 
/workspaces/tvm-sandbox-micro/src/tvm/build SKIP_REGULAR_EXPRESSION [==[\[  
SKIPPED \]]==])
   ```
   
   This then allows your IDE or other tools to inspect this and generate 
commands to invoke individual tests from within the editor:
   
![ctest-explorer](https://user-images.githubusercontent.com/4933431/130491062-c357338b-2180-4e02-9686-b5f51d7f285e.png)
   
   Currently whilst you can find the `_test` targets and build/run them there's 
no easy way of breaking that down any further; for example, if I just wanted to 
run the `AOTMemory.Allocate` test.
   
   Let me know if there's anything else you're interested in :smile_cat: 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to