Commit Graph

11 Commits

Author SHA1 Message Date
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
Brad King 180538c706 Source: Stabilize include order
Each source file has a logical first include file.  Include it in an
isolated block so that tools that sort includes do not move them.
2016-04-29 13:58:31 -04:00
Zack Galbreath fc58bdb9ad ctest_coverage: Add QUIET option 2015-02-23 10:02:00 -05:00
Stephen Kelly 930bd47816 Replace 'foo.size() == 0' pattern with foo.empty(). 2015-01-18 14:25:24 +01:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Joseph Snyder 9ad07fbeb8 CTest: Fix MUMPS coverage parsing and test
Fix the MUMPS coverage parser:

* Account for tabs after entry points

* Stop double incrementing lines that have explicit calls to the 0 line

* If a line has been previously marked as non executable, but then
  contains a count, increment it an extra one to push it back into
  the executable code set.

Add a custom routine and corresponding coverage files in the test case.
This file is smaller and has cmcov/mcov files that have data for only
that routine.
2014-05-16 10:16:40 -04:00
Clinton Stimpson 5730710c86 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
2014-01-07 09:27:44 -05:00
Bill Hoffman c806b23cfe CDash now supports lots of files in coverage. So, show all files.
Prior to this commit the mumps coverage only showed files that
had at least one line of coverage. Now 0% covered files are shown
as well.
2012-05-11 15:22:25 -04:00
Bill Hoffman 0a169e628b Remove uncovered files from cache coverage data.
Cache coverage data currently contains files with 0 coverage
on each line. This change will remove those files from the coverage
sent to CDash.
2012-05-02 17:23:01 -04:00
Bill Hoffman f5c5db0753 Fix some warnings and a bug where it went past the length of a vector.
Fix a kwstyle warning and an unused variable warning. Also fix a case
where it could crash because a vector was referenced passed its
end.
2012-05-01 17:32:23 -04:00
Bill Hoffman 7955e995ec Add support for Cache coverage.
This adds support for Cache coverage parsing. A test is added
that does a basic run of the coverage on a small bit of data.
2012-05-01 17:00:43 -04:00