Skip to content

Commit c772819

Browse files
author
Aaron Roller
committed
test: app only rostest fail check AM-686/platform-req
1 parent a4b5349 commit c772819

4 files changed

Lines changed: 51 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ if (CATKIN_ENABLE_TESTING)
224224
hz_config
225225
manual_to_disarming
226226
param
227+
platform_app_required_fail
227228
platform_app_required_pass
228229
platform_required_fail
229230
platform_required_pass
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <am_rostest_lib/am_rostest.h>
2+
3+
class PlatformAppRequiredFailTest : public RostestBase, am::AMLifeCycle
4+
{
5+
protected:
6+
7+
PlatformAppRequiredFailTest() : RostestBase() {
8+
}
9+
10+
};
11+
12+
TEST_F(PlatformAppRequiredFailTest, requiredPlatformInLaunchFile)
13+
{
14+
std::string missing = "missing";
15+
16+
std::string platform_required_param;
17+
ros::param::param<string>("/am_super/platform/required", platform_required_param, missing);
18+
ASSERT_EQ(platform_required_param,missing);
19+
20+
std::string platform_app_required_param;
21+
ros::param::param<string>("/am_super/platform/app/required", platform_app_required_param, missing);
22+
ASSERT_EQ(platform_app_required_param,"other");
23+
24+
std::string platform_actual_param;
25+
ros::param::param<string>("/am_super/platform/actual", platform_actual_param, missing);
26+
ASSERT_EQ(platform_actual_param,"maker_model_test");
27+
waitUntil(LifeCycleState::CONFIGURING,"LL88");
28+
waitUntil(LifeCycleState::FINALIZED,"88LL");
29+
waitUntilMissionState(brain_box_msgs::VxState::SHUTDOWN,"L8L8");
30+
}
31+
32+
int main(int argc, char** argv)
33+
{
34+
::testing::InitGoogleTest(&argc, argv);
35+
ros::init(argc, argv, ros::this_node::getName());
36+
37+
return RUN_ALL_TESTS();
38+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<launch>
2+
<!-- include test file and pass in this test node name -->
3+
<include file="$(find am_super)/rostest/am_super_rostest.test">
4+
<arg name="test_name" value="platform_app_required_fail"/>
5+
</include>
6+
<!-- only the app matters, the maker/model does not -->
7+
<rosparam param="/am_super/platform/app/required">other</rosparam>
8+
<rosparam param="/am_super/platform/actual">maker_model_test</rosparam>
9+
</launch>

rostest/platform_app_required_pass/platform_app_required_pass_rostest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#include <am_rostest_lib/am_rostest.h>
22

3-
class PlatformRequiredPassTest : public RostestBase, am::AMLifeCycle
3+
class PlatformAppRequiredPassTest : public RostestBase, am::AMLifeCycle
44
{
55
protected:
66

7-
PlatformRequiredPassTest() : RostestBase() {
7+
PlatformAppRequiredPassTest() : RostestBase() {
88
}
99

1010
};
1111

12-
TEST_F(PlatformRequiredPassTest, requiredPlatformInLaunchFile)
12+
TEST_F(PlatformAppRequiredPassTest, requiredPlatformInLaunchFile)
1313
{
1414
std::string missing = "missing";
1515

0 commit comments

Comments
 (0)