@matheusbsbs / matheus-bagliano / commits / 795c7c0b08
Fork 0

Add basic cvsimport tests

We weren't even testing basic things before, so let's at least try importing and updating a trivial repository, which will catch total breakage. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Nov 28, 2007 at 13:55 UTC 795c7c0b08fefc7d0f5d0903d8341491350996f0
1 file changed +99
t/t9600-cvsimport.sh new
+99
@@ -0,0 +1,99 @@
1 +#!/bin/sh
2 +
3 +test_description='git-cvsimport basic tests'
4 +. ./test-lib.sh
5 +
6 +if ! ( type cvs && type cvsps ) >/dev/null 2>&1
7 +then
8 + test_expect_success 'skipping cvsimport tests, cvs/cvsps not found' ''
9 + test_done
10 + exit
11 +fi
12 +
13 +CVSROOT=$(pwd)/cvsroot
14 +export CVSROOT
15 +# for clean cvsps cache
16 +HOME=$(pwd)
17 +export HOME
18 +
19 +test_expect_success 'setup cvsroot' 'cvs init'
20 +
21 +test_expect_success 'setup a cvs module' '
22 +
23 + mkdir $CVSROOT/module &&
24 + cvs co -d module-cvs module &&
25 + cd module-cvs &&
26 + cat <<EOF >o_fortuna &&
27 +O Fortuna
28 +velut luna
29 +statu variabilis,
30 +
31 +semper crescis
32 +aut decrescis;
33 +vita detestabilis
34 +
35 +nunc obdurat
36 +et tunc curat
37 +ludo mentis aciem,
38 +
39 +egestatem,
40 +potestatem
41 +dissolvit ut glaciem.
42 +EOF
43 + cvs add o_fortuna &&
44 + cat <<EOF >message &&
45 +add "O Fortuna" lyrics
46 +
47 +These public domain lyrics make an excellent sample text.
48 +EOF
49 + cvs commit -F message &&
50 + cd ..
51 +'
52 +
53 +test_expect_success 'import a trivial module' '
54 +
55 + git cvsimport -a -z 0 -C module-git module &&
56 + git diff module-cvs/o_fortuna module-git/o_fortuna
57 +
58 +'
59 +
60 +test_expect_success 'update cvs module' '
61 +
62 + cd module-cvs &&
63 + cat <<EOF >o_fortuna &&
64 +O Fortune,
65 +like the moon
66 +you are changeable,
67 +
68 +ever waxing
69 +and waning;
70 +hateful life
71 +
72 +first oppresses
73 +and then soothes
74 +as fancy takes it;
75 +
76 +poverty
77 +and power
78 +it melts them like ice.
79 +EOF
80 + cat <<EOF >message &&
81 +translate to English
82 +
83 +My Latin is terrible.
84 +EOF
85 + cvs commit -F message &&
86 + cd ..
87 +'
88 +
89 +test_expect_success 'update git module' '
90 +
91 + cd module-git &&
92 + git cvsimport -a -z 0 module &&
93 + git merge origin &&
94 + cd .. &&
95 + git diff module-cvs/o_fortuna module-git/o_fortuna
96 +
97 +'
98 +
99 +test_done