Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
fba7976f
Commit
fba7976f
authored
Jun 08, 2016
by
Feng Xiao
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #879 from mathstuf/support-equals-in-proto-path
protoc: support '=' in --proto_path arguments
parents
401e07d3
462e7fab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
command_line_interface.cc
src/google/protobuf/compiler/command_line_interface.cc
+7
-2
command_line_interface_unittest.cc
...ogle/protobuf/compiler/command_line_interface_unittest.cc
+15
-0
No files found.
src/google/protobuf/compiler/command_line_interface.cc
View file @
fba7976f
...
...
@@ -1136,8 +1136,13 @@ CommandLineInterface::InterpretArgument(const string& name,
// Make sure disk path exists, warn otherwise.
if
(
access
(
disk_path
.
c_str
(),
F_OK
)
<
0
)
{
std
::
cerr
<<
disk_path
<<
": warning: directory does not exist."
<<
std
::
endl
;
// Try the original path; it may have just happed to have a '=' in it.
if
(
access
(
parts
[
i
].
c_str
(),
F_OK
)
<
0
)
{
cerr
<<
disk_path
<<
": warning: directory does not exist."
<<
endl
;
}
else
{
virtual_path
=
""
;
disk_path
=
parts
[
i
];
}
}
// Don't use make_pair as the old/default standard library on Solaris
...
...
src/google/protobuf/compiler/command_line_interface_unittest.cc
View file @
fba7976f
...
...
@@ -786,6 +786,21 @@ TEST_F(CommandLineInterfaceTest, NonRootMapping) {
ExpectGenerated
(
"test_generator"
,
""
,
"bar/foo.proto"
,
"Foo"
);
}
TEST_F
(
CommandLineInterfaceTest
,
PathWithEqualsSign
)
{
// Test setting up a search path which happens to have '=' in it.
CreateTempDir
(
"with=sign"
);
CreateTempFile
(
"with=sign/foo.proto"
,
"syntax =
\"
proto2
\"
;
\n
"
"message Foo {}
\n
"
);
Run
(
"protocol_compiler --test_out=$tmpdir "
"--proto_path=$tmpdir/with=sign foo.proto"
);
ExpectNoErrors
();
ExpectGenerated
(
"test_generator"
,
""
,
"foo.proto"
,
"Foo"
);
}
TEST_F
(
CommandLineInterfaceTest
,
MultipleGenerators
)
{
// Test that we can have multiple generators and use both in one invocation,
// each with a different output directory.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment