Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
Expand All @@ -19,4 +29,4 @@ script:
- ctest . -C Debug -V

after_script:
- python <(curl -s https://raw.githubusercontent.com/report-ci/scripts/master/upload.py)
- 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]"
21 changes: 18 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 $<TARGET_FILE:test_one_bin> --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 $<TARGET_FILE:test_one_bin> --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 $<TARGET_FILE:test_two_bin> --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 $<TARGET_FILE:test_two_bin> --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 $<TARGET_FILE:test_sys_bin> --log_sink=test_sys.xml --log_format=XML --log_level=all --report_sink=report_sys.xml --report_format=XML --report_level=detailed)
add_test(NAME test_sys COMMAND $<TARGET_FILE:test_sys_bin> --log_sink=test_sys.xml --log_format=XML --log_level=${LOG_LEVEL} --report_sink=report_sys.xml --report_format=XML --report_level=${REPORT_LEVEL})