Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: autowarefoundation/autoware_universe
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7de511a401fb6efb3084533a6ff742bce82c1c56
Choose a base ref
..
head repository: autowarefoundation/autoware_universe
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1d3d3704f50a6f411e019ef9f5857245b2252530
Choose a head ref
Showing with 16 additions and 18 deletions.
  1. +16 −18 common/global_parameter_loader/test/test_global_params_launch.cpp
34 changes: 16 additions & 18 deletions common/global_parameter_loader/test/test_global_params_launch.cpp
Original file line number Diff line number Diff line change
@@ -13,32 +13,30 @@
// limitations under the License.

#include <gtest/gtest.h>

#include <cstdlib>
#include <iostream>
#include <string>

TEST(TestLaunchFile, test_launch_file)
{
// Define the path of Python launch file
std::string global_params_launch_path = "global_params.launch.py";

// Define the parameters you want to pass to the launch file
std::string use_sim_time_param = "false";
std::string vehicle_model_param = "sample_vehicle";
// Construct the command to run the Python launch script with parameters
std::string command = "ros2 launch global_parameter_loader " + global_params_launch_path +
" use_sim_time:=" + use_sim_time_param +
" vehicle_model:=" + vehicle_model_param;
// Define the path of Python launch file
std::string global_params_launch_path = "global_params.launch.py";
// Define the parameters you want to pass to the launch file
std::string use_sim_time_param = "false";
std::string vehicle_model_param = "sample_vehicle";
// Construct the command to run the Python launch script with parameters
std::string command = "ros2 launch global_parameter_loader " + global_params_launch_path +
" use_sim_time:=" + use_sim_time_param +
" vehicle_model:=" + vehicle_model_param;

// Use the system() function to execute the command
int result = std::system(command.c_str());
// Check the result of running the launch file
EXPECT_EQ(result, 0);
// Use the system() function to execute the command
int result = std::system(command.c_str());
// Check the result of running the launch file
EXPECT_EQ(result, 0);
}

int main(int argc, char * argv[])
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}