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
25
#include "
modules/control/control_component/common/control_gflags.h
"
26
#include "
modules/control/control_component/control_component.h
"
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
36
DECLARE_string
(test_localization_file);
37
DECLARE_string
(test_pad_file);
38
DECLARE_string
(test_planning_file);
39
DECLARE_string
(test_chassis_file);
40
DECLARE_string
(test_data_dir);
41
DECLARE_string
(test_monitor_file);
42
47
namespace
apollo
{
48
namespace
control {
49
50
class
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);
58
void
LoadControllerPlugin
();
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
apollo::control::ControlComponent
Definition
control_component.h:53
apollo::control::ControlTestBase
Definition
control_test_base.h:50
apollo::control::ControlTestBase::SetUpTestCase
static void SetUpTestCase()
Definition
control_test_base.cc:229
apollo::control::ControlTestBase::LoadControllerPlugin
void LoadControllerPlugin()
Definition
control_test_base.cc:202
apollo::control::ControlTestBase::SetUp
virtual void SetUp()
Definition
control_test_base.cc:237
apollo::control::ControlTestBase::test_control
bool test_control()
Definition
control_test_base.cc:48
control_component.h
control_gflags.h
DECLARE_string
DECLARE_string(test_localization_file)
apollo
class register implement
Definition
arena_queue.h:37
apollo::control::ControlCommand
Definition
control_cmd.proto:26
modules
control
control_component
controller_task_base
integration_tests
control_test_base.h