How to set environment variable in Boost Build for Boost Unit Test Framework?

1k views Asked by At

Please note that:

  • I am using Boost Build and Boost Unit Test Framework. This means when I build a test it is automatically run it and show the result.
  • For running the GCC variant (and not the compile-time nor clang), I need to set the environment variable LC_ALL to C.

How do I do this in my Jamfile?

1

There are 1 answers

2
chwala On

I found here an option called testing.arg, you can use it to send arguments to the UnitTest's executable before starting it.

Here you can find information that you can set the environment variable using the following syntax in the UnitTest's command line --<command_line_argument_name>=<argument_value>.

By combining both information, we can assume that this will help you:

unit-test helpers_test
    : helpers_test.cpp helpers
    : <testing.arg>"--LC_ALL=C"
;
``