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.
This commit is contained in:
parent
8bd231866a
commit
6e7e71e9b9
|
@ -25,6 +25,12 @@ set(AUTHOR_CONFIG "[user]
|
||||||
message("Creating test directory...")
|
message("Creating test directory...")
|
||||||
init_testing()
|
init_testing()
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
set(src "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||||
|
configure_file(${src}/CTestUpdateGIT.sh.in ${TOP}/git.sh @ONLY)
|
||||||
|
set(GIT ${TOP}/git.sh)
|
||||||
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Create the repository.
|
# Create the repository.
|
||||||
message("Creating repository...")
|
message("Creating repository...")
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
if test "x$1" = "xpull"; then
|
||||||
|
"@GIT@" "$@" && sleep 1 && touch foo.txt
|
||||||
|
else
|
||||||
|
exec "@GIT@" "$@"
|
||||||
|
fi
|
Loading…
Reference in New Issue