0

I want to have two different targets for my unit test Jamfile.

This is my currently directory structure :

Jamroot
src/Jamfile
test/Jamfile

and this is my test/Jamfile:

using testing ;
lib boost_unit_test_framework ;

run [ glob *.cpp ] boost_unit_test_framework 
    : --log_format=XML --log_sink=results.xml --log_level=all --report_level=no
    : 
    : <define>BOOST_TEST_DYN_LINK : test-xml ;

run [ glob *.cpp ] boost_unit_test_framework 
    : 
    : 
    : <define>BOOST_TEST_DYN_LINK : test ;

I want to be able to run b2 test when developing and have my CI run b2 test-xml to generate unit test reports for Jenkins. With this Jamfile I can only do it if I am currently in the "test" subdirectory, if I try to b2 test-xml from the Jamroot directory it says

don't know how to make test-xml

Any ideas?

Carneiro
  • 3,379
  • 3
  • 22
  • 33

1 Answers1

0

I added the following line to the Jamfile:

explicit test-xml ;

now b2 test builds only test (because test is the name of the subdirectory. but I can run b2 test//test-xml to explicitly run only test-xml.

Carneiro
  • 3,379
  • 3
  • 22
  • 33