Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control log_level of Boost.Test via ctest on Windows #743

Open
redboltz opened this issue Nov 29, 2020 · 0 comments
Open

Control log_level of Boost.Test via ctest on Windows #743

redboltz opened this issue Nov 29, 2020 · 0 comments

Comments

@redboltz
Copy link
Owner

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.

#!/bin/sh
$1 $(echo ${CTEST_ARGS})

ADD_TEST (NAME ${source_file_we} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/args_provider.sh ${CMAKE_CURRENT_BINARY_DIR}/${source_file_we})

CTEST_ARGS="--log_level=all" ctest -VV

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.

Param( $command )
Start-Process -FilePath $command -ArgumentList $env:CTEST_ARGS -Wait

# If you want to debug a specific test file with logs, do as follows instead of execute ctest
# Release\resend.exe --log_level=all
ctest -VV -C Release

It remains in master for future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant