File: test.setup.in

package info (click to toggle)
tcltrf 2.1.4-dfsg3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,628 kB
  • sloc: ansic: 73,134; sh: 3,155; tcl: 1,343; makefile: 176; exp: 22
file content (44 lines) | stat: -rw-r--r-- 890 bytes parent folder | download | duplicates (6)
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
# -*- tcl -*-
# Script to load the commands to test, and the necessary prerequisites.

package require Memchan

proc read_file {file} {
    set fd [open $file]
    fconfigure $fd -translation binary
    set data [read $fd]
    close $fd
    return $data
}

proc write_file {file data} {
    set fd [open $file w]
    fconfigure $fd -translation binary
    puts -nonewline $fd $data
    close $fd
}

proc read_zip {file} {
    set fd [open $file]
    fconfigure $fd -translation binary
    zip -attach $fd -mode compress
    fconfigure $fd -translation binary
    set data [read $fd]
    close $fd
    return $data
}

proc write_zip {file data} {
    set fd [open $file w]
    fconfigure $fd -translation binary
    zip -attach $fd -mode compress
    fconfigure $fd -translation binary
    puts -nonewline $fd $data
    close $fd
}


# -- and the commands to test --

load ./@PKG_LIB_FILE@