Boost logo

Boost-Build :

Subject: [Boost-build] unit-test rule with different launcher
From: lepere renaud (lepere.renaud_at_[hidden])
Date: 2013-09-29 07:24:15

I am using boost unit-test framework and bbv2. I would like to launch
the same test executable twice with different arguments/launcher (mostly
--log_format=XML and a thin python script to generate a report).

My jamfile is something like this

alias utf : /boost//unit_test_framework/<link>shared ;

unit-test run_test : runner.cpp mytest.cpp .//utf ;
unit-test report_test : runner.cpp mytest.cpp .//utf :
<testing.launcher>pylauncher ;

But when i launch bjam this leads to an error

error: Duplicate name of actual target: <p...>runner.o
error: created from ./run_test
error: created from ./report_test
error: added properties: <testing.launcher>pylauncher

Why the testing.launcher property have an influence on how i build the
exectuable ?

The only workaround i found was to create an obj target for all the .cpp
obj runner : runner.cpp ;
obj test_angle : test_angle.cpp ;
and then :
unit-test run_test : .//runner .//test_angle .//utf ;
unit-test report_test : .//runner .//test_angle .//utf :

Is there a more elegant / better way to do it ?



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at