title: How to add unit tests in Eclipse for a managed ARM C project?
body: <p>I've got a managed Eclipse project that uses the GNU ARM Embedded Toolchain to compile for an ST microcontroller. What I want to do now is, unit test the code in that project. The framework I want to use for unit testing is Google Test.</p>
  
  <p>I tried creating a second Eclipse project for the unit tests, that uses the standard GNU toolchain. Like this:</p>
  
  <p>Project1 (ARM)<br>
  |---src   </p>
  
  <p>Project2 (Desktop)<br>
  |---test  </p>
  
  <p>The problem with that is twofold:</p>
  
  <ol>
  <li>The second project doesn't have access to the source code of the first project (obviously). Therefore I tried creating a static library from the first project for testing purposes, which leads to the second problem.</li>
  <li>The Library created from the first project isn't compatible with the second project, because it uses the GNU ARM embedded toolchain instead of the standard GNU toolchain.</li>
  </ol>
  
  <p>To solve the second problem I added a build configuration to the first project to try and compile it with the right toolchain. That didn't work out though.</p>
  
  <p>Another path I went was to have the unit tests in the same project as the actual code and use a build configuration to create an executable for unit testing. Something like this:</p>
  
  <p>Project<br>
  |---src<br>
  |---test  </p>
  
  <p>That didn't work out as well and it kind of seems like it's the same problem as with the first approach anyway.</p>
  
  <p>The problem isn't unit testing in itself. I know how to use Google Test for testing regular C projects in eclipse.</p>
  
  <p>How is unit testing an embedded project usually approached with managed projects in eclipse? Is it possible at all? If so, is it a good way to do it or should I write my own makefile to accompilsh this task?</p>