21#include "gtest/gtest.h"
30#define RUN_GOLDEN_TEST(sub_case_num) \
32 const ::testing::TestInfo* const test_info = \
33 ::testing::UnitTest::GetInstance()->current_test_info(); \
34 bool no_trajectory_point = false; \
35 bool run_planning_success = \
36 RunPlanning(test_info->name(), sub_case_num, no_trajectory_point); \
37 EXPECT_TRUE(run_planning_success); \
40#define RUN_GOLDEN_TEST_DECISION(sub_case_num) \
42 const ::testing::TestInfo* const test_info = \
43 ::testing::UnitTest::GetInstance()->current_test_info(); \
44 bool no_trajectory_point = true; \
45 bool run_planning_success = \
46 RunPlanning(test_info->name(), sub_case_num, no_trajectory_point); \
47 EXPECT_TRUE(run_planning_success); \
51 int main(int argc, char** argv) { \
52 ::apollo::cyber::Init("planning_test"); \
53 ::testing::InitGoogleTest(&argc, argv); \
54 ::google::ParseCommandLineFlags(&argc, &argv, true); \
55 return RUN_ALL_TESTS(); \
58#define ENABLE_RULE(RULE_ID) this->rule_enabled_.emplace(RULE_ID)
82 bool RunPlanning(
const std::string& test_case_name,
int case_num,
83 bool no_trajectory_point);
void TrimPlanning(ADCTrajectory *origin, bool no_trajectory_point)
std::set< std::string > rule_enabled_
std::shared_ptr< TrafficRule > GetTrafficRuleConfig(const std::string &rule_id)
virtual ~PlanningTestBase()=default
bool RunPlanning(const std::string &test_case_name, int case_num, bool no_trajectory_point)
Execute the planning code.
bool IsValidTrajectory(const ADCTrajectory &trajectory)
ADCTrajectory adc_trajectory_
static void SetUpTestCase()
std::shared_ptr< DependencyInjector > injector_
std::unique_ptr< PlanningBase > planning_
Planning module main class.
DECLARE_string(test_routing_response_file)