README updated with instructions about Google Test

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@140 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2012-01-23 15:06:10 +00:00
parent 059b05fcf2
commit c4f426c39b
1 changed files with 8 additions and 0 deletions

8
README
View File

@ -58,6 +58,14 @@ $ cd gtest-1.6.0
$ ./configure
$ make
Please DO NOT install gtest (do not do "sudo make install"). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of #if in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of gtest its own tests; it is only required that you tell the system where the gtest folder that you downloaded resides. Just add to your $HOME/.bashrc file the following line:
export GTEST_DIR=/home/username/gtest-1.6.0
changing /home/username/gtest-1.6.0 by the actual directory where you downloaded gtest.
- Download, unzip, configure, build and install Google's gflags package, a commandline flags processing module for C++:
$ wget http://google-gflags.googlecode.com/files/gflags-1.7.tar.gz