[cmake-developers] [PATCH v2 0/2] Support for continue command

Gregor Jasny gjasny at googlemail.com
Tue Nov 4 15:10:18 EST 2014


Hello,

I added some tests for the continue command but ran into a
problem when matching stdout output:

302:   Expected stdout to match:
302: 
302:    expect-out> a
302:    expect-out> aa
302:    expect-out> aaaa
302:    expect-out> aaaaa
302: 
302:   Actual stdout:
302: 
302:    actual-out> Not searching for unused variables given on the command line.
302:    actual-out> -- a
302:    actual-out> -- aa
302:    actual-out> -- aaaa
302:    actual-out> -- aaaaa
302:    actual-out> -- Configuring done
302:    actual-out> -- Generating done
302:    actual-out> -- Build files have been written to: /Users/jasny/src/cmake/Tests/RunCMake/continue/ContinueWhile-build

How do I strip off the trailing "Configuring done" and following lines? No other -stdout.txt file I checked contains these.

About the continue() outside of a block error: I added a test but I have no idea how to enforce the desired behavior. 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.

Thanks,
Gregor

Gregor Jasny (2):
  Add continue keyword (#14013)
  Add tests for continue command

 Help/command/continue.rst                          |  7 +++
 Source/cmBootstrapCommands1.cxx                    |  2 +
 Source/cmContinueCommand.cxx                       | 21 +++++++++
 Source/cmContinueCommand.h                         | 55 ++++++++++++++++++++++
 Source/cmExecutionStatus.h                         |  7 +++
 Source/cmForEachCommand.cxx                        |  4 ++
 Source/cmIfCommand.cxx                             |  5 ++
 Source/cmWhileCommand.cxx                          |  4 ++
 Tests/RunCMake/CMakeLists.txt                      |  1 +
 Tests/RunCMake/continue/CMakeLists.txt             |  3 ++
 Tests/RunCMake/continue/ContinueForeach-stdout.txt |  2 +
 Tests/RunCMake/continue/ContinueForeach.cmake      |  6 +++
 .../continue/ContinueNestedForeach-stdout.txt      |  4 ++
 .../RunCMake/continue/ContinueNestedForeach.cmake  | 11 +++++
 Tests/RunCMake/continue/ContinueWhile-stdout.txt   |  4 ++
 Tests/RunCMake/continue/ContinueWhile.cmake        |  8 ++++
 .../RunCMake/continue/NoEnclosingBlock-result.txt  |  1 +
 .../RunCMake/continue/NoEnclosingBlock-stderr.txt  |  1 +
 Tests/RunCMake/continue/NoEnclosingBlock.cmake     |  1 +
 Tests/RunCMake/continue/RunCMakeTest.cmake         |  6 +++
 20 files changed, 153 insertions(+)
 create mode 100644 Help/command/continue.rst
 create mode 100644 Source/cmContinueCommand.cxx
 create mode 100644 Source/cmContinueCommand.h
 create mode 100644 Tests/RunCMake/continue/CMakeLists.txt
 create mode 100644 Tests/RunCMake/continue/ContinueForeach-stdout.txt
 create mode 100644 Tests/RunCMake/continue/ContinueForeach.cmake
 create mode 100644 Tests/RunCMake/continue/ContinueNestedForeach-stdout.txt
 create mode 100644 Tests/RunCMake/continue/ContinueNestedForeach.cmake
 create mode 100644 Tests/RunCMake/continue/ContinueWhile-stdout.txt
 create mode 100644 Tests/RunCMake/continue/ContinueWhile.cmake
 create mode 100644 Tests/RunCMake/continue/NoEnclosingBlock-result.txt
 create mode 100644 Tests/RunCMake/continue/NoEnclosingBlock-stderr.txt
 create mode 100644 Tests/RunCMake/continue/NoEnclosingBlock.cmake
 create mode 100644 Tests/RunCMake/continue/RunCMakeTest.cmake

-- 
1.9.3 (Apple Git-50)



More information about the cmake-developers mailing list