Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kuderski <kubak@google.com>2021-07-16 18:48:22 +0300
committerGitHub <noreply@github.com>2021-07-16 18:48:22 +0300
commit7320b9acd251939251500813747e5764f2e3bfd4 (patch)
treea88c02ddbfd470ef4add3506c6a6b4965f9077e2 /README.md
parente0937d7fd1dbcb306c93d0806954a0dac08f48b9 (diff)
Explain how to run tests with CMake and Bazel (#4383)
Update README.
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 26 insertions, 2 deletions
diff --git a/README.md b/README.md
index db52b79fe..804b76379 100644
--- a/README.md
+++ b/README.md
@@ -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>