How to run testusdview tests

Hello!

I’m looking to run the tests from here, but I’m not sure how to do that.

Attempt 1: Building with the python script
After building with python build_scripts/build_usd.py --tests <build_dir> my <build_dir> has a tests folder with all of the targets I see in the CMakeLists.txt file above, however after trying to run ctest in various ways in various places within this tests folder, I always get No tests were found!!! but there are some artifacts there, for example I see the files in testUsdviewAlive in <build_dir>/tests/ctest/testUsdviewAlive so it seems to me that this line is working, but I’m not sure what the result of this line is. Where are tests registered so that ctest will find them? What is the ctest command to run the testUsdviewAlive test in this case?

Attempt 2: Building with cmake
Is building with cmake necessary in order to run these tests? I’ve been failing to build successfully on mac with boost version issues and not finding tbb, even though things seem set to me. I can continue to push through this way and then my hope is that I could run the tests though Xcode. I wanted to ask here before continuing down this path though since it seems like it should be possible though the python script

Thanks for any help

The unit tests need to be run from within the CMake build directory, which is where CMake puts all of its build configuration files. This is typically the directory in which cmake is run, and is different from where the build ultimately installs USD itself.

More concretely – if you ran build_usd.py --tests <build_dir>, there should be a <build_dir>/build/OpenUSD directory. If you go into that directory, then run ctest the tests should all execute.

1 Like

This worked! Thank you so much for the help