Unit testing

  • Thread starter Peter Morris [Droopy eyes software]
  • Start date
P

Peter Morris [Droopy eyes software]

Hi all

I want to run my unit tests on my desktop rather than on my device.
However, the device project requires me to use a SomeLibrary.Compact.Dll
rather than SomeLibrary.Dll, so my question is, can I some how create a
custom build so that all my libraries are compiled with set A of libraries
(desktop) and then a post-build event is executed, and under another build
set B of libraries is used (compact)?

Thanks

Pete
 
G

Guest

Why not. As soon as you don't have code specific to the platform, you can
compile it against desktop framework.
 
P

Peter Morris [Droopy eyes software]

Why not. As soon as you don't have code specific to the platform, you can
compile it against desktop framework.

Hi Alex

Okay, so I can, but how is it done? :)
 
P

Peter Morris [Droopy eyes software]

I decided to create mirror projects in the same folder instead. The compact
ones ending with ".compact". Is there an easier way?
 
G

Guest

You can also create a separate project and add the source files as "Link
File". In this case the single source will be maintained.
 
P

Peter Morris [Droopy eyes software]

Hi Alex

I have the two projects in the same folder, so they share the same source.
However, I still need to manually keep both projects in sync when
adding/removing/renaming files. What I was hoping for was a way to have a
project kept in sync with another, but with the compile options + references
different.

I don't suppose VS does that though :)

Pete
 
A

Alex Yakhnin [MVP]

When you add a file into a desktop project you have an option to add it as
"Link File". On the "Add Existing Item" dialog there's a "drop down" button
next to the "Open" button. You will need to click it and select "Link File".
 
P

Peter Morris [Droopy eyes software]

Hi

But I would still have to add new files to project B when I add them to
project A. What I was hoping for was a way of having a kind of "Link
project", so that I can compile the other project with different compiler
options + references.

Pete
 
D

Daniel Moth

You are correct. Out of the box there exists no solution to cater for that
need. You have to manually go to the second project, show all files in
solution explorer, and then Include the file in the project (the file should
be in that directory already since you added it to the other project).

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top