Apollo  6.0
Open source self driving car software
control_test_base.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 The Apollo Authors. All Rights Reserved.
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  *****************************************************************************/
16 
17 #pragma once
18 
19 #include <string>
20 
21 #include "gtest/gtest.h"
24 #include "modules/control/proto/control_cmd.pb.h"
25 
26 #define RUN_GOLDEN_TEST \
27  { \
28  const ::testing::TestInfo *const test_info = \
29  ::testing::UnitTest::GetInstance()->current_test_info(); \
30  bool run_control_success = test_control(test_info->name(), 0); \
31  EXPECT_TRUE(run_control_success); \
32  }
33 
34 DECLARE_string(test_localization_file);
35 DECLARE_string(test_pad_file);
36 DECLARE_string(test_planning_file);
37 DECLARE_string(test_chassis_file);
38 DECLARE_string(test_data_dir);
39 DECLARE_string(test_monitor_file);
40 
45 namespace apollo {
46 namespace control {
47 
48 class ControlTestBase : public ::testing::Test {
49  public:
50  static void SetUpTestCase();
51 
52  virtual void SetUp();
53 
54  bool test_control();
55  bool test_control(const std::string &test_case_name, int case_num);
56 
57  private:
58  void trim_control_command(apollo::control::ControlCommand *origin);
59  ControlCommand control_command_;
60  ControlComponent control_;
61  static uint32_t s_seq_num_;
62 };
63 
64 } // namespace control
65 } // namespace apollo
DECLARE_string(test_localization_file)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: control_component.h:53
Definition: control_test_base.h:48