File: base32hex.test

package info (click to toggle)
tcllib 1.10-dfsg-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 17,708 kB
  • ctags: 6,122
  • sloc: tcl: 106,354; ansic: 9,205; sh: 8,707; xml: 1,766; yacc: 753; makefile: 115; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (69 lines) | stat: -rw-r--r-- 1,657 bytes parent folder | download
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
68
69
# -*- tcl -*- Tests for "base32"
# This testsuite is in the public domain.
#__________________________________________
# RCS: @(#) $Id: base32hex.test,v 1.2 2006/10/09 21:41:39 andreas_kupries Exp $

# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.4
testsNeedTcltest 2.1

support {
    useLocal     base32core.tcl base32::core
}
testing {
    if {[useTcllibC]} {
	useLocalKeep base32hex.tcl  base32::hex
    } else {
	useLocal     base32hex.tcl  base32::hex
    }
}

# -------------------------------------------------------------------------

base32::hex::SwitchTo {}
foreach e [base32::hex::KnownImplementations] {
    if {[::base32::hex::LoadAccelerator $e]} {
        switch -exact -- $e {
            critcl {puts "> tcllibc based"}
            tcl    {puts "> pure Tcl"}
        }
    }
}

# -------------------------------------------------------------------------

set usec  0
set tests [file join [file dirname [info script]] base32hex.testsuite]

catch {memory validate on}

foreach impl [base32::hex::Implementations] {
    base32::hex::SwitchTo $impl

    # The global variable 'impl' is part of the public
    # API the testsuite (in base32.testsuite) can expect
    # from the environment.

    set usec [time {source $tests} 1]

    #puts "$impl:\t$usec"
}

catch {memory validate off}

unset usec
unset tests

# Reset system to fully inactive state.

base32::hex::SwitchTo {}

# -------------------------------------------------------------------------

testsuiteCleanup
return