summaryrefslogtreecommitdiffstats
path: root/ninja_test.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2010-10-15 05:14:06 (GMT)
committerEvan Martin <martine@danga.com>2010-10-15 05:14:06 (GMT)
commita626ee8bd3c77b05a38e2ebb2f82f49738e404e2 (patch)
treefb4695cc364f0109a01e769b77f083f782b4c75b /ninja_test.cc
downloadNinja-a626ee8bd3c77b05a38e2ebb2f82f49738e404e2.zip
Ninja-a626ee8bd3c77b05a38e2ebb2f82f49738e404e2.tar.gz
Ninja-a626ee8bd3c77b05a38e2ebb2f82f49738e404e2.tar.bz2
import
Diffstat (limited to 'ninja_test.cc')
-rw-r--r--ninja_test.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/ninja_test.cc b/ninja_test.cc
new file mode 100644
index 0000000..145c53c
--- /dev/null
+++ b/ninja_test.cc
@@ -0,0 +1,20 @@
+#include "ninja.h"
+
+#include <gtest/gtest.h>
+
+struct NinjaTest : public testing::Test {
+ NinjaTest() {
+ rule_cat_ = state_.AddRule("cat", "cat @in > $out");
+ }
+
+ Rule* rule_cat_;
+ State state_;
+};
+
+TEST_F(NinjaTest, Basic) {
+ Edge* edge = state_.AddEdge(rule_cat_);
+ state_.AddInOut(edge, Edge::IN, "in1");
+ state_.AddInOut(edge, Edge::IN, "in2");
+ state_.AddInOut(edge, Edge::OUT, "out");
+}
+