Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Unified Diff: tools/gn/graph_unittest.cc

Issue 2265833002: Implement `gn analyze`. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tools/gn/graph.cc ('K') | « tools/gn/graph.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/graph_unittest.cc
diff --git a/tools/gn/graph_unittest.cc b/tools/gn/graph_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..59d9fc0318a7410fe42ad2c8b1f9ec4b77634d0a
--- /dev/null
+++ b/tools/gn/graph_unittest.cc
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "testing/gtest/include/gtest/gtest.h"
+#include "tools/gn/graph.h"
+#include "tools/gn/source_file.h"
+
+// Do a basic sanity check of Analyze().
+TEST(Graph, BasicAnalyze) {
+ /*
+ AnalyzeInputs inputs;
+ TargetVector all_targets;
+
+ SourceFile base_values_file = SourceFile("//base/values.cc");
+ std::string base_unittests_label = "//base:base_unittests";
+ std::string found_dependency = "Found dependency";
+ std::string empty_string = "";
+
+ inputs.files.push_back(&base_values_file);
+ inputs.compile_targets.push_back(base_unittests_label);
+ inputs.test_targets.push_back(base_unittests_label);
+
+ Label default_toolchain_label;
+
+ AnalyzeOutputs outputs = Analyze(all_targets, default_toolchain_label,
+ inputs);
+
+ ASSERT_EQ(found_dependency, outputs.status);
+ ASSERT_EQ(empty_string, outputs.error);
+ ASSERT_EQ(0u, outputs.invalid_targets.size());
+ ASSERT_EQ(1u, outputs.affected_compile_targets.size());
+ ASSERT_EQ(base_unittests_label, outputs.affected_compile_targets[0]);
+ ASSERT_EQ(1u, outputs.affected_test_targets.size());
+ ASSERT_EQ(base_unittests_label, outputs.affected_test_targets[0]);
+ */
+}
« tools/gn/graph.cc ('K') | « tools/gn/graph.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698