aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/command_line_interface_unittest.cc
diff options
context:
space:
mode:
authorBo Yang <paulyang1211@gmail.com>2015-02-07 15:28:54 -0800
committerBo Yang <paulyang1211@gmail.com>2015-02-07 15:28:54 -0800
commite2555e235f867f3d7a0378e95a45109c8fd2dfbe (patch)
tree9993073c9ea8166e589ef13a1d4f8f22f7098f14 /src/google/protobuf/compiler/command_line_interface_unittest.cc
parent1d627f85c3aef00b24a6a19e5bc2a46ef889f16f (diff)
downloadprotobuf-e2555e235f867f3d7a0378e95a45109c8fd2dfbe.tar.gz
protobuf-e2555e235f867f3d7a0378e95a45109c8fd2dfbe.tar.bz2
protobuf-e2555e235f867f3d7a0378e95a45109c8fd2dfbe.zip
Change target to output filenames
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface_unittest.cc')
-rw-r--r--src/google/protobuf/compiler/command_line_interface_unittest.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc
index f298be75..9e02f729 100644
--- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
@@ -959,6 +959,24 @@ TEST_F(CommandLineInterfaceTest, WriteTransitiveDescriptorSetWithSourceInfo) {
EXPECT_TRUE(descriptor_set.file(1).has_source_code_info());
}
+TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFileGivenTwoInputs) {
+ CreateTempFile("foo.proto",
+ "syntax = \"proto2\";\n"
+ "message Foo {}\n");
+ CreateTempFile("bar.proto",
+ "syntax = \"proto2\";\n"
+ "import \"foo.proto\";\n"
+ "message Bar {\n"
+ " optional Foo foo = 1;\n"
+ "}\n");
+
+ Run("protocol_compiler --dependency_out=$tmpdir/manifest "
+ "--test_out=$tmpdir --proto_path=$tmpdir bar.proto foo.proto");
+
+ ExpectErrorText(
+ "Can only process one input file when using --dependency_out=FILE.\n");
+}
+
TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFile) {
CreateTempFile("foo.proto",
"syntax = \"proto2\";\n"
@@ -976,8 +994,8 @@ TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFile) {
ExpectNoErrors();
ExpectFileContent("manifest",
- "$tmpdir/manifest: $tmpdir/foo.proto\\\n"
- " $tmpdir/bar.proto");
+ "$tmpdir/bar.proto.MockCodeGenerator.test_generator: "
+ "$tmpdir/foo.proto\\\n $tmpdir/bar.proto");
}
TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFileForRelativePath) {
@@ -1000,8 +1018,8 @@ TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFileForRelativePath) {
ExpectNoErrors();
ExpectFileContent("manifest",
- "$tmpdir/manifest: $tmpdir/foo.proto\\\n"
- " $tmpdir/bar.proto");
+ "$tmpdir/bar.proto.MockCodeGenerator.test_generator: "
+ "$tmpdir/foo.proto\\\n $tmpdir/bar.proto");
File::ChangeWorkingDirectory(current_working_directory);
}