Problems migrating from CppUTest 3.3 to v 3.4

113 views
Skip to first unread message

ferdi....@gmail.com

unread,
May 15, 2013, 9:05:28 PM5/15/13
to cppu...@googlegroups.com

Using the procedure described in README_InstallCppUTest.txt, I experienced some problems that I didn't notice with v 3.3:

  1. The old method for disabling memory leak checks (building CppUTest with make CPPUTEST_USE_MEM_LEAK_DETECTION=N) apparently doesn't work anymore. Instead, we should run ./configure --disable-memory-leak-detection and then just make. The documentation at cpputest.org should be updated.

  2. I found that the .a files are not created in the lib subdirectory, but instead directly in CppUTest's home directory. I had to move them to lib before I could link my tests. Maybe there's a parameter I should pass to configure?

  3. The self-tests failed to compile when I typed make check. The results are below.

  4. It hardly matters, but the numbering of the steps in README_InstallCppUTest.txt goes 1, 2a, 2b and then skips to 3c -- a little disorienting.

$ make check
make  CppUTestTests CppUTestExtTests
make[1]: Entering directory `/home/pferdina/cpputest-3.4'
  CXX    CppUTestTests-AllTests.o
  CXX    CppUTestTests-SetPluginTest.o
cc1plus: warnings being treated as errors
tests/SetPluginTest.cpp: In member function \u2018void FunctionPointerUtest::setup()\u2019:
tests/SetPluginTest.cpp:57: warning: dereferencing type-punned pointer will break strict-aliasing rules
tests/SetPluginTest.cpp:58: warning: dereferencing type-punned pointer will break strict-aliasing rules
tests/SetPluginTest.cpp:59: warning: dereferencing type-punned pointer will break strict-aliasing rules
tests/SetPluginTest.cpp: In member function \u2018void MaxFunctionPointerUtest::setup()\u2019:
tests/SetPluginTest.cpp:95: warning: dereferencing type-punned pointer will break strict-aliasing rules
tests/SetPluginTest.cpp: In member function \u2018void SetDoublePointerUtest::setup()\u2019:
tests/SetPluginTest.cpp:119: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[1]: *** [CppUTestTests-SetPluginTest.o] Error 1
make[1]: Leaving directory `/home/pferdina/cpputest-3.4'
make: *** [check-am] Error 2

$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
Copyright (C) 2006 Free Software Foundation, Inc.


$ uname -a
Linux ASBLX36 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux


Bas Vodde

unread,
May 19, 2013, 10:38:54 PM5/19/13
to cppu...@googlegroups.com

Hiya Ferdi,

> Using the procedure described in README_InstallCppUTest.txt, I experienced some problems that I didn't notice with v 3.3:
>
> • The old method for disabling memory leak checks (building CppUTest with make CPPUTEST_USE_MEM_LEAK_DETECTION=N) apparently doesn't work anymore. Instead, we should run ./configure --disable-memory-leak-detection and then just make. The documentation at cpputest.org should be updated.

Yes, thanks!

> • I found that the .a files are not created in the lib subdirectory, but instead directly in CppUTest's home directory. I had to move them to lib before I could link my tests. Maybe there's a parameter I should pass to configure?

Hmm… that is a good point. I think it would be good to add something about "make install" in the documentation too as the idea is that you "install" CppUTest after you build it.

On Ubuntu/Debian, we now also have a package, so you can install CppUTest with "apt-get install cpputest". Probably also need to put that in the manual.

> • The self-tests failed to compile when I typed make check. The results are below.

Interesting!

And this is with 3.4 right? We recently did a change in the UT_PTR_SET macro, so it might actually relate to that. Unfortunately the gcc used in the travis build doesn't show this error.

Andreas: Do you remember you made a change to remove this warning? Seems gcc 4.1.2 still has it? Any idea about this?

> • It hardly matters, but the numbering of the steps in README_InstallCppUTest.txt goes 1, 2a, 2b and then skips to 3c -- a little disorienting.

*grin*, a, b, c… seems logical to me :P (I'll fix this!)

Bas

>
> $ make check
> make CppUTestTests CppUTestExtTests
> make[1]: Entering directory `/home/pferdina/cpputest-3.4'
> CXX CppUTestTests-AllTests.o
> CXX CppUTestTests-SetPluginTest.o
> cc1plus: warnings being treated as errors
> tests/SetPluginTest.cpp: In member function \u2018void FunctionPointerUtest::setup()\u2019:
> tests/SetPluginTest.cpp:57: warning: dereferencing type-punned pointer will break strict-aliasing rules
> tests/SetPluginTest.cpp:58: warning: dereferencing type-punned pointer will break strict-aliasing rules
> tests/SetPluginTest.cpp:59: warning: dereferencing type-punned pointer will break strict-aliasing rules
> tests/SetPluginTest.cpp: In member function \u2018void MaxFunctionPointerUtest::setup()\u2019:
> tests/SetPluginTest.cpp:95: warning: dereferencing type-punned pointer will break strict-aliasing rules
> tests/SetPluginTest.cpp: In member function \u2018void SetDoublePointerUtest::setup()\u2019:
> tests/SetPluginTest.cpp:119: warning: dereferencing type-punned pointer will break strict-aliasing rules
> make[1]: *** [CppUTestTests-SetPluginTest.o] Error 1
> make[1]: Leaving directory `/home/pferdina/cpputest-3.4'
> make: *** [check-am] Error 2
>
> $ gcc --version
> gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
> Copyright (C) 2006 Free Software Foundation, Inc.
>
>
> $ uname -a
> Linux ASBLX36 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "cpputest" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cpputest+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
Message has been deleted
0 new messages