Marcel Hlopko | 3951285 | 2022-05-09 02:22:00 -0700 | [diff] [blame] | 1 | // Part of the Crubit project, under the Apache License v2.0 with LLVM |
| 2 | // Exceptions. See /LICENSE for license information. |
| 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 | |
| 5 | // A collection of utility functions for Gunit tests. |
| 6 | |
| 7 | #ifndef THIRD_PARTY_CRUBIT_COMMON_TEST_UTILS_H_ |
| 8 | #define THIRD_PARTY_CRUBIT_COMMON_TEST_UTILS_H_ |
| 9 | |
| 10 | #include <string> |
| 11 | #include <vector> |
| 12 | |
| 13 | #include "absl/strings/string_view.h" |
| 14 | namespace crubit { |
| 15 | |
| 16 | // Writes a file for a current gunit test in a temporary directory specific to |
| 17 | // the current test. Returns the path of the newly written file. |
| 18 | std::string WriteFileForCurrentTest(absl::string_view filename, |
| 19 | absl::string_view content); |
| 20 | |
| 21 | // Gets Clang flags for gunit tests (for example -I flag that tells Clang to |
| 22 | // search for headers in the temporary directory where `WriteFileForCurrentTest` |
| 23 | // writes files). |
| 24 | std::vector<std::string> DefaultClangArgs(); |
| 25 | |
| 26 | } // namespace crubit |
Marcel Hlopko | 3951285 | 2022-05-09 02:22:00 -0700 | [diff] [blame] | 27 | #endif // THIRD_PARTY_CRUBIT_COMMON_TEST_UTILS_H_ |