File: rivet.test

package info (click to toggle)
libapache2-mod-rivet 3.2.6-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,384 kB
  • sloc: tcl: 8,982; xml: 8,619; ansic: 7,074; sh: 5,039; makefile: 195; sql: 91; lisp: 78
file content (103 lines) | stat: -rwxr-xr-x 2,797 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/sh
# the next line restarts using tclsh \
    exec tclsh "$0" "$@"

#   Licensed to the Apache Software Foundation (ASF) under one
#   or more contributor license agreements.  See the NOTICE file
#   distributed with this work for additional information
#   regarding copyright ownership.  The ASF licenses this file
#   to you under the Apache License, Version 2.0 (the
#   "License"); you may not use this file except in compliance
#   with the License.  You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing,
#   software distributed under the License is distributed on an
#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
#   KIND, either express or implied.  See the License for the
#   specific language governing permissions and limitations
#   under the License.

# Rivet test suite, by David N. Welton <davidw@apache.org>

# See README file for more information.

package require tcltest

set auto_path [linsert $auto_path 0 [file join [pwd] rivet]]
set urlbase "http://localhost:8081/"

# Use this to start and stop the server:

if {[info exists ::env(TestList)]} {
    set TestList $::env(TestList)
} else {
    set TestList {rivetlib.test shorthand.test headers.test \
		cookies.test get.test post.test tclfile.test \
		env.test hello.test include.test binary.test \
		parse.test upload.test makeurl.test commands.test}
}

# Test stanzas are created by giving the test a name and a
# description. The code is then executed, and the results compared
# with the desired result, which is placed after the block of code.
# See man tcltest for more information.

foreach tgroup {1 2 3} {
    set testgroup${tgroup} 1
    if {[info exists ::env(testgroup${tgroup})]} {
        set testgroup${tgroup} $::env(testgroup${tgroup})
    }
}

# Run all tests against one server process.

if { $testgroup1 } {
    puts -nonewline "Running all tests against one server process."
    flush stdout
    apachetest::start {} {} {
        foreach Test $TestList {
            puts -nonewline "."
            flush stdout
            source $Test
        }
    }
    puts " done"
}

# Run each test in its own server.

if { $testgroup2 } {
    foreach Test $TestList {
        apachetest::start {} {} {
            puts "Running $Test"
            source $Test
        }
    }
}


# These tests start the server on their own, or don't need the server
# at all.

set group3 {
        failtest.test
        broken.test
        config.test
        parsepackage.test
        virtualhost.test
        inspect.test 
        bailout.test
        channel.test
    }

if { $testgroup3 } {
    foreach Test $group3 {
        puts "Running $Test"
        source $Test
    }
}

::tcltest::cleanupTests