13
13
// limitations under the License.
14
14
15
15
#include < gtest/gtest.h>
16
+
16
17
#include < cstdlib>
17
18
#include < iostream>
18
19
#include < string>
19
20
20
21
TEST (TestLaunchFile, test_launch_file)
21
22
{
22
- // Define the path of Python launch file
23
- std::string global_params_launch_path = " global_params.launch.py" ;
24
- // Define the parameters you want to pass to the launch file
25
- std::string use_sim_time_param = " false" ;
26
- std::string vehicle_model_param = " sample_vehicle" ;
27
- // Construct the command to run the Python launch script with parameters
28
- std::string command = " ros2 launch global_parameter_loader " + global_params_launch_path +
29
- " use_sim_time:=" + use_sim_time_param +
30
- " vehicle_model:=" + vehicle_model_param;
23
+ // Define the path of Python launch file
24
+ std::string global_params_launch_path = " global_params.launch.py" ;
25
+ // Define the parameters you want to pass to the launch file
26
+ std::string use_sim_time_param = " false" ;
27
+ std::string vehicle_model_param = " sample_vehicle" ;
28
+ // Construct the command to run the Python launch script with parameters
29
+ std::string command = " ros2 launch global_parameter_loader " + global_params_launch_path +
30
+ " use_sim_time:=" + use_sim_time_param +
31
+ " vehicle_model:=" + vehicle_model_param;
31
32
32
- // Use the system() function to execute the command
33
- int result = std::system (command.c_str ());
34
- // Check the result of running the launch file
35
- EXPECT_EQ (result, 0 );
33
+ // Use the system() function to execute the command
34
+ int result = std::system (command.c_str ());
35
+ // Check the result of running the launch file
36
+ EXPECT_EQ (result, 0 );
36
37
}
37
38
38
39
int main (int argc, char * argv[])
39
40
{
40
- testing::InitGoogleTest (&argc, argv);
41
- return RUN_ALL_TESTS ();
42
- }
41
+ testing::InitGoogleTest (&argc, argv);
42
+ return RUN_ALL_TESTS ();
43
+ }
0 commit comments