Hey there!
I'm trying to implement CppUTest at the company I work at. Here we use ARM Cortex M4 based NXP kinetis microcontrollers (FRDM-K64F, FRDM-K22F similar processors), which we develop using Kinetis Design Studio (KDS) 3.0.0, an Eclipse Mylyn based IDE, in Windows 7/8.
I followed the instructions in cpputest-3.7.1\platforms\Eclipse-Cygwin\README.md, built the project in my Eclipse Environment and ran the tests using the CppUTest Plugin. Next step I tried to create a C++ Cygwin as a testing environment. So I linked cpputest libraries (src and include files, with both CppUTest and CppuTestExt) to my project. When I tried to build the following simple test:
#include "CommandLineTestRunner.h"
int main(int ac, char** av)
{
return CommandLineTestRunner::RunAllTests(ac, av);
}
I got the compile errors:
-make: *** [HelloWorldCpp.exe] Error 1 HelloWorldCpp C/C++ Problem
-recipe for target 'HelloWorldCpp.exe' failed makefile /HelloWorldCpp/Debug line 45 C/C++ Problem
-relocation truncated to fit: R_X86_64_PC32 against undefined symbol `CommandLineTestRunner::RunAllTests(int, char**)' HelloWorldCpp line 0 C/C++ Problem
-undefined reference to `CommandLineTestRunner::RunAllTests(int, char**)' HelloWorldCpp.cpp /HelloWorldCpp/src line 13 C/C++ Problem
I saw the the truncation error is related to linking address overflow for x86-64 bits machines, but I'm not sure what it might be going on.
Also I suppose I should set up a build for Cygwin target and another for my ARM Cortex device, is that right? If yes, will my arm compiler compile the CppUTest files? Any thoughts about a roadmap for setting up the tests environment for my scenario will be highly accepted.
Best Regards,
Denis