Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to
our own implementation adopted from the KWSys auto_ptr implementation.
Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers
that do not warn about it.
Automate the client site conversions:
git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \
's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
Run clang-tidy's modernize-use-override checker. This checker must have
issues in version 3.8. It has way too little matches. And it adds
override to destructors. Revert the changes on the destructors and
change override to CM_OVERRIDE.
Use clang-tidy's readability-simplify-boolean-expr checker.
After applying the fix-its, revise all changes *very* carefully.
Be aware of false positives and invalid changes.
Use clang-tidy's performance-unnecessary-copy-initialization checker.
After applying the fix-its (which turns the copies into const&), revise
the changes and see whether the copies can be removed entirely by using
the original instead.
Use clang-tidy's performance-unnecessary-value-param checker to find
value parameter declarations of expensive to copy types that are not
modified inside the function. Ignore findings in kwsys.
After applying the fix-its, manually change `const T&` to `T const&`.
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
The clang-format tool may turn this:
public: // comment about access specifier
// unrelated comment indented with code
...
Into:
public: // comment about access specifier
// unrelated comment indented with code
...
Avoid this by moving comments off of access specifier lines.
The clang-format tool can do a good job formatting most code, but
well-organized streaming blocks are best left manually formatted.
Find blocks of the form
os <<
"...\n"
"...\n"
;
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}'
Find blocks of the form
os << "...\n"
<< "...\n"
<< "...\n";
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}'
Surround such blocks with the pair
/* clang-format off */
...
/* clang-format on */
in order to protect them from update by clang-format. Use the C-style
`/*...*/` comments instead of C++-style `//...` comments in order to
prevent them from ever being swallowed by re-formatting of surrounding
comments.
Sort include directives within each block (separated by a blank line) in
lexicographic order (except to prioritize `sys/types.h` first). First
run `clang-format` with the config file:
---
SortIncludes: false
...
Commit the result temporarily. Then run `clang-format` again with:
---
SortIncludes: true
IncludeCategories:
- Regex: 'sys/types.h'
Priority: -1
...
Commit the result temporarily. Start a new branch and cherry-pick the
second commit. Manually resolve conflicts to preserve indentation of
re-ordered includes. This cleans up the include ordering without
changing any other style.
Use the following command to run `clang-format`:
$ git ls-files -z -- \
'*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
egrep -z -v '^Source/cm_sha2' |
egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
egrep -z -v '^Utilities/(KW|cm).*/' |
egrep -z -v '^Tests/Module/GenerateExportHeader' |
egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
xargs -0 clang-format -i
This selects source files that do not come from a third-party.
Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
c18d91ad Help: add release notes for topic 'ctest-run-submodule-sync'
7f560743 cmCTestGIT: run `git submodule sync` before updating submodules
06b310b5 cmCTestGIT: add an option to initialize submodules on update
56c1ea40 cmCTestGIT: fix git version references
Currently, CTest will not initialize any submodules within the already
checked out source tree. Add an option to do so. The use case for not
doing so is that some submodules may not be necessary for the current
test and keeping network usage down may be important.
This commit fixes a bug in the implementation of the test property
TIMEOUT_AFTER_MATCH. The new timeout value was being applied
every time a line was output by the test after the match had been
encountered. Now the new timeout value is only set once.
This commit also improves some output formatting related to this
property.
When performing some other testing, the globs for Blanket.js and Delphi
code coverage are picking up unintended files. Change the query for the
Delphi coverage to follow the naming convention, and check the second line
of the found JSON files for certain text before parsing them as coverage files.
Since commit v3.3.0-rc1~410^2~3 (ctest_test: Add QUIET option,
2015-02-17) if tests fail when QUIET is used one sees:
The following tests FAILED:
but not the subsequent line(s) indicating which tests failed.
Restore the list of failed tests.
Change the Cobertura handler to look for an environment variable
called "COBERTURADIR" which contains the directory where the
coverage.xml file is found. If that variable doesn't exist,
continue to use the default of the binary directory.
Update the test to use an appropriate value in the environment
variables.
Refactoring in commit v3.4.0-rc1~390^2~1 (cmCTestMultiProcessHandler:
Refactor RUN_SERIAL implementation, 2015-06-01) forgot to update a code
path for cleaning up after a failed RUN_SERIAL test. This causes an
infinite loop after a RUN_SERIAL test fails. Fix it and add a test.