[cmake-developers] [PATCH v2 0/2] Support for continue command
Brad King
brad.king at kitware.com
Tue Nov 4 15:21:04 EST 2014
On 11/04/2014 03:10 PM, Gregor Jasny wrote:
> 302: Expected stdout to match:
> 302:
> 302: expect-out> a
> 302: expect-out> aa
> 302: expect-out> aaaa
> 302: expect-out> aaaaa
The message(STATUS) output lines start with "-- " so you need to
add that to your expected output in order to match correctly.
> How do I strip off the trailing "Configuring done" and following lines?
You don't need to do that because the expectation does not have to match
the entire output unless you add your own '^' at the beginning and '$'
at the end.
> About the continue() outside of a block error: I added a test but I
> have no idea how to enforce the desired behavior.
It's been a while since I looked at the relevant parts of the code
but here is one approach that may work:
Find all call sites to cmMakefile::ExecuteCommand. Teach them to
check the resulting status argument for GetContinueInvoked. If it
is true for any call sites other than the loop implementations then
it is an error.
> Note: cmake does not error out on break() outside of loops, too. I
> guess the original author used the break() code as boilerplate for
> continue() therefore they show the same bug.
The break() command was added a long time ago when we were much less
mature and also less rigorous about testing. That bug should be fixed
in break() with a policy, but that is outside the scope of your work
to add the new continue() command. If you want to try it as another
topic after adding continue() I can provide guidance.
Thanks,
-Brad
More information about the cmake-developers
mailing list