1

I'm developing a shared library which needs to be tested and profiled regularly. The main target platform was Linux (generally) so our team chose the autotools (auto[scan,conf,make] + libtool + pkg-config) for buildsystem. Then client decided that he wants his software on Windows too. So I added a visual studio solution. The library compiles, links and works well on Windows too, though my development cycle lacks proper testing on Windows.

I'm using automake's test suits on Linux and test like this:

make check -j2

which compiles 10 executables (client server pairs) which are linked to my library (which is already built on the same buildsystem) and runs them (in pairs, ordered). The output is:

make[3]: Entering directory 'somefakepath/libfoo/test'
PASS: tcp_client
PASS: tcp_server
PASS: tcp_client_control
PASS: tcp_server_control
PASS: udp_client
PASS: udp_server
PASS: udp_client_raw
PASS: udp_server_raw
SKIP: udp_client_rtp
SKIP: udp_server_rtp

========================================================
Testsuite summary for libfoo 5.0.1
========================================================    
# TOTAL: 10
# PASS:  8
# SKIP:  2
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
========================================================

The problem is that I can't find a way to do the same in Visual Studio. I'm okay with adding another project to the solution (to make executables not libraries) though as far as I know, it's not possible to produce several executables from a single project in visual studio [1], [2]. And it does not feel right to add ten projects, with many configuration parameters set to same values for every single one of them... And also the choice of having single executable with many threads is not so good (I will have to change many lines, merge many[=10] files).

So how could I test my library on visual studio? Or maybe generate more than one exetable from several files in a single project? ( I can run them manually)

sorush-r
  • 10,490
  • 17
  • 89
  • 173

1 Answers1

1

If the only difference between your executables is some conditional compilation macros then you should create a single executable project with several configurations (i.e. udp_client_raw configuration, udp_server_raw configuration and so on). If they are different in some other aspects you may still need to create separate project. Notice that there is no need to set many configuration parameters to the same value - you can make a property sheet once and then attach it to all the projects.

There is no problem to produce several executables from a single project. You just need to build multiple configurations at once using either batch build from within Visual Studio or using msbuild from command line. It is also possible to set up a project that will launch them in pairs for testing purposes.

user7860670
  • 35,849
  • 4
  • 58
  • 84