Skip to content

Commit

Permalink
updated the test format
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Feb 9, 2024
1 parent fe2096c commit 4af55fe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 37 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ target_link_libraries(MrsUavAutostart_AutomaticStart
## | Testing |
## --------------------------------------------------------------

if(CATKIN_ENABLE_TESTING)
if(CATKIN_ENABLE_TESTING AND MRS_ENABLE_TESTING)

message(WARNING "Testing enabled.")

add_subdirectory(test)

Expand Down
34 changes: 0 additions & 34 deletions test/all_tests.sh

This file was deleted.

2 changes: 1 addition & 1 deletion test/compile_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR

# build the package
catkin build --this # it has to be fully built normally before building with --catkin-make-args tests
catkin build --this --no-deps --catkin-make-args tests
catkin build --this -DMRS_ENABLE_TESTING=1 --no-deps --catkin-make-args tests
2 changes: 1 addition & 1 deletion test/coverage.sh → test/gather_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd build
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info "*/test/*" --output-file coverage.info.removed
lcov --extract coverage.info.removed "*/${WORKSPACE_NAME}/src/*" --output-file coverage.info.cleaned
genhtml -o coverage_html coverage.info.cleaned | tee /tmp/genhtml.log
genhtml --title "MRS UAV System - Test coverage report" --demangle-cpp --legend --frames --show-details -o coverage_html coverage.info.cleaned | tee /tmp/genhtml.log

COVERAGE_PCT=`cat /tmp/genhtml.log | tail -n 1 | awk '{print $2}'`

Expand Down
8 changes: 8 additions & 0 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR

catkin test --this -i -p 1 -s

0 comments on commit 4af55fe

Please sign in to comment.