OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |