Issue running unit tests (cpptest) using C++Test (9.6) and Cygwin (GCC 6.4)
Disclaimer: I have not used C++Test in the past.
I have installed Cygwin with GCC version 6.4.0 but the latest version of the GCC toolchain that C++Test version 9.6 seems to support is 4.9.x. I haven't figured out how to install an older version of GCC to match C++test requirements.
I figured that I could run static analysis by passing the -std=c++14 compiler flag and setting the C++Test compiler settings to GNU GCC 4.9.x (i.e forcing GCC to be mostly compatible). I can also generate unit tests without setup issues.
Unfortunately, as soon as I try generate stubs or run unit tests, I encounter issues with the cpptest library, which complains about the -std=c++14 flag, see output below.
cc1: warning: command line option '-std=c++14' is valid for C++/ObjC++ but not for C "/usr/include/stdlib.h", line 107: error: duplicate parameter name int __attribute__((__cdecl__)) mbtowc (wchar_t *restrict, const char *restrict, size_t);
Any suggestions as to how I can setup a compatible GCC toolchain for unit testing.
Comments
-
Hi Grant,
C++test 9.6 is a bit old now. The latest version 10.3.2 supports GCC 6.x, and the new C++ standard extensions, so if possible, try upgrading to the latest version.
1 -
Thanks, I certainly will try upgrade.
For now, I managed to get it running using mingw tools version 4.9.3.
0 -
@Grant_Zietsman I am glad you were able to get running, but as @Bogdan Czwartkowski recommended it will be good to give a try out to the latest version 10.3.2.
0