# \`cmake --test .\`?

**URL:** https://discourse.cmake.org/t/cmake-test/6122
**Category:** Usage
**Created:** [July 21, 2022, 6:05pm UTC](https://discourse.cmake.org/t/cmake-test/6122 "2022-07-21T18:05:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![h-vetinari](https://discourse.cmake.org/user_avatar/discourse.cmake.org/h-vetinari/32/2207_2.png) [@h-vetinari](https://discourse.cmake.org/u/h-vetinari)
#### Post date: [July 21, 2022, 6:05pm UTC](https://discourse.cmake.org/t/cmake-test/6122/1 "2022-07-21T18:05:10Z")

</div>

Hey all

I’m not a heavy C/C++ developer, but I help package stuff for the python ecosystem (specifically conda-forge), and – thankfully – more packages are moving to CMake, and away from autotools et al.

In the sequence of configure, build, test, install, it would be natural for me to have

```auto
mkdir build && cd build
cmake $ARGS ..
cmake --build .
cmake --test .
cmake --install .

```

but I cannot find anything about `cmake --test` – perhaps it’s just exceptionally hard to google for, but I cannot even tell if it exists. Neither is it clear how I can do the equivalent invocation across platforms.

In the most prominent [docs](https://cmake.org/cmake/help/book/mastering-cmake/chapter/Testing%20With%20CMake%20and%20CTest.html), there’s no example of how to do this from the environment that’s _calling_ cmake, except `make test`, which I’d like to avoid if possible [^1], and which doesn’t answer how this works on windows, for example.

I’ve found the following [post](https://riptutorial.com/cmake/example/14698/basic-test-suite) that looks quite old (`cmake_minimum_required(2.8)`…) but at least offers an explanation & solution. Still, I was wondering if there’s something better here, and/or whether the docs need to be improved, and/or whether it would make sense to have a `cmake --test` sugar for whatever needs to happen (if it doesn’t exist yet).

[^1]: If I don’t need `make` to generate (having `ninja`), why should I need it just to run the tests…?

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [July 22, 2022, 5:34pm UTC](https://discourse.cmake.org/t/cmake-test/6122/2 "2022-07-22T17:34:26Z")

</div>

There is no `cmake --test`. Use `ctest` instead.
