add packaging
[platform/upstream/db4.git] / test_stl / run_base_profile.sh
1 #run_test.sh
2 run_test()
3 {
4 prog=$1 
5 mkdir -p ./dbenv
6 rm -f -r dbenv/*
7
8 echo "Auto commit btree transaction tests:" >&2
9         $prog -s b -m t -t a  -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
10         i=`expr $i + 1` 
11
12 echo "Transaction btree tests:" >&2
13         $prog -s b -m t -t e  -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
14         i=`expr $i + 1` 
15 echo "CDS btree tests:" >&2
16         $prog -s b -m c -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
17         i=`expr $i + 1` 
18
19 echo "DS btree tests:" >&2
20         $prog -s b -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
21         i=`expr $i + 1` 
22
23 echo "Auto commit hash transaction tests:" >&2
24         $prog -s h -m t -t a  -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
25         i=`expr $i + 1` 
26
27 echo "Transaction hash tests:" >&2
28         $prog -s h -m t -t e  -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
29         i=`expr $i + 1` 
30
31 echo "CDS hash tests:" >&2
32         $prog -s h -m c -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
33         i=`expr $i + 1` 
34
35 echo "DS hash tests:" >&2
36         $prog -s h -T 200 -k 50 -l 100 -c 33554432 -n $total && mv gmon.out gmon${i}.out
37         i=`expr $i + 1` 
38 }
39
40 if test $# -ne 1 ; then
41         echo "Usage: sh run_test.sh number-of-run-in-a-loop"
42         exit 1
43 fi
44
45 total=$1
46 i=0
47 os=`uname -s`
48
49 if test $os = "CYGWIN_NT-5.1" ; then
50         run_test "../build_windows/Win32/Debug/test.exe"
51 else
52         run_test "../build_unix/test_dbstl"
53 fi
54
55 ii=0
56 profiles=""
57
58 while [ $ii -lt $i ]; do
59         profiles="${profiles} gmon${ii}.out"
60         ii=`expr $ii + 1`       
61 done
62 echo "Generating profiling report..." >&2
63 gprof $1/.libs/test_dbstl $profiles > gprof.out