]> git.saurik.com Git - redis.git/blob - test/test_helper.tcl
33c507f2e9f25291871f407163c3cecae6e23e97
[redis.git] / test / test_helper.tcl
1 # Redis test suite. Copyright (C) 2009 Salvatore Sanfilippo antirez@gmail.com
2 # This softare is released under the BSD License. See the COPYING file for
3 # more information.
4
5 set tcl_precision 17
6 source test/support/redis.tcl
7 source test/support/server.tcl
8 source test/support/tmpfile.tcl
9 source test/support/test.tcl
10 source test/support/util.tcl
11
12 set ::host 127.0.0.1
13 set ::port 16379
14 set ::traceleaks 0
15
16 proc execute_tests name {
17 set cur $::testnum
18 source "test/$name.tcl"
19 }
20
21 # setup a list to hold a stack of clients. the proc "r" provides easy
22 # access to the client at the top of the stack
23 set ::clients {}
24 proc r {args} {
25 set client [lindex $::clients end]
26 $client {*}$args
27 }
28
29 proc main {} {
30 execute_tests "unit/auth"
31 execute_tests "unit/protocol"
32 execute_tests "unit/basic"
33 execute_tests "unit/type/list"
34 execute_tests "unit/type/set"
35 execute_tests "unit/type/zset"
36 execute_tests "unit/type/hash"
37 execute_tests "unit/sort"
38 execute_tests "unit/expire"
39 execute_tests "unit/other"
40
41 puts "\n[expr $::passed+$::failed] tests, $::passed passed, $::failed failed"
42 if {$::failed > 0} {
43 puts "\n*** WARNING!!! $::failed FAILED TESTS ***\n"
44 }
45
46 # clean up tmp
47 exec rm -rf {*}[glob test/tmp/redis.conf.*]
48 exec rm -rf {*}[glob test/tmp/server.*]
49 }
50
51 main