diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-07-24 18:20:50 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-07-24 18:20:50 +0300 |
commit | 9e5ffd02d9780edc437a6b93d73b0fa310dcdd90 (patch) | |
tree | 507cc65e36e920b0cd5a976f622d76d7b3f290cb | |
parent | b0637b8b7ff0c55820b2a47de5cd6792453f1ed8 (diff) | |
download | vcsync-9e5ffd02d9780edc437a6b93d73b0fa310dcdd90.tar.gz vcsync-9e5ffd02d9780edc437a6b93d73b0fa310dcdd90.tar.bz2 |
Improve testsuite
Take into account version differences in CVS and GIT
* tests/atlocal.in (CVS_FORMAT): New variable.
* tests/testsuite.at (CVS_REPO_INIT): Use CVS_FORMAT when forming
template string.
(GIT_COM_INIT): Set user.email and user.name.
-rw-r--r-- | tests/atlocal.in | 17 | ||||
-rw-r--r-- | tests/testsuite.at | 5 |
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/atlocal.in b/tests/atlocal.in index 2906235..2948ecc 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -10,3 +10,20 @@ CVS_BIN=@CVS_BIN@ SVN_BIN=@SVN_BIN@ GIT_BIN=@GIT_BIN@ DFL_VCSYNC_CONF=@abs_top_srcdir@/src/vcsync.conf +# Return 0 if the installed CVS supports new format strings. +function cvs_format_new() { + set -- $($CVS_BIN --version | \ + sed -n \ + -e '/^Concurrent Versions System (CVS)/{' \ + -e 's/.*[0-9][0-9]*\.\([0-9][0-9]*\)\..*/\1/' \ + -e p \ + -e '}') + test "$1" -gt 11 +} + +# CVS_FORMAT is the format string to use in loginfo +if cvs_format_new; then + CVS_FORMAT='%p %s' +else + CVS_FORMAT='%s' +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index 8bb57d8..daf7278 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -26,7 +26,7 @@ dnl CVS_REPO_INIT(DIR, CONF [, NAME]) m4_define([CVS_REPO_INIT],[ $CVS_BIN -d $1 init chmod +w $1/CVSROOT/loginfo -echo "ALL [$BINDIR]/vcsync -c $2 m4_if([$3],,,[--name $3]) %{s}" > $1/CVSROOT/loginfo +echo "ALL [$BINDIR]/vcsync -c $2 m4_if([$3],,,[--name $3]) -- $CVS_FORMAT" > $1/CVSROOT/loginfo chmod -w $1/CVSROOT/loginfo ]) @@ -141,6 +141,9 @@ $GIT_BIN init -q $GIT_BIN remote add -f origin $cwd/repo/test.git >/dev/null $GIT_BIN config branch.master.remote origin $GIT_BIN config branch.master.merge refs/heads/master +$GIT_BIN config user.email "you@example.com" +$GIT_BIN config user.name "Your Name" + $1 $GIT_BIN add README index.html dir/file.html |