Apollo 10.0
自动驾驶开放平台
control_test_base.h
浏览该文件的文档.
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"
22
23#include "modules/common_msgs/control_msgs/control_cmd.pb.h"
24
27
28#define RUN_GOLDEN_TEST \
29 { \
30 const ::testing::TestInfo *const test_info = \
31 ::testing::UnitTest::GetInstance()->current_test_info(); \
32 bool run_control_success = test_control(test_info->name(), 0); \
33 EXPECT_TRUE(run_control_success); \
34 }
35
36DECLARE_string(test_localization_file);
37DECLARE_string(test_pad_file);
38DECLARE_string(test_planning_file);
39DECLARE_string(test_chassis_file);
40DECLARE_string(test_data_dir);
41DECLARE_string(test_monitor_file);
42
47namespace apollo {
48namespace control {
49
50class ControlTestBase : public ::testing::Test {
51 public:
52 static void SetUpTestCase();
53
54 virtual void SetUp();
55
56 bool test_control();
57 bool test_control(const std::string &test_case_name, int case_num);
59
60 private:
61 void trim_control_command(apollo::control::ControlCommand *origin);
62 ControlCommand control_command_;
63 ControlComponent control_;
64 static uint32_t s_seq_num_;
65};
66
67} // namespace control
68} // namespace apollo
DECLARE_string(test_localization_file)
class register implement
Definition arena_queue.h:37