Commit Graph

20 Commits

Author SHA1 Message Date
Daniel Pfeifer 7a649111cd Use string(APPEND) in Tests
Automate with:

find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:43:04 +02:00
Brad King 972849fbb7 Tests: Simplify CTest.UpdateGIT repo path construction
Avoid constructing full paths to .git repositories in the test.  Use
relative paths and let Git convert them to absolute paths internally.
This is simpler and also avoids trouble with various absolute path root
component conventions on Windows (`c:/`, `/c/`, `/cygdrive/c/`).
2015-12-10 13:54:54 -05:00
Brad King 493388ce48 ctest_update: Fix RETURN_VALUE on VCS tool failure (#15610)
Make RETURN_VALUE report -1 if the update command failed as the
documentation claims.  Also avoid reporting a ctest script-level failure
if the update command fails because we still correctly administered the
update step.
2015-06-11 11:00:48 -04:00
Brad King b6667729cb Tests: Simplify CTest.UpdateGIT QUIET mode test
Parameterize the dashboard script generation to configure custom
content.  Also move state cleanup from previous test back to its block.
2015-06-11 10:57:20 -04:00
Zack Galbreath 645ad117e1 ctest_update: Add QUIET option 2015-02-23 10:01:59 -05:00
Bill Hoffman 39b5df2f37 ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version
This allows ctest_update to get the current version without actually
changing the repository.  This is useful when using Jenkins or an
external project to update the source to a specific version, but you
still want the current version to show up in CDash.
2014-08-18 11:21:36 -04:00
Brad King 78b81b773c CTest: Fix ctest_update with 'HEAD' file in source tree
Add the '--' command-line separator to make the HEAD reference
unambiguous.  Extend the CTest.UpdateGIT test to cover this case.
2013-02-28 11:52:30 -05:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Brad King 5c153c62f3 Make CTest.UpdateGIT robust to Git safecrlf on Windows
If the user has configured 'core.autocrlf' and 'core.safecrlf' then
'git submodule add' will fail to 'git add' the '.gitmodules' file because
it has LF newlines, at least as of Git 1.7.11.  Disable 'core.safecrlf'
in our test repository to avoid the problem.
2012-06-20 10:19:44 -04:00
Brad King e6067ca969 Merge topic 'ctest-git-flexibility'
a7319cf ctest_update: Run 'git submodule' at top level
7bf8dc1 ctest_update: Support ".git file" work trees
65cb72f ctest_update: Abort if Git FETCH_HEAD has no candidates
2010-08-03 16:07:31 -04:00
Brad King 7bf8dc1ac9 ctest_update: Support ".git file" work trees
Commit c3781efb (Support Git upstream branch rewrites, 2010-06-08)
assumed that ".git/FETCH_HEAD" exists inside the source tree.  Fix the
implementation to handle a work tree using a ".git file" to link to its
repository.  Use "git rev-parse --git-dir" to locate the real .git dir.
2010-07-26 11:40:20 -04:00
Brad King bbfe241c6a CTest: Parse empty Git commits correctly
Git's diff-tree format has no '\n'-terminated blank line at the end of
its commit message body block if there are no diff lines.  Instead the
message body is terminated by '\0' and there is no diff section.  Teach
CTest to parse the format in this case.
2010-06-23 09:14:43 -04:00
Brad King c3781efb28 ctest_update: Support Git upstream branch rewrites
Use 'git fetch' followed by 'git reset' to update the source tree.  This
is better than 'git pull' because it can handle a rewritten upstream
branch and does not leave local modifications.  After fetch, parse
FETCH_HEAD to find the merge head that 'git pull' would choose to track
the upstream branch.  Then reset to the selected head.

In the normal fast-forward case the behavior remains unchanged.
However, now local modifications and commits will be erased, and
upstream rewrites are handled smoothly.  This ensures that the upstream
branch is tested as expected.
2010-06-08 16:50:17 -04:00
Brad King 2eae651acc ctest_update: Support custom Git update command
Define CTest configuration variable CTEST_GIT_UPDATE_CUSTOM to set a
custom command line for updating Git-managed source trees.
2010-06-08 16:12:28 -04:00
Brad King 11bdc2b1a1 Generalize CTest.Update* test dashboard script helpers
Teach (create|run)_dashboard_script macros to treat the argument as the
name of a build tree.  Append '.cmake' to generate the dashboard script
name.  This allows future re-use of the macros for multiple test
scripts.
2010-06-08 15:58:39 -04:00
Brad King 67277bacca Teach ctest_update about Git submodules
Git does not automatically checkout the matching version of a submodule
when it checks out a new version of the parent project in the work tree.
If the submodule reference changed in the parent project then we were
reporting the submodule path as a local modification.  Work around the
problem in ctest_update using "git submodule update" after "git pull".
For projects with no submodules this is a no-op.  See issue #10662.
Also add a submodule to the test project for CTest.UpdateGIT to test the
work-around.
2010-05-04 09:40:04 -04:00
Brad King 6e7e71e9b9 Teach CTest.UpdateGIT test to fake file timestamp
We wrap the git executable in a shell script that touches one source
file after 'git pull'.  This makes the file newer than the index even
though it has not actually changed.  If CTest does not refresh the index
properly then the test will fail with a bogus modified file.
2010-02-09 13:31:40 -05:00
Brad King 06332c883f Make CTest.UpdateGIT robust to user git config
Part of this test does "git pull" on a dirty work tree.  We need to make
sure that 'branch.master.rebase' is false for the test repository.
Otherwise if it is true in the user configuration then pull will refuse
to rebase and the test will fail.
2009-09-01 15:41:43 -04:00
Brad King d847ca8e27 BUG: Fix CTest.UpdateGIT test for older git
Older git versions do not support 'git init --bare', so we instead use
the more proper 'git --bare init'.
2009-04-23 09:10:07 -04:00
Brad King 9c17cbeb44 ENH: Teach CTest to handle git repositories
This creates cmCTestGIT to drive CTest Update handling on git-based work
trees.  Currently we always update to the head of the remote tracking
branch (git pull), so the nightly start time is ignored for Nightly
builds.  A later change will address this.  See issue #6994.
2009-04-22 09:19:06 -04:00