Closed narner closed 7 years ago
How are you running the unit tests? Are you using cmake to generate the main library and the unit tests?
If so, cmake will automatically call a script that builds and links against the unit test library (gtest).
This is how I run the unit tests (and build the library):
cd grt_parent_directory #cd to the grt parent directory
cd build #cd to the main build directory
mkdir tmp #if it doesn't already exist, make a temporary directory
cd tmp #cd to the temporary directory
cmake .. #run the cmake script, pointing to the CMakeLists.txt file that lives one directory above (..), this will configure the build scripts for your machine
make -j4 #build the library, running 4 jobs at once (a.k.a. use 4 threads/processors if you have them)
make test #run the unit tests
Ah, I had been trying to run each test individually, so was doing:
g++ ./ANBCTest.cpp
The commands you used worked for me also, thank you.
Hey Nick,
I'm attempting to run the GRT unit tests. Right now, I'm encountering three problems when building the GRT unit tests (using gcc):
#include <GRT.h>
could not be found. I fixed this by changing the path to:#include "../../GRT/GRT.h"
#include "gtest/gtest.h"
could not be found. I resolved that by changing the path to#include "../../third_party/gtest/googletest/include/gtest/gtest.h"
gtest/internal/gtest-internal.h' file not found
.I've built
googlemock
andgoogletest
inside thethird_party/gtest
folder, following the directions here, so I don't think the problem is with how those two frameworks are being built.