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

Side by Side Diff: tools/gn/graph_unittest.cc

Issue 2265833002: Implement `gn analyze`. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sample tests Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/graph.h"
7 #include "tools/gn/source_file.h"
8
9 // Do a basic sanity check of Analyze().
10 TEST(Graph, BasicAnalyze) {
11 /*
12 AnalyzeInputs inputs;
13 TargetVector all_targets;
14
15 SourceFile base_values_file = SourceFile("//base/values.cc");
16 std::string base_unittests_label = "//base:base_unittests";
17 std::string found_dependency = "Found dependency";
18 std::string empty_string = "";
19
20 inputs.files.push_back(&base_values_file);
21 inputs.compile_targets.push_back(base_unittests_label);
22 inputs.test_targets.push_back(base_unittests_label);
23
24 Label default_toolchain_label;
25
26 AnalyzeOutputs outputs = Analyze(all_targets, default_toolchain_label,
27 inputs);
28
29 ASSERT_EQ(found_dependency, outputs.status);
30 ASSERT_EQ(empty_string, outputs.error);
31 ASSERT_EQ(0u, outputs.invalid_targets.size());
32 ASSERT_EQ(1u, outputs.affected_compile_targets.size());
33 ASSERT_EQ(base_unittests_label, outputs.affected_compile_targets[0]);
34 ASSERT_EQ(1u, outputs.affected_test_targets.size());
35 ASSERT_EQ(base_unittests_label, outputs.affected_test_targets[0]);
36 */
37 }
OLDNEW
« tools/gn/graph.cc ('K') | « tools/gn/graph.cc ('k') | tools/gn/inp1.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698