Merge pull request #812 from nico/ninjatest
authorNico Weber <nicolasweber@gmx.de>
Thu, 18 Sep 2014 05:00:33 +0000 (22:00 -0700)
committerNico Weber <nicolasweber@gmx.de>
Thu, 18 Sep 2014 05:00:33 +0000 (22:00 -0700)
Use a small, standalone testing framework for ninja instead of googletest.

1  2 
src/manifest_parser_test.cc

  #include <map>
  #include <vector>
  
- #include <gtest/gtest.h>
  #include "graph.h"
  #include "state.h"
+ #include "test.h"
  
  struct ParserTest : public testing::Test,
                      public ManifestParser::FileReader {
    void AssertParse(const char* input) {
      ManifestParser parser(&state, this);
      string err;
-     ASSERT_TRUE(parser.ParseTest(input, &err)) << err;
+     EXPECT_TRUE(parser.ParseTest(input, &err));
      ASSERT_EQ("", err);
    }
  
@@@ -553,15 -552,6 +552,15 @@@ TEST_F(ParserTest, Errors) 
      State state;
      ManifestParser parser(&state, NULL);
      string err;
 +    EXPECT_FALSE(parser.ParseTest("rule cc\n  command = foo\n  && bar",
 +                                  &err));
 +    EXPECT_EQ("input:3: expected variable name\n", err);
 +  }
 +
 +  {
 +    State state;
 +    ManifestParser parser(&state, NULL);
 +    string err;
      EXPECT_FALSE(parser.ParseTest("rule cc\n  command = foo\n"
                                    "build $: cc bar.cc\n",
                                    &err));