diff options
author | Jakub Kuderski <kubak@google.com> | 2021-07-16 18:48:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 18:48:22 +0300 |
commit | 7320b9acd251939251500813747e5764f2e3bfd4 (patch) | |
tree | a88c02ddbfd470ef4add3506c6a6b4965f9077e2 /README.md | |
parent | e0937d7fd1dbcb306c93d0806954a0dac08f48b9 (diff) |
Explain how to run tests with CMake and Bazel (#4383)
Update README.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -643,8 +643,32 @@ This is experimental. ### Tests -Tests are only built when googletest is found. Use `ctest` to run all the -tests. +Tests are only built when googletest is found. + +#### Running test with CMake + +Use `ctest -j <num threads>` to run all the tests. To run tests using all threads: +```shell +ctest -j$(nproc) +``` + +To run a single test target, use `ctest [-j <N>] -R <test regex>`. For example, +you can run all `opt` tests with: +```shell +ctest -R 'spirv-tools-test_opt' +``` + +#### Running test with Bazel + +Use `bazel test :all` to run all tests. This will run tests in parallel by default. + +To run a single test target, specify `:my_test_target` instead of `:all`. Test target +names get printed when you run `bazel test :all`. For example, you can run +`opt_def_use_test` with: +```shell +bazel test :opt_def_use_test +``` + ## Future Work <a name="future"></a> |