mqtt_cpp icon indicating copy to clipboard operation
mqtt_cpp copied to clipboard

Control log_level of Boost.Test via ctest on Windows

Open redboltz opened this issue 4 years ago • 0 comments

ctest runs executables that are using Boost.Test. The executables take arguments like --log_level=all. I couldn't find a easy way to provide the arguments via ctest.

Boost.Test can handle both boost test options and user program options.

./a.out --log_level=all -- arg1 arg2

After -- , I can pass the arguments for the program.

I expect the similar functionality to ctest. e.g)

ctest -V -- --log_level=all -- arg1 arg2

However, there isn't.

So I used the following hack.

https://github.com/redboltz/mqtt_cpp/blob/2627573699b8be4772e3e0622bdcde05657ef2f8/test/args_provider.sh#L1-L3 https://github.com/redboltz/mqtt_cpp/blob/2627573699b8be4772e3e0622bdcde05657ef2f8/test/CMakeLists.txt#L131 https://github.com/redboltz/mqtt_cpp/blob/2627573699b8be4772e3e0622bdcde05657ef2f8/.github/workflows/gha.yml#L86

It works.

However, I tired to do the same thing on windows but I couldn't do that.

Here is a part of code I tried.

https://github.com/redboltz/mqtt_cpp/blob/2627573699b8be4772e3e0622bdcde05657ef2f8/test/args_provider.ps1#L1-L2 https://github.com/redboltz/mqtt_cpp/blob/2627573699b8be4772e3e0622bdcde05657ef2f8/azure-pipelines.yml#L155-L157

It remains in master for future.

redboltz avatar Nov 29 '20 02:11 redboltz