C++ how to run tests optionally

acgetchell's Avatar

acgetchell

21 Oct, 2019 09:14 PM

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

https://ci.appveyor.com/project/acgetchell/cdt-test/builds/28271980...

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.

    https://travis-ci.com/acgetchell/CDT-test/jobs/248066114#L3020

  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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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

Recent Discussions

05 Dec, 2019 09:12 PM
04 Dec, 2019 07:46 PM
04 Dec, 2019 12:01 AM
04 Dec, 2019 12:00 AM
03 Dec, 2019 11:00 PM