# CTest --show-only interaction with CTEST\_CUSTOM\_POST\_TEST

**URL:** https://discourse.cmake.org/t/ctest-show-only-interaction-with-ctest-custom-post-test/3309
**Category:** Usage
**Created:** [May 12, 2021, 7:09pm UTC](https://discourse.cmake.org/t/ctest-show-only-interaction-with-ctest-custom-post-test/3309 "2021-05-12T19:09:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rleigh](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/9de053/32.png) [@rleigh](https://discourse.cmake.org/u/rleigh)
#### Post date: [May 12, 2021, 7:09pm UTC](https://discourse.cmake.org/t/ctest-show-only-interaction-with-ctest-custom-post-test/3309/1 "2021-05-12T19:09:08Z")

</div>

Hi folks,

I’ve had failures running `ctest` within CLion. It turns out this is due to an interaction between “–show-only=json-v1” and “CTEST\_CUSTOM\_POST\_TEST”:

`ctest --show-only=json-v1`:

```
  "version" :
  {
    "major" : 1,
    "minor" : 0
  }
}------------------------------------------------------------------------------
GCC Code Coverage Report

```

As you can see, the JSON output was fine, but it was concatenated with the script I use to provide global coverage metrics (for all tests run) as a post-test action.

Should `ctest` be running post-test actions when “show-only”? Is that a bug or an intentional design choice?

Is there any way of disabling post-test script execution when running `--show-only`? Alternatively, is there any way of determining that I am running in “show only” mode within the post-test script, so I can skip output in this situation either within CTestCustom.cmake or my post-test script?

Internally, I can see that `ctest` has a Quiet member variable, but I don’t see this propagated to the script environment, nor any self-test-related variable? Is this the case? Should this execution behaviour setting be propagated to the script environment if this is not already the case?

Many thanks,  
Roger
