Start a library for cvsimport-related tests
[git/mingw.git] / t / t9600-cvsimport.sh
blob98077ab12b7b665ea068b5ef27fc20edadd5ebc4
1 #!/bin/sh
3 test_description='git cvsimport basic tests'
4 . ./lib-cvs.sh
6 CVSROOT=$(pwd)/cvsroot
7 export CVSROOT
9 test_expect_success 'setup cvsroot' 'cvs init'
11 test_expect_success 'setup a cvs module' '
13 mkdir "$CVSROOT/module" &&
14 cvs co -d module-cvs module &&
15 cd module-cvs &&
16 cat <<EOF >o_fortuna &&
17 O Fortuna
18 velut luna
19 statu variabilis,
21 semper crescis
22 aut decrescis;
23 vita detestabilis
25 nunc obdurat
26 et tunc curat
27 ludo mentis aciem,
29 egestatem,
30 potestatem
31 dissolvit ut glaciem.
32 EOF
33 cvs add o_fortuna &&
34 cat <<EOF >message &&
35 add "O Fortuna" lyrics
37 These public domain lyrics make an excellent sample text.
38 EOF
39 cvs commit -F message &&
40 cd ..
43 test_expect_success 'import a trivial module' '
45 git cvsimport -a -z 0 -C module-git module &&
46 test_cmp module-cvs/o_fortuna module-git/o_fortuna
50 test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
52 test_expect_success 'update cvs module' '
54 cd module-cvs &&
55 cat <<EOF >o_fortuna &&
56 O Fortune,
57 like the moon
58 you are changeable,
60 ever waxing
61 and waning;
62 hateful life
64 first oppresses
65 and then soothes
66 as fancy takes it;
68 poverty
69 and power
70 it melts them like ice.
71 EOF
72 cat <<EOF >message &&
73 translate to English
75 My Latin is terrible.
76 EOF
77 cvs commit -F message &&
78 cd ..
81 test_expect_success 'update git module' '
83 cd module-git &&
84 git cvsimport -a -z 0 module &&
85 git merge origin &&
86 cd .. &&
87 test_cmp module-cvs/o_fortuna module-git/o_fortuna
91 test_expect_success 'update cvs module' '
93 cd module-cvs &&
94 echo 1 >tick &&
95 cvs add tick &&
96 cvs commit -m 1
97 cd ..
101 test_expect_success 'cvsimport.module config works' '
103 cd module-git &&
104 git config cvsimport.module module &&
105 git cvsimport -a -z0 &&
106 git merge origin &&
107 cd .. &&
108 test_cmp module-cvs/tick module-git/tick
112 test_expect_success 'import from a CVS working tree' '
114 cvs co -d import-from-wt module &&
115 cd import-from-wt &&
116 git cvsimport -a -z0 &&
117 echo 1 >expect &&
118 git log -1 --pretty=format:%s%n >actual &&
119 test_cmp actual expect &&
120 cd ..
124 test_done