summaryrefslogtreecommitdiffstats
path: root/kbruch/testcases/README
blob: cece8143dc19f2bc0ea42164308f1fdf93a6eaa1 (plain)
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
In this directory I will store the testcases for KBruch. A file containing a
test suite for a "class" has the following file name:

"class"_test.cpp

In this file there is a class (struct) named "class"_test_suite and the class
containing the test cases. This class is called "class"_test. Every member
function of the original class is tested in a seperated member function of the
"class"_test class. Those functions are named

"class"_test::test_"memberFunction"() {...}

Before you can compile it, you have to make symlinks from the source directory
to this directory. The simplest way is to use the following bash script:

-----SNIP-----

#!/bin/bash

# save the current directory
#
current=`pwd`

# delete all symbolic links
#
rm `find . -type l`

# now go the source directory
#
cd ../src

echo "Createing symlinks to the source files..."

# make a symlink from every *.cpp file to this directory
#
for a in `ls *.cpp`
do
   ln -s ../src/$a ../testcases/$a
done

# make a symlink from every *.h file to this directory
#
for a in `ls *.h`
do
   ln -s ../src/$a ../testcases/$a
done

# and back to the testcases directory
#
cd $current

-----SNIP-----

And you need the boost library installed. I think this will be the hardest
thing. You can get boost from http://www.boost.org/

If you want to compile the whole tests not under Linux using gcc, you maybe
have to edit the Makefile.am in this directory to correctly link against
libboost_unit_test_framework-YOURCOMPILER. Edit the following line in
Makefile.am:

kbruch_test_LDADD   = -lboost_unit_test_framework-gcc $(LIB_KDEUI)

I hope someone finds a portable way to do this Makefile stuff. Please fix it,
I'm not a Automake/Autoconf guru!

You can compile the test program by typing:

make check

If you were able to compile it, you can execute the test case program
kbruch_test from within this directory.

I hope this helps a little bit.

Sebastian Stein <seb.kde@hpfsc.de>