Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Dec 4, 2023
1 parent c239722 commit d7af9ce
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 411 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set(CATKIN_DEPENDENCIES
nodelet
std_msgs
topic_tools
mrs_uav_testing
)

find_package(catkin REQUIRED COMPONENTS
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<depend>nodelet</depend>
<depend>std_msgs</depend>
<depend>topic_tools</depend>
<depend>mrs_uav_testing</depend>

<export>
<nodelet plugin="${prefix}/nodelets.xml" />
Expand Down
19 changes: 2 additions & 17 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
find_package(rostest REQUIRED)
find_package(mrs_uav_testing REQUIRED)

# takeoff test

add_rostest_gtest(MrsUavAutostart_basic
basic/basic.test
basic/test.cpp
)

target_link_libraries(
MrsUavAutostart_basic
${catkin_LIBRARIES}
)

add_dependencies(
MrsUavAutostart_basic
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
add_subdirectory(takeoff)
29 changes: 3 additions & 26 deletions test/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,8 @@ set -e
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR

PACKAGE="mrs_uav_autostart"
VERBOSE=1

[ "$VERBOSE" = "0" ] && TEXT_OUTPUT=""
[ "$VERBOSE" = "1" ] && TEXT_OUTPUT="-t"

# build the package
catkin build $PACKAGE # it has to be fully built normally before building with --catkin-make-args tests
catkin build $PACKAGE --no-deps --catkin-make-args tests

TEST_FILES=$(find . -name "*.test" -type f -printf "%f\n")

for TEST_FILE in `echo $TEST_FILES`; do

echo "$0: running test '$TEST_FILE'"

# folder for test results
TEST_RESULT_PATH=$(realpath /tmp/$RANDOM)
mkdir -p $TEST_RESULT_PATH

# run the test
rostest $PACKAGE $TEST_FILE $TEXT_OUTPUT --results-filename=$PACKAGE.test --results-base-dir="$TEST_RESULT_PATH"

# evaluate the test results
echo test result path is $TEST_RESULT_PATH
catkin_test_results "$TEST_RESULT_PATH"
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

done
catkin test --this -i -p 1 -s
7 changes: 0 additions & 7 deletions test/basic/basic.test

This file was deleted.

16 changes: 0 additions & 16 deletions test/basic/config/custom_config.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions test/basic/config/network_config.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions test/basic/config/simulator.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions test/basic/config/world_config.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions test/basic/launch/mrs_uav_system.launch

This file was deleted.

189 changes: 0 additions & 189 deletions test/basic/test.cpp

This file was deleted.

Loading

0 comments on commit d7af9ce

Please sign in to comment.