Eclipse incluye rutas con directorios virtuales

I have a C++ project in Eclipse Juno and I'm using the Boost Unit Test Framework. I am new to formal Unit Testing, so I am still working on my workflow.

My workspace contains two projects:

(1) my C++ Project

(2) unit test project to test the classes in (1)

As I write each unit test I import the necessary directories and files from (1) into (2) as directorios virtuales.

This works OK for the source files, but it doesn't seem to work for the header files.

e.g. compiling unit_test.cpp with

#include "foo/bar.h"


../unit_tests.cpp:8:30: error: foo/bar.h: No such file or directory

aunque hay un directorio virtual foo con bar.h en ella.

If I use the Eclipse "Open Declaration" command (F3) on: #include "foo/bar.h" it will open the file, but the compiler can't find the file because it doesn't actually exist in the folder (I guess).

I noticed that the compiler compiles the "real" source files with a non-virtual directory path, but obviously this isn't done automatically for the header files.

I solved my problem by adding a Workspace referenced include path to the compiler. e.g. ${workspace_loc:/my C++ Project} and this solved the problem, but what was the point of having virtual files when I have to create a reference to a real file anyway?

Mis preguntas son las siguientes:

(*) Is this a good work flow?

(*) How can my workflow be improved?

(*) How do other people use Eclipse/IDEs to manage unit tests?

preguntado el 28 de agosto de 12 a las 14:08

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.