Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Formatting Check Always Finishes Successfully on Second Invocation #3281

sanssecours opened this issue Nov 25, 2019 · 1 comment


Copy link

@sanssecours sanssecours commented Nov 25, 2019

Steps to Reproduce the Problem

  • Add some incorrectly formatted C or C++ code to the repository

Expected Result

Either Cirrus or Travis should report the incorrectly formatted code. The build jobs that test formatting should finish unsuccessfully.

Actual Result

All build jobs finish successfully.

Additional Information

The script testscr_check_formatting fails in the CI builds as expected. However, since we use ctest $ARGS --rerun-failed:

ctest $ARGS || ctest $ARGS --rerun-failed

the test testscr_check_formatting is executed again. This time the test does not fail, since the source was modified:

if ! git diff --quiet; then
printf >&2 'Source is already modified, aborting test!\n\n'
exit 0


Possible Fix

One option to solve this problem would be to stash the current changes at the end of the I do not know if doing that has other unintended consequences though.


This comment has been minimized.

Copy link

@markus2330 markus2330 commented Nov 25, 2019

Thank you so much for this detailed issue. I think this is a good first issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.