Eskil

Check-in [d0f12f5da5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More tests, use stub.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d0f12f5da58d7cf1742181ad6595c418ac4127bd
User & Date: peter 2005-09-28 21:21:18.000
Context
2005-09-28
21:23
Added test for new example. check-in: 1fd81f22ad user: peter tags: trunk
21:21
More tests, use stub. check-in: d0f12f5da5 user: peter tags: trunk
21:20
Support code coverage and stubs. check-in: 5a97853587 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to tests/rev.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Tests for revision control functions                      -*- tcl -*-
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------

# Overload exec during these tests
rename exec _exec
proc exec {args} {
    set cmd [lindex $args 0]
    switch -- $cmd {
        cleartool {
            # cleartool lshistory -short $filename
            # cleartool pwv -s
            # cleartool get -to $outfile $filerev
            # cleartool ls $::diff($top,RevFile)
            if {[lindex $args 1] eq "lshistory"} {
                return [join [list x@/Apa/Bepa/12 x@/Apa/Cepa/2 x@/Apa/22 x@/Apa] \n]



            }
            return
        }
        cvs {
            # cvs -z3 update -p ?-r rev? $filename > $outfile
            return
        }
        co {
            # co -p$rev $filename > $outfile
            return
        }
        default {
            eval _exec $args
        }
    }
}

test rev-1.1 {
    ClearCase revisions
} -body {






<
|









>
>
>












|







1
2
3
4
5
6

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Tests for revision control functions                      -*- tcl -*-
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------

# Overload exec during these tests

stub exec {args} {
    set cmd [lindex $args 0]
    switch -- $cmd {
        cleartool {
            # cleartool lshistory -short $filename
            # cleartool pwv -s
            # cleartool get -to $outfile $filerev
            # cleartool ls $::diff($top,RevFile)
            if {[lindex $args 1] eq "lshistory"} {
                return [join [list x@/Apa/Bepa/12 x@/Apa/Cepa/2 x@/Apa/22 x@/Apa] \n]
            }
            if {[lindex $args 1] eq "pwv"} {
                return $::ct_pwv
            }
            return
        }
        cvs {
            # cvs -z3 update -p ?-r rev? $filename > $outfile
            return
        }
        co {
            # co -p$rev $filename > $outfile
            return
        }
        default {
            eval _stub_exec $args
        }
    }
}

test rev-1.1 {
    ClearCase revisions
} -body {
82
83
84
85
86
87
88





89






90















































test rev-1.9 {
    ClearCase revisions
} -body {
    ParseCtRevs filename /Apa/Cepa -5
} -result {/Apa/Cepa/0}






rename exec {}






rename _exec exec





















































>
>
>
>
>
|
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

test rev-1.9 {
    ClearCase revisions
} -body {
    ParseCtRevs filename /Apa/Cepa -5
} -result {/Apa/Cepa/0}

test rev-2.1 {
    Detecting, CVS
} -body {
    detectRevSystem apa
} -result {CVS}

test rev-2.2 {
    Detecting, CVS
} -body {
    set ::auto_execs(cvs) ""
    detectRevSystem apa
} -result {}

test rev-2.3 {
    Detecting, RCS
} -body {
    file mkdir RCS
    set ch [open RCS/apa,v w]
    puts $ch x
    close $ch
    detectRevSystem apa
} -result {RCS}

test rev-2.4 {
    Detecting, RCS
} -body {
    set ::auto_execs(rcs) ""
    detectRevSystem apa
} -cleanup {
    file delete -force RCS
} -result {}

test rev-2.5 {
    Detecting, CT
} -body {
    set ::auto_execs(cleartool) "x"
    unset -nocomplain ::ct_pwv
    detectRevSystem apa
} -result {}

test rev-2.6 {
    Detecting, CT
} -body {
    set ::auto_execs(cleartool) "x"
    set ::ct_pwv "** NONE **"
    detectRevSystem apa
} -cleanup {
    file delete -force RCS
} -result {}

test rev-2.7 {
    Detecting, CT
} -body {
    set ::auto_execs(cleartool) "x"
    set ::ct_pwv "gurka"
    detectRevSystem apa
} -cleanup {
    file delete -force RCS
} -result {CT}