Open fgalan opened 7 years ago
More info:
Running with VERBOSE=1 we have, for debug
target (random file):
cd /home/fermin/src/fiware-orion/BUILD_DEBUG/src/lib/parseArgs && /usr/bin/c++ -DDEBUG
-DDEBUG_fermin -DLINUX -DLM_ON -Wall -Wno-unknown-pragmas -D_LARGEFILE64_SOURCE
-D_GNU_SOURCE -Werror -fno-var-tracking-assignments -DLINUX -g
-I/home/fermin/src/fiware-orion/src/lib -fPIC -DDEBUG_SER -fstack-check -fstack-protector
-o CMakeFiles/pa.dir/paParse.cpp.o -c /home/fermin/src/fiware-orion/src/lib/parseArgs/paParse.cpp
Same file, for the unit_test
target:
cd /home/fermin/src/fiware-orion/BUILD_UNITTEST/src/lib/parseArgs && /usr/bin/c++ -DDEBUG
-DDEBUG_fermin -DLINUX -DUNIT_TEST -Wall -Wno-unknown-pragmas -D_LARGEFILE64_SOURCE
-D_GNU_SOURCE -Werror -fno-var-tracking-assignments -DLINUX -Wno-unused-variable -fprofile-arcs
-ftest-coverage -g -I/home/fermin/src/fiware-orion/src/lib -fPIC -DDEBUG_SER -fstack-check
-fstack-protector -o CMakeFiles/pa.dir/paParse.cpp.o
-c /home/fermin/src/fiware-orion/src/lib/parseArgs/paParse.cpp
"Canceling" the differences what we have, for the debug case:
-DLM_ON
and for the unit_test case
-DUNIT_TEST -Wno-unused-variable -fprofile-arcs -ftest-coverage
Another interesting fact...
With the V2 -> 2 modification in:
if (((apiVersion == V2) && (len = strlen(id.c_str())) < MIN_ID_LEN) && (requestType != EntityRequest))
Both make debug
and make unit_test
work. So, it is not a matter of global build configuration different betwen targets. It seems some local build configuration that affect only files under test/unittests
.
Weird...
Do the following comparison.
First, look for this line in Entity::check()
Change
V2
by2
and runmake debug
ormake
. Everything is ok.Now, look for the following line in mongoQueryTypes_test.cpp
Change
V1
by1
and runmake unit_test
. You should get the following compiler error:My theory is that CMakeList.txt are in a way in which unit test and regular build is not the same. The unit test build is more strict, so we should change regular build to be the same.
Edit: running second case with VERBOSE=1