Merge pull request #77 from UAVCAN/issue-76

Adding CONTINUOUS_INTEGRATION_BUILD flag
This commit is contained in:
Pavel Kirienko 2015-10-26 11:13:41 +03:00
commit 8d726ec86d
3 changed files with 12 additions and 4 deletions

View File

@ -27,7 +27,7 @@ before_install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- sudo apt-get install libgtest-dev gcc-arm-none-eabi
- "cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -"
before_script: "mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug"
before_script: "mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug -DCONTINUOUS_INTEGRATION_BUILD=1"
script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TARGET}" == "native" ]; then make ; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TARGET}" == "lpc11c24" ]; then cd "$TRAVIS_BUILD_DIR/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24" && make all ; fi

View File

@ -21,6 +21,7 @@ set(opts
"CMAKE_C_FLAGS:STRING:::C flags."
"UAVCAN_USE_CPP03:BOOL:OFF::Use C++03 standard."
"UAVCAN_PLATFORM:STRING:generic:generic linux stm32:Platform."
"CONTINUOUS_INTEGRATION_BUILD:BOOL:OFF::Disable error redirection and timing tests"
)
foreach(_opt ${opts})
# arguments are : delimited

View File

@ -92,9 +92,16 @@ function(add_libuavcan_test name library flags) # Adds GTest executable and crea
# Tests run automatically upon successful build
# If failing tests need to be investigated with debugger, use 'make --ignore-errors'
add_custom_command(TARGET ${name} POST_BUILD
COMMAND ./${name} 1>"${name}.log" 2>&1
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if (CONTINUOUS_INTEGRATION_BUILD)
# Don't redirect test output, and don't run tests suffixed with "RealTime"
add_custom_command(TARGET ${name} POST_BUILD
COMMAND ./${name} --gtest_filter=-*RealTime
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
else ()
add_custom_command(TARGET ${name} POST_BUILD
COMMAND ./${name} 1>"${name}.log" 2>&1
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
endfunction()
if (DEBUG_BUILD)