add packaging
[platform/upstream/db4.git] / test_stl / run_base.sh
1 #run_test.sh
2 run_test()
3 {
4 prog=$1 
5 mkdir -p ./dbenv
6 rm -rf dbenv/*
7 echo "Auto commit btree transaction tests:"
8 $prog -s b -m t -t a  -T 200 -k 50 -l 100 -c 33554432 -n $2 >/dev/null
9 echo "Transaction btree tests:"
10 $prog -s b -m t -t e  -T 200 -k 50 -l 100 -c 33554432 -n $2 >/dev/null
11 echo "CDS btree tests:"
12 $prog -s b -m c -T 200 -k 50 -l 100 -c 33554432 -n $2  >/dev/null
13 echo "DS btree tests:"
14 $prog -s b -T 200 -k 50 -l 100 -c 33554432 -n $2  >/dev/null
15 echo "Auto commit hash transaction tests:"
16 $prog -s h -m t -t a  -T 200 -k 50 -l 100 -c 33554432 -n $2 >/dev/null
17 echo "Transaction hash tests:"
18 $prog -s h -m t -t e  -T 200 -k 50 -l 100 -c 33554432 -n $2 >/dev/null
19 echo "CDS hash tests:"
20 $prog -s h -m c -T 200 -k 50 -l 100 -c 33554432 -n $2 >/dev/null
21 echo "DS hash tests:"
22 $prog -s h -T 200 -k 50 -l 100 -c 33554432 -n $2  >/dev/null
23 }
24
25 run_mt()
26 {
27 prog=$1
28 echo "Transaction btree multithreaded tests:"
29 $prog -s b -m t -t e  -T 200 -k 50 -l 100 -c 33554432  -M > mt_test_btree_tds.out
30 echo "Transaction btree multithreaded tests(auto commit):"
31 $prog -s b -m t -t e  -T 200 -k 50 -l 100 -c 33554432  -M > mt_test_btree_tds_autocommit.out
32
33 echo "Transaction hash multithreaded tests:"
34 $prog -s h -m t -t e  -T 200 -k 50 -l 100 -c 33554432 -M > mt_test_hash_tds.out
35 echo "Transaction hash multithreaded tests:"
36 $prog -s h -m t -t e  -T 200 -k 50 -l 100 -c 33554432 -M > mt_test_hash_tds_autocommit.out
37 # This test is not suitable for CDS mode because the writers will not stop inserting to 
38 # the database until the reader reads enough key/data pairs, but the readers will never 
39 # have a chance to open its cursor read any key/data pair since the write is writing to db.
40 }
41 run_tpcb()
42 {
43 prog=$1
44
45 mkdir -p ./dbenv
46 rm -fr dbenv/*
47
48 $prog -i
49 $prog -n $2
50
51 }
52 os=`uname -s`
53 ntimes=1
54 mttest=0
55 if test "$1" = "tpcb" ; then #running tpcb test.
56         if test $# -gt 1 ; then
57                 ntimes=$2
58         fi
59
60         if test "$os" = "CYGWIN_NT-5.1" ; then
61                 run_tpcb "../build_windows/Win32/Release/exstl_tpcb.exe" $ntimes
62         else 
63                 run_tpcb  "../build_unix/exstl_tpcb" $ntimes
64         fi
65 else
66         if test "$1" = "mt" ; then #running ordinary test.
67                 mttest=1
68         elif test $# -eq 2 ; then
69                 ntimes=$2
70         fi
71         
72         if test "$os" = "CYGWIN_NT-5.1" ; then
73                 echo "Debug version test"
74                 if test $mttest -eq 1 ; then
75                         run_mt "../build_windows/Win32/Debug/stl_test.exe"
76                 else
77                         run_test "../build_windows/Win32/Debug/stl_test.exe" $ntimes
78                 fi
79                 echo "Release version test"
80                 if test $mttest -eq 1 ; then
81                         run_mt "../build_windows/Win32/Release/stl_test.exe"
82                 else
83                         run_test "../build_windows/Win32/Release/stl_test.exe" $ntimes
84                 fi
85         else
86                 if test $mttest -eq 1 ; then
87                         run_mt "../build_unix/test_dbstl"
88                 else
89                         run_test "../build_unix/test_dbstl"  $ntimes
90                 fi
91         fi
92 fi