提交 f47a8c98 编写于 作者: D Dong Li 提交者: lianglia-apollo

planning: fix garage test testdata dependency problem.

todo fix the localization crash problem
上级 903bf331
......@@ -22,13 +22,13 @@
#define MODULES_COMMON_UTIL_FILE_H_
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstdio>
#include <fstream>
#include <string>
#include <stdio.h>
#include "google/protobuf/io/zero_copy_stream_impl.h"
#include "google/protobuf/text_format.h"
......@@ -56,8 +56,8 @@ bool SetProtoToASCIIFile(const MessageType &message,
using google::protobuf::io::ZeroCopyOutputStream;
using google::protobuf::io::FileOutputStream;
using google::protobuf::TextFormat;
int file_descriptor = open(file_name.c_str(),
O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU);
int file_descriptor =
open(file_name.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU);
if (file_descriptor < 0) {
// Failed to open;
return false;
......@@ -84,6 +84,7 @@ bool GetProtoFromASCIIFile(const std::string &file_name, MessageType *message) {
using google::protobuf::TextFormat;
int file_descriptor = open(file_name.c_str(), O_RDONLY);
if (file_descriptor < 0) {
AERROR << "Failed to open file " << file_name;
// Failed to open;
return false;
}
......
......@@ -26,20 +26,13 @@ cc_library(
],
)
filegroup(
name = "garage_testdata",
srcs = glob([
"garage/**",
]),
)
cc_test(
name = "garage_test",
srcs = [
"garage_test.cc",
],
data = [
"garage_testdata",
"//modules/planning:planning_testdata",
],
deps = [
":planning_test_base",
......
......@@ -45,17 +45,18 @@ class GarageTest : public PlanningTestBase {
TEST_F(GarageTest, Stop) {
FLAGS_test_prediction_file =
"modules/planning/integration_tests/garage_test/"
"modules/planning/testdata/garage_test/"
"stop_obstacle_prediction.pb.txt";
FLAGS_test_localization_file =
"modules/planning/integration_tests/garage_test/"
"modules/planning/testdata/garage_test/"
"stop_obstacle_localization.pb.txt";
FLAGS_test_chassis_file =
"modules/planning/integration_tests/garage_test/"
"modules/planning/testdata/garage_test/"
"stop_obstacle_chassis.pb.txt";
EXPECT_DEATH(PlanningTestBase::SetUp(), ".*SetUpAdapters.*");
// RunPlanning();
// ASSERT_TRUE(adc_trajectory_ != nullptr);
// EXPECT_DEATH(PlanningTestBase::SetUp(), ".*SetUpAdapters.*");
PlanningTestBase::SetUp();
RunPlanning();
ASSERT_TRUE(adc_trajectory_ != nullptr);
}
} // namespace planning
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册