Change next_proto member type.
[chromium-blink-merge.git] / tools / gn / command_format_unittest.cc
blob1b1c08e4d3da27290308fcee3648bf61a6cad0f8
1 // Copyright 2014 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.
5 #include "base/files/file_util.h"
6 #include "base/strings/string_util.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "tools/gn/commands.h"
9 #include "tools/gn/setup.h"
11 namespace commands {
12 bool FormatFileToString(Setup* setup,
13 const SourceFile& file,
14 bool dump_tree,
15 std::string* output);
16 } // namespace commands
18 #define FORMAT_TEST(n) \
19 TEST(Format, n) { \
20 ::Setup setup; \
21 std::string out; \
22 std::string expected; \
23 EXPECT_TRUE(commands::FormatFileToString( \
24 &setup, \
25 SourceFile("//tools/gn/format_test_data/" #n ".gn"), \
26 false, \
27 &out)); \
28 ASSERT_TRUE(base::ReadFileToString( \
29 base::FilePath(FILE_PATH_LITERAL("tools/gn/format_test_data/") \
30 FILE_PATH_LITERAL(#n) \
31 FILE_PATH_LITERAL(".golden")), \
32 &expected)); \
33 EXPECT_EQ(expected, out); \
36 // These are expanded out this way rather than a runtime loop so that
37 // --gtest_filter works as expected for individual test running.
38 FORMAT_TEST(001)
39 FORMAT_TEST(002)
40 FORMAT_TEST(003)
41 FORMAT_TEST(004)
42 FORMAT_TEST(005)
43 FORMAT_TEST(006)
44 FORMAT_TEST(007)
45 FORMAT_TEST(008)
46 FORMAT_TEST(009)
47 FORMAT_TEST(010)
48 FORMAT_TEST(011)
49 FORMAT_TEST(012)
50 FORMAT_TEST(013)
51 FORMAT_TEST(014)
52 FORMAT_TEST(015)
53 FORMAT_TEST(016)
54 FORMAT_TEST(017)
55 FORMAT_TEST(018)
56 FORMAT_TEST(019)
57 FORMAT_TEST(020)
58 FORMAT_TEST(021)
59 FORMAT_TEST(022)
60 FORMAT_TEST(023)
61 FORMAT_TEST(024)
62 FORMAT_TEST(025)
63 FORMAT_TEST(026)
64 FORMAT_TEST(027)
65 FORMAT_TEST(028)
66 FORMAT_TEST(029)
67 FORMAT_TEST(030)
68 FORMAT_TEST(031)
69 FORMAT_TEST(032)
70 FORMAT_TEST(033)
71 // TODO(scottmg): args+rebase_path unnecessarily split: FORMAT_TEST(034)
72 FORMAT_TEST(035)
73 FORMAT_TEST(036)
74 FORMAT_TEST(037)
75 FORMAT_TEST(038)
76 FORMAT_TEST(039)
77 // TODO(scottmg): Bad break, exceeding 80 col: FORMAT_TEST(040)
78 FORMAT_TEST(041)
79 FORMAT_TEST(042)
80 FORMAT_TEST(043)
81 // TODO(scottmg): Dewrapped caused exceeding 80 col: FORMAT_TEST(044)
82 FORMAT_TEST(045)
83 FORMAT_TEST(046)
84 FORMAT_TEST(047)
85 FORMAT_TEST(048)
86 // TODO(scottmg): Eval is broken (!) and comment output might have extra ,
87 // FORMAT_TEST(049)
88 FORMAT_TEST(050)
89 FORMAT_TEST(051)
90 FORMAT_TEST(052)
91 FORMAT_TEST(053)
92 FORMAT_TEST(054)
93 FORMAT_TEST(055)
94 FORMAT_TEST(056)
95 FORMAT_TEST(057)
96 FORMAT_TEST(058)
97 FORMAT_TEST(059)
98 FORMAT_TEST(060)
99 FORMAT_TEST(061)