Commit Graph

19 Commits

Author SHA1 Message Date
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
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.
2016-05-16 16:05:19 -04:00
Brad King 5e871f7089 Tests: Sort includes of sys/types.h as clang-format would 2016-05-03 10:08:41 -04:00
Brad King e1c7747253 Format include directive blocks and ordering with clang-format
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>
2016-04-29 13:58:54 -04:00
Sean McBride a27edd8a05 Fix XCode -> Xcode typos, notably in man page (#12231) 2011-05-31 09:13:00 -04:00
Ben Boeckel 0594287606 Add more tests for WorkingDirectory for tests 2011-01-20 13:47:53 -05:00
Ben Boeckel 6529d7f67e Pass the expected value as the first argument
When the path has regular expression special characters, the
PASS_REGULAR_EXPRESSION value can fail to compile.
2011-01-03 08:39:22 -05:00
Ben Boeckel 96309fc6e2 Make TestsWorkingDirectory test a C file 2010-12-17 12:34:20 -05:00
Ben Boeckel a4a5e37568 Use iostream to make Borland happy
It seems as though cstdio doesn't bring in stdio.h with the Borland
compilers.
2010-12-17 11:07:40 -05:00
Ben Boeckel cfe53cddbd Fully specify the path to old-signature add_test 2010-12-17 11:07:19 -05:00
Ben Boeckel 017d4e9d2c Group adding tests with its properties 2010-12-17 11:06:59 -05:00
Ben Boeckel 561cc3359c Only test the default cwd with Makefiles
XCode and Visual Studio generators can run from
${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE} and determining this at
testing time is not feasible without adding in more
PASS_REGULAR_EXPRESSION's which may create false positives.

Since the parsing code is in cross-platform, generator-agnostic  code,
if it passes with Makefiles, it should work with other generators on
other platforms.
2010-12-17 10:24:14 -05:00
Ben Boeckel d87bae7f74 Simplify the _default_cwd derivation 2010-12-17 10:23:54 -05:00
Ben Boeckel 992c74f3e0 Use --><-- markers to denote the path 2010-12-17 10:23:24 -05:00
Ben Boeckel 5249551f9f Flip slashes around on Windows 2010-12-17 09:45:39 -05:00
Ben Boeckel 0a014dab5c Add ctype.h include for toupper() 2010-12-17 09:23:59 -05:00
Ben Boeckel af12f83d80 Fix header includes for C++ and Visual Studio 2010-12-17 09:14:25 -05:00
Ben Boeckel 5597aa24f1 Rename the project to match the test 2010-12-16 17:29:19 -05:00
Ben Boeckel 9bf4165437 Add tests for WORKING_DIRECTORY arg to add_test 2010-12-16 16:50:48 -05:00
Ben Boeckel 7679f9fab0 Rename WorkingDirectory test 2010-12-16 16:50:47 -05:00