This repository has been archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
UNIT_TESTING
43 lines (34 loc) · 2.05 KB
/
UNIT_TESTING
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
Unit testing is used throughout boomerang. You should be able to cd to any
directory below the top one, type "make test", and it should make the
objects in that directory and run the test. (In some cases, before dynamic
libraries are installed, you may have to "make ; make install" first).
The tests rely on an open source testing package called cppunit; see
cppunit.sourceforge.net. When that package is installed, testing should
work properly. If you get a message like
ld.so.1: ./testExp: fatal: libcppunit-1.6.so.0: open failed: No such file or directory
then the system isn't finding your cppunit dynamic library. You may need to
do something like this to help it be found:
% export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
You can put this in your .bash_profile, or wherever is appropriate.
If you are in the unfortunate situation (like me) where you do some develop-
ment on a machine where you don't have root access, and don't like to ask
the sysadmins to install things like cppunit, you can work around the problem
my making a soft (symbolic) link to the ../lib directory. For example,
if you untarred cppunit in /home/myhomedir (and made it, of course), you
could:
% cd lib
% ln -s /home/myhomedir/cppunit-1.6.2/src/cppunit/.libs/libcppunit.so .
% ln -s /home/myhomedir/cppunit-1.6.2/src/cppunit/.libs/libcppunit-1.6.so.0 .
% export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myhome/boomerang/lib
% cd ../include
% ln -s /home/myhomedir/cppunit-1.6.2/include/cppunit .
% cd ..
% make test
You need the link in the include directory to get the includes right.
Using the lib directory (relative to the top of the boomerang file tree) makes
sense because then you only need to do it once, and all directories (which
have independent test programs) can access the same soft link. You need two
soft links, because the linker uses one (.so), but at runtime, the system
uses the versioned name (-1.6.so.0). LD_LIBRARY_PATH is searched by both
the link editor ld (part of the make, called by g++), and the link editor
(ld.so, called by the operating system when you run your programs).