summaryrefslogtreecommitdiffstats
path: root/src/msvc_helper_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/msvc_helper_test.cc')
-rw-r--r--src/msvc_helper_test.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/msvc_helper_test.cc b/src/msvc_helper_test.cc
index 8db4c69..a0bab90 100644
--- a/src/msvc_helper_test.cc
+++ b/src/msvc_helper_test.cc
@@ -31,6 +31,16 @@ TEST(MSVCHelperTest, ShowIncludes) {
"c:\\initspaces.h"));
}
+TEST(MSVCHelperTest, FilterInputFilename) {
+ ASSERT_TRUE(CLWrapper::FilterInputFilename("foobar.cc"));
+ ASSERT_TRUE(CLWrapper::FilterInputFilename("foo bar.cc"));
+ ASSERT_TRUE(CLWrapper::FilterInputFilename("baz.c"));
+
+ ASSERT_FALSE(CLWrapper::FilterInputFilename(
+ "src\\cl_helper.cc(166) : fatal error C1075: end "
+ "of file found ..."));
+}
+
TEST(MSVCHelperTest, Run) {
CLWrapper cl;
string output;
@@ -40,3 +50,11 @@ TEST(MSVCHelperTest, Run) {
ASSERT_EQ(1u, cl.includes_.size());
ASSERT_EQ("foo.h", cl.includes_[0]);
}
+
+TEST(MSVCHelperTest, RunFilenameFilter) {
+ CLWrapper cl;
+ string output;
+ cl.Run("cmd /c \"echo foo.cc&& echo cl: warning\"",
+ &output);
+ ASSERT_EQ("cl: warning\n", output);
+}