diff --git a/.travis.yml b/.travis.yml index f87f3aa..cc61256 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,16 @@ addons: - libboost-test-dev - cmake +env: + - BOOST_LOG_LEVEL=all BOOST_REPORT_LEVEL=detailed + - BOOST_LOG_LEVEL=all BOOST_REPORT_LEVEL=no + - BOOST_LOG_LEVEL=test_suite BOOST_REPORT_LEVEL=confirm + - BOOST_LOG_LEVEL=message BOOST_REPORT_LEVEL=short + - BOOST_LOG_LEVEL=warning BOOST_REPORT_LEVEL=detailed + - BOOST_LOG_LEVEL=error BOOST_REPORT_LEVEL=detailed + - BOOST_LOG_LEVEL=nothing BOOST_REPORT_LEVEL=detailed + - BOOST_LOG_LEVEL=nothing BOOST_REPORT_LEVEL=no + script: - mkdir build && cd build - cmake .. @@ -19,4 +29,4 @@ script: - ctest . -C Debug -V after_script: - - python <(curl -s https://raw.githubusercontent.com/report-ci/scripts/master/upload.py) \ No newline at end of file + - curl -s https://raw.githubusercontent.com/report-ci/scripts/master/upload.py | python - --name "Boost.Test [travis-ci, log=$BOOST_LOG_LEVEL, report=$BOOST_REPORT_LEVEL]" \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b6d8e21..665d8f7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,13 +1,28 @@ enable_testing() +if (NOT "$ENV{BOOST_LOG_LEVEL}" STREQUAL "") + set(LOG_LEVEL "$ENV{BOOST_LOG_LEVEL}" CACHE INTERNAL "Copied from environment variable") +else() + set(LOG_LEVEL all) +endif() + +if (NOT "$ENV{BOOST_REPORT_LEVEL}" STREQUAL "") + set(REPORT_LEVEL "$ENV{BOOST_REPORT_LEVEL}" CACHE INTERNAL "Copied from environment variable") +else() + set(REPORT_LEVEL detailed) +endif() + +message("Using report level ${REPORT_LEVEL}") +message("Using log level ${LOG_LEVEL}") + add_executable(test_one_bin test_one.cpp) target_link_libraries(test_one_bin Boost::unit_test_framework Boost::prg_exec_monitor) -add_test(NAME test_one COMMAND $ --log_sink=test_one.xml --log_format=XML --log_level=all --report_sink=report_one.xml --report_format=XML --report_level=detailed) +add_test(NAME test_one COMMAND $ --log_sink=test_one.xml --log_format=XML --log_level=${LOG_LEVEL} --report_sink=report_one.xml --report_format=XML --report_level=${REPORT_LEVEL}) add_executable(test_two_bin test_two.cpp) target_link_libraries(test_two_bin Boost::unit_test_framework Boost::prg_exec_monitor) -add_test(NAME test_two COMMAND $ --log_sink=test_two.xml --log_format=XML --log_level=all --report_sink=report_two.xml --report_format=XML --report_level=detailed) +add_test(NAME test_two COMMAND $ --log_sink=test_two.xml --log_format=XML --log_level=${LOG_LEVEL} --report_sink=report_two.xml --report_format=XML --report_level=${REPORT_LEVEL}) add_executable(test_sys_bin test_sys.cpp) target_link_libraries(test_sys_bin Boost::unit_test_framework Boost::prg_exec_monitor) -add_test(NAME test_sys COMMAND $ --log_sink=test_sys.xml --log_format=XML --log_level=all --report_sink=report_sys.xml --report_format=XML --report_level=detailed) \ No newline at end of file +add_test(NAME test_sys COMMAND $ --log_sink=test_sys.xml --log_format=XML --log_level=${LOG_LEVEL} --report_sink=report_sys.xml --report_format=XML --report_level=${REPORT_LEVEL})