1

I can't work out how to get unit testing to work with Boost and Eclipse. I get lots of different errors depending on where I put the source files.

Where are the tests supposed to go? (ie should I create a test folder in root, in src, no folder at all or what)

Do I need to specify something somewhere if I don't intend to have a main(), and just lots of tests?

I'm really confused, and I know I'm being quite lite on the details - hopefully you can show me the proper way to do Unit Testing with Boost in Eclipse rather than whatever I'm currently doing.

Adam M-W
  • 3,509
  • 9
  • 49
  • 69
  • Sorry, don't understand your question. Especially depends eclipse and boost. Eclipse just IDE, boost just library (with unit testing framework). What way you are expected from Eclipse and Boost? It's are two different components. – Torsten Sep 06 '12 at 12:46
  • See http://stackoverflow.com/questions/2843795/where-do-you-put-your-unit-test – Mawg says reinstate Monica Nov 26 '14 at 07:30

1 Answers1

1

Compile your application in eclipse first normal without unit tests.

After that create a new Project and reference it to the former Project with your application. Than you create a main.cpp and insert your unit tests there.

You should be able to use the other projects classes from the new Project. Therefore, you are able to Instantiate Objects and do your asserts or whatever you like. If you have any further questions, please post your actual error and provide a screen-shot of your current structure.

Oliver
  • 928
  • 9
  • 25