blob: 369b8441b5dcb7f7169112112d1d126d5a62482f [file] [log] [blame]
Marcel Hlopko39512852022-05-09 02:22:00 -07001// 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"
14namespace 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.
18std::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).
24std::vector<std::string> DefaultClangArgs();
25
26} // namespace crubit
Marcel Hlopko39512852022-05-09 02:22:00 -070027#endif // THIRD_PARTY_CRUBIT_COMMON_TEST_UTILS_H_