blob: dbda8b8cfb83489b84d28992bd7e583fcde78dd4 [file] [log] [blame]
#!/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.
set testgroup1 [expr [info exists ::env(testgroup1)] ? $::env(testgroup1) : 1]
set testgroup2 [expr [info exists ::env(testgroup2)] ? $::env(testgroup2) : 1]
set testgroup3 [expr [info exists ::env(testgroup3)] ? $::env(testgroup3) : 1]
# 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