aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2016-03-15 09:26:31 +1100
committerBen Elliston <bje@gnu.org>2016-03-15 09:26:55 +1100
commit4d344f712298364c836038b641625b3407db2fc3 (patch)
tree92d61434b84caad34d65967f46ceedddc7fe34a3 /lib
parent7e0630a1b2e585ee7f91d890dd5d5c04b00f2eff (diff)
* lib/utils.exp (diff): Remove proc.
* doc/ref.xml: Update documentation. * doc/dejagnu.texi: Regenerate. * NEWS: Update.
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.exp69
1 files changed, 0 insertions, 69 deletions
diff --git a/lib/utils.exp b/lib/utils.exp
index 505ad18..8db12b8 100644
--- a/lib/utils.exp
+++ b/lib/utils.exp
@@ -250,75 +250,6 @@ proc runtest_file_p { runtests testcase } {
}
-# Compares two files line-by-line
-# returns 1 it the files match,
-# returns 0 if there was a file error,
-# returns -1 if they didn't match.
-#
-proc diff { file_1 file_2 } {
- set eof -1
- set differences 0
-
- if {[file exists ${file_1}]} {
- set file_a [open ${file_1} r]
- fconfigure $file_a -encoding binary
- } else {
- warning "${file_1} doesn't exist"
- return 0
- }
-
- if {[file exists ${file_2}]} {
- set file_b [open ${file_2} r]
- fconfigure $file_b -encoding binary
- } else {
- warning "${file_2} doesn't exist"
- return 0
- }
-
- verbose "# Diff'ing: ${file_1} ${file_2}" 1
-
- set list_a ""
- while { [gets ${file_a} line] != ${eof} } {
- if {[regexp "^#.*$" ${line}]} {
- continue
- } else {
- lappend list_a ${line}
- }
- }
- close ${file_a}
-
- set list_b ""
- while { [gets ${file_b} line] != ${eof} } {
- if {[regexp "^#.*$" ${line}]} {
- continue
- } else {
- lappend list_b ${line}
- }
- }
- close ${file_b}
- for { set i 0 } { $i < [llength $list_a] } { incr i } {
- set line_a [lindex ${list_a} ${i}]
- set line_b [lindex ${list_b} ${i}]
-
- if {[string compare ${line_a} ${line_b}]} {
- verbose -log "line #${i}" 2
- verbose -log "\< ${line_a}" 2
- verbose -log "\> ${line_b}" 2
- set differences -1
- }
- }
-
- if { $differences == -1 || [llength ${list_a}] != [llength ${list_b}] } {
- verbose "Files not the same" 2
- set differences -1
- } else {
- verbose "Files are the same" 2
- set differences 1
- }
- return ${differences}
-}
-
-#
# Set an environment variable
#
proc setenv { var val } {