File tree Expand file tree Collapse file tree
sandboxed_api/tools/clang_generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ std::vector<std::string> FrontendActionTest::GetCommandLineFlagsForTesting(
7979 " -I." , " -Wno-error" , std::string (input_file)};
8080}
8181
82+ // Replaces all newlines with spaces and removes consecutive runs of whitespace.
8283std::string Uglify (absl::string_view code) {
8384 std::string result = absl::StrReplaceAll (code, {{" \n " , " " }});
8485 absl::RemoveExtraAsciiWhitespace (&result);
Original file line number Diff line number Diff line change 3131namespace sapi {
3232namespace internal {
3333
34+ // Sets up a virtual filesystem, adds code files to it, and runs a clang tool
35+ // on it.
3436absl::Status RunClangTool (
3537 const std::vector<std::string>& command_line,
3638 const absl::flat_hash_map<std::string, std::string>& file_contents,
@@ -51,6 +53,7 @@ class FrontendActionTest : public ::testing::Test {
5153 input_file_ = std::string (value);
5254 }
5355
56+ // Returns the command line flags for the specified input file.
5457 virtual std::vector<std::string> GetCommandLineFlagsForTesting (
5558 absl::string_view input_file);
5659
@@ -76,12 +79,10 @@ class FrontendActionTest : public ::testing::Test {
7679 absl::flat_hash_map<std::string, std::string> file_contents_;
7780};
7881
79- // Flattens a piece of C++ code into one line and removes consecutive runs of
80- // whitespace. This makes it easier to compare code snippets for testing.
81- // Note: This is not syntax-aware and will replace characters within strings as
82- // well.
83- std::string Uglify (absl::string_view code);
84-
82+ // Flattens a vector of C++ code snippets into one line and removes consecutive
83+ // runs of whitespace. This makes it easier to compare code snippets for
84+ // testing. Note: This is not syntax-aware and will replace characters within
85+ // strings as well.
8586std::vector<std::string> UglifyAll (const std::vector<std::string>& snippets);
8687
8788} // namespace sapi
You can’t perform that action at this time.
0 commit comments