# tests that are meant to abort()

**URL:** https://discourse.cmake.org/t/tests-that-are-meant-to-abort/537
**Category:** Code
**Created:** [January 24, 2020, 11:01pm UTC](https://discourse.cmake.org/t/tests-that-are-meant-to-abort/537 "2020-01-24T23:01:07Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![perlun](https://discourse.cmake.org/user_avatar/discourse.cmake.org/perlun/32/3744_2.png) [@perlun](https://discourse.cmake.org/u/perlun)
#### Post date: [August 21, 2023, 7:44pm UTC](https://discourse.cmake.org/t/tests-that-are-meant-to-abort/537/11 "2023-08-21T19:44:24Z")

</div>

Discovering/hijacking this a few years later (…), I can add that processes raising `SIGABRT` (e.g. using asserts which call `abort()`) will cause ctest to print `Exception:Subprocess aborted` and _not show the output from the failing program_ despite how hard I try to make it: passing `--extra-verbose` or setting `CTEST_OUTPUT_ON_FAILURE=1` in the environment won’t make a single bit of a difference.

Then when I switched the assertion code in my project to use `exit(1)` instead, it instantly started working.

Is this by design or is this a limitation in ctest/cmake? I’ll readily admit I am (_very_ much) a newbie user of cmake. The versions I’ve tested thus far are 3.24.2 which comes bundled with my CLion and 3.25.1; both seem to exhibit the same behaviour. The exception (in ctest) is typically thrown at this line: [https://github.com/Kitware/CMake/blob/v3.25.1/Source/CTest/cmCTestRunTest.cxx#L255](https://github.com/Kitware/CMake/blob/v3.25.1/Source/CTest/cmCTestRunTest.cxx#L255), which can be seen when running ctest with `--debug`.

Any ideas?

---

_[View the full topic](https://discourse.cmake.org/t/tests-that-are-meant-to-abort/537)._
