File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ignore :
2+ - " system_modes_examples"
3+ - " system_modes/test"
4+ - " **/*_node.cpp"
Original file line number Diff line number Diff line change @@ -147,6 +147,28 @@ if(BUILD_TESTING)
147147 target_link_libraries (test_mode_inference mode )
148148 endif ()
149149
150+ ament_add_gtest (test_mode_manager
151+ test /test_mode_manager.cpp
152+ src/system_modes/mode_manager.cpp )
153+ if (TARGET test_mode_manager)
154+ target_include_directories (test_mode_manager PUBLIC
155+ ${rclcpp_INCLUDE_DIRS}
156+ ${CMAKE_CURRENT_BINARY_DIR} /system_modes/
157+ )
158+ target_link_libraries (test_mode_manager mode )
159+ endif ()
160+
161+ ament_add_gtest (test_mode_monitor
162+ test /test_mode_monitor.cpp
163+ src/system_modes/mode_monitor.cpp )
164+ if (TARGET test_mode_monitor)
165+ target_include_directories (test_mode_monitor PUBLIC
166+ ${rclcpp_INCLUDE_DIRS}
167+ ${CMAKE_CURRENT_BINARY_DIR} /system_modes/
168+ )
169+ target_link_libraries (test_mode_monitor mode )
170+ endif ()
171+
150172 # Launch Tests
151173 find_package (launch_testing_ament_cmake REQUIRED )
152174 set (launch_tests
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2021 - for information on the respective copyright owner
2+ // see the NOTICE file and/or the repository https://github.com/microros/system_modes
3+ //
4+ // Licensed under the Apache License, Version 2.0 (the "License");
5+ // you may not use this file except in compliance with the License.
6+ // You may obtain a copy of the License at
7+ //
8+ // http://www.apache.org/licenses/LICENSE-2.0
9+ //
10+ // Unless required by applicable law or agreed to in writing, software
11+ // distributed under the License is distributed on an "AS IS" BASIS,
12+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ // See the License for the specific language governing permissions and
14+ // limitations under the License.
15+ #include < rclcpp/rclcpp.hpp>
16+
17+ #include < gtest/gtest.h>
18+
19+ #include < stdexcept>
20+
21+ #include " system_modes/modefiles.h"
22+ #include " system_modes/mode_manager.hpp"
23+
24+ using system_modes::ModeManager;
25+
26+ TEST (TestModeManager, initialization) {
27+ ModeManager * manager;
28+
29+ EXPECT_THROW (manager = new ModeManager (), std::invalid_argument);
30+
31+ (void ) manager;
32+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2021 - for information on the respective copyright owner
2+ // see the NOTICE file and/or the repository https://github.com/microros/system_modes
3+ //
4+ // Licensed under the Apache License, Version 2.0 (the "License");
5+ // you may not use this file except in compliance with the License.
6+ // You may obtain a copy of the License at
7+ //
8+ // http://www.apache.org/licenses/LICENSE-2.0
9+ //
10+ // Unless required by applicable law or agreed to in writing, software
11+ // distributed under the License is distributed on an "AS IS" BASIS,
12+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ // See the License for the specific language governing permissions and
14+ // limitations under the License.
15+ #include < rclcpp/rclcpp.hpp>
16+
17+ #include < gtest/gtest.h>
18+
19+ #include < stdexcept>
20+
21+ #include " system_modes/modefiles.h"
22+ #include " system_modes/mode_monitor.hpp"
23+
24+ using system_modes::ModeMonitor;
25+
26+ TEST (TestModeMonitor, initialization) {
27+ ModeMonitor * monitor;
28+
29+ EXPECT_THROW (monitor = new ModeMonitor (), std::invalid_argument);
30+
31+ (void ) monitor;
32+ }
You can’t perform that action at this time.
0 commit comments