C++ how to run tests optionally

acgetchell's Avatar


21 Oct, 2019 09:14 PM

I have some tests that may fail/segfault, which causes a build failure:


Is there a way to run make --build . --target test such that errors or segfaults don't cause a build failure?

  1. 1 Posted by acgetchell on 21 Oct, 2019 09:20 PM

    acgetchell's Avatar

    N.B. I've tried on_success and on_finish.

  2. 2 Posted by acgetchell on 21 Oct, 2019 09:42 PM

    acgetchell's Avatar

    In Travis-CI, after_success allows this functionality.


  3. Support Staff 3 Posted by Feodor Fitsner on 22 Oct, 2019 12:16 AM

    Feodor Fitsner's Avatar

    Right, in AppVeyor failing command in on_success fails the build.

    However, you may try something like make --build . --target test & exit 0 or run it as PowerShell: - ps: make --build . --target test.

  4. 4 Posted by acgetchell on 22 Oct, 2019 05:51 PM

    acgetchell's Avatar

    Great, thanks! make --build . --target test & exit 0 worked!

    Powershell still failed the build.

  5. Support Staff 5 Posted by Feodor Fitsner on 22 Oct, 2019 06:47 PM

    Feodor Fitsner's Avatar

    OK, nice. Most probably PowerShell was failing because the process was writing to StdErr which is interpreted by PS as an exception.

  6. Feodor Fitsner closed this discussion on 03 Apr, 2020 06:45 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac