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
|
#------------------------------------------------------------*- tcl -*-
# Tests for patch file parsing functions
#----------------------------------------------------------------------
# Overload exec during these tests
set ::eskil(gurka,patchFile) ""
set ::eskil(gurka,patchData) ""
stub update args {}
stub getFullPatch {top} {
return $::testpatch
}
stub displayOnePatch {top leftLines rightLines leftLine rightLine} {
}
stub emptyLine {top n {highlight 1}} {
incr ::_patchfiles
}
stub insertLine {top n line text {tag {equal}} {linetag {}}} {
}
stub addChange {top n tag line1 n1 line2 n2} {}
proc _PatchInit {} {
set ::_patchfiles 0
}
test patch-1.1 {
Xxx
} -body {
_PatchInit
set ::testpatch {
Index: vhdl/tb/tb_system.bhv
===================================================================
--- vhdl/tb/tb_system.bhv (revision 320)
+++ vhdl/tb/tb_system.bhv (working copy)
|
>
>
>
>
>
>
>
|
>
>
>
>
>
|
>
|
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#------------------------------------------------------------*- tcl -*-
# Tests for patch file parsing functions
#----------------------------------------------------------------------
# Overload exec during these tests
set ::eskil(gurka,patchFile) ""
set ::eskil(gurka,patchData) ""
stub update args {}
stub getFullPatch {top} {
return $::testpatch
}
stub displayOnePatch {top leftLines rightLines leftLine rightLine} {
# Line per patch
lappend ::_patchfiles(pll) $leftLine
lappend ::_patchfiles(prl) $rightLine
# All lines
foreach l $leftLines {
lassign $l lline lmode lstr
lappend ::_patchfiles(ll) $lline
}
foreach l $rightLines {
lassign $l lline lmode lstr
lappend ::_patchfiles(rl) $lline
}
}
stub emptyLine {top n {highlight 1}} {
incr ::_patchfiles(e)
}
stub insertLine {top n line text {tag {equal}} {linetag {}}} {
}
stub addChange {top n tag line1 n1 line2 n2} {}
proc _PatchInit {} {
set ::_patchfiles(e) 0
set ::_patchfiles(pll) {}
set ::_patchfiles(prl) {}
set ::_patchfiles(ll) {}
set ::_patchfiles(rl) {}
}
test patch-1.1 {
Xxx
} -body {
_PatchInit
set ::testpatch [string trim {
--- foo.txt 2016-07-10 21:53:36.671932638 -0700
+++ bar.txt 2016-07-10 21:53:54.739860205 -0700
@@ -1 +1,2 @@
+0
1
@@ -5 +8,9 @@
+0
1
}]
displayPatch gurka
concat $_patchfiles(ll) $_patchfiles(rl)
} -result {1 5 1 2 8 9}
test patch-1.2 {
Xxx
} -body {
_PatchInit
set ::testpatch {
Index: vhdl/tb/tb_system.bhv
===================================================================
--- vhdl/tb/tb_system.bhv (revision 320)
+++ vhdl/tb/tb_system.bhv (working copy)
|
128
129
130
131
132
133
134
135
136
|
+ variable TcDFHeader : out TcDFH_T);
procedure TcAddrCalc(PresentAddr : in integer;
AccWidth : in DynamicSize_T;
}
displayPatch gurka
set ::_patchfiles
} -result {6}
|
|
|
162
163
164
165
166
167
168
169
170
|
+ variable TcDFHeader : out TcDFH_T);
procedure TcAddrCalc(PresentAddr : in integer;
AccWidth : in DynamicSize_T;
}
displayPatch gurka
set ::_patchfiles(e)
} -result {6}
|