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

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

Issue 2350963006: Fix an issue in `gn analyze` when building all. (Closed)
Patch Set: use nico's union code 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
« no previous file with comments | « tools/gn/analyzer.cc ('k') | tools/mb/mb.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/analyzer.h" 6 #include "tools/gn/analyzer.h"
7 #include "tools/gn/build_settings.h" 7 #include "tools/gn/build_settings.h"
8 #include "tools/gn/builder.h" 8 #include "tools/gn/builder.h"
9 #include "tools/gn/loader.h" 9 #include "tools/gn/loader.h"
10 #include "tools/gn/settings.h" 10 #include "tools/gn/settings.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // This tests that if a build file is modified, we bail out early with 205 // This tests that if a build file is modified, we bail out early with
206 // "Found dependency (all)" error since we can't handle changes to 206 // "Found dependency (all)" error since we can't handle changes to
207 // build files yet (crbug.com/555273). 207 // build files yet (crbug.com/555273).
208 RunBasicTest( 208 RunBasicTest(
209 "{" 209 "{"
210 " \"files\": [ \"//a.cc\", \"//BUILD.gn\" ]," 210 " \"files\": [ \"//a.cc\", \"//BUILD.gn\" ],"
211 " \"additional_compile_targets\": []," 211 " \"additional_compile_targets\": [],"
212 " \"test_targets\": [ \"//:a\" ]" 212 " \"test_targets\": [ \"//:a\" ]"
213 "}", 213 "}",
214 "{" 214 "{"
215 "\"compile_targets\":[]," 215 "\"compile_targets\":[\"//:a\"],"
216 "\"status\":\"Found dependency (all)\"," 216 "\"status\":\"Found dependency (all)\","
217 "\"test_targets\":[\"//:a\"]" 217 "\"test_targets\":[\"//:a\"]"
218 "}"); 218 "}");
219 }
220
221 TEST_F(AnalyzerTest, BuildFilesWereModifiedAndCompilingAll) {
222 // This tests that if a build file is modified, we bail out early with
223 // "Found dependency (all)" error since we can't handle changes to
224 // build files yet (crbug.com/555273).
225 RunBasicTest(
226 "{"
227 " \"files\": [ \"//a.cc\", \"//BUILD.gn\" ],"
228 " \"additional_compile_targets\": [ \"all\" ],"
229 " \"test_targets\": [ \"//:a\" ]"
230 "}",
231 "{"
232 "\"compile_targets\":[\"all\"],"
233 "\"status\":\"Found dependency (all)\","
234 "\"test_targets\":[\"//:a\"]"
235 "}");
219 } 236 }
OLDNEW
« no previous file with comments | « tools/gn/analyzer.cc ('k') | tools/mb/mb.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698