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

Unified Diff: tools/gn/c_include_iterator_unittest.cc

Issue 1217093007: Add a //nogncheck anntation to GN include checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « tools/gn/c_include_iterator.cc ('k') | tools/gn/docs/reference.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/c_include_iterator_unittest.cc
diff --git a/tools/gn/c_include_iterator_unittest.cc b/tools/gn/c_include_iterator_unittest.cc
index c5b971431541653857a6020e89396aaa3a1415a4..11fa9917c4e6848c7521aecf387a70f6f4d65595 100644
--- a/tools/gn/c_include_iterator_unittest.cc
+++ b/tools/gn/c_include_iterator_unittest.cc
@@ -29,6 +29,8 @@ TEST(CIncludeIterator, Basic) {
buffer.append("\n");
buffer.append(" #include \"foo/baz.h\"\n"); // Leading whitespace
buffer.append("#include \"la/deda.h\"\n");
+ // Line annotated with "// nogncheck"
+ buffer.append("#include \"should_be_skipped.h\" // nogncheck\n");
buffer.append("#import \"weird_mac_import.h\"\n");
buffer.append("\n");
buffer.append("void SomeCode() {\n");
@@ -52,9 +54,11 @@ TEST(CIncludeIterator, Basic) {
EXPECT_EQ("la/deda.h", contents);
EXPECT_TRUE(RangeIs(range, 8, 11, 20)) << range.begin().Describe(true);
+ // The line annotated with "nogncheck" should be skipped.
+
EXPECT_TRUE(iter.GetNextIncludeString(&contents, &range));
EXPECT_EQ("weird_mac_import.h", contents);
- EXPECT_TRUE(RangeIs(range, 9, 10, 28)) << range.begin().Describe(true);
+ EXPECT_TRUE(RangeIs(range, 10, 10, 28)) << range.begin().Describe(true);
EXPECT_FALSE(iter.GetNextIncludeString(&contents, &range));
}
« no previous file with comments | « tools/gn/c_include_iterator.cc ('k') | tools/gn/docs/reference.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698