blob: a5cb9f271530b205e6fac34c1e65b168ad7cfd5e [file] [edit]
// Part of the Crubit project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// A collection of utility functions for Gunit tests.
#ifndef CRUBIT_COMMON_TEST_UTILS_H_
#define CRUBIT_COMMON_TEST_UTILS_H_
#include <string>
#include <vector>
#include "llvm/ADT/StringRef.h"
namespace crubit {
// Writes a file for a current gunit test in a temporary directory specific to
// the current test. Returns the path of the newly written file.
std::string WriteFileForCurrentTest(llvm::StringRef filename,
llvm::StringRef content);
// Gets Clang flags for gunit tests (for example -I flag that tells Clang to
// search for headers in the temporary directory where `WriteFileForCurrentTest`
// writes files).
std::vector<std::string> DefaultClangArgs();
} // namespace crubit
#endif // CRUBIT_COMMON_TEST_UTILS_H_