summaryrefslogtreecommitdiffstats
path: root/src/msvc_helper_test.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-08-12 21:52:18 (GMT)
committerEvan Martin <martine@danga.com>2012-08-12 21:52:18 (GMT)
commit1843f550d9b8b6d271cefdfb5fffd150bb8ef069 (patch)
tree6d4e9aa59249d5397f954ba541333126c5d52f38 /src/msvc_helper_test.cc
parent031237133e33ee4eb5e9641396d6b0f566b575c8 (diff)
downloadNinja-1843f550d9b8b6d271cefdfb5fffd150bb8ef069.zip
Ninja-1843f550d9b8b6d271cefdfb5fffd150bb8ef069.tar.gz
Ninja-1843f550d9b8b6d271cefdfb5fffd150bb8ef069.tar.bz2
add subprocess-spawning to msvc_helper
Rather than using subprocess.h, reimplement the subprocess code. This allows: 1) using anonymous (instead of named) pipes 2) not using all the completion port craziness 3) printing the output as it happens 4) further variation, like adjusting the environment (in a forthcoming change) without affecting the main subprocess code
Diffstat (limited to 'src/msvc_helper_test.cc')
-rw-r--r--src/msvc_helper_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/msvc_helper_test.cc b/src/msvc_helper_test.cc
index 9eb3c89..8db4c69 100644
--- a/src/msvc_helper_test.cc
+++ b/src/msvc_helper_test.cc
@@ -30,3 +30,13 @@ TEST(MSVCHelperTest, ShowIncludes) {
CLWrapper::FilterShowIncludes("Note: including file: "
"c:\\initspaces.h"));
}
+
+TEST(MSVCHelperTest, Run) {
+ CLWrapper cl;
+ string output;
+ cl.Run("cmd /c \"echo foo&& echo Note: including file: foo.h&&echo bar\"",
+ &output);
+ ASSERT_EQ("foo\nbar\n", output);
+ ASSERT_EQ(1u, cl.includes_.size());
+ ASSERT_EQ("foo.h", cl.includes_[0]);
+}