#ifndef UTIL_TEST_UTILS_H_
#define UTIL_TEST_UTILS_H_
#include <functional>
#include <string>
#include <vector>
#include "common/angleutils.h"
#include "util/Timer.h"
namespace angle
{
void Sleep(unsigned int milliseconds);
void SetLowPriorityProcess();
void WriteDebugMessage(const char *format, ...);
bool StabilizeCPUForBenchmarking();
CrashCallback;
void InitCrashHandler(CrashCallback *callback);
void TerminateCrashHandler();
void PrintStackBacktrace();
bool DeleteSystemFile(const char *path);
bool ReadEntireFileToString(const char *filePath, std::string *contentsOut);
bool GetFileSize(const char *filePath, uint32_t *sizeOut);
class ProcessHandle;
class Process : angle::NonCopyable
{ … };
enum class ProcessOutputCapture
{ … };
class ProcessHandle final : angle::NonCopyable
{ … };
Process *LaunchProcess(const std::vector<const char *> &args, ProcessOutputCapture captureOutput);
int NumberOfProcessors();
const char *GetNativeEGLLibraryNameWithExtension();
#if defined(ANGLE_PLATFORM_APPLE)
void InitMetalFileAPIHooking(int argc, char **argv);
#endif
enum ArgHandling
{ … };
bool ParseIntArg(const char *flag, int *argc, char **argv, int argIndex, int *valueOut);
bool ParseFlag(const char *flag, int *argc, char **argv, int argIndex, bool *flagOut);
bool ParseStringArg(const char *flag, int *argc, char **argv, int argIndex, std::string *valueOut);
bool ParseCStringArg(const char *flag, int *argc, char **argv, int argIndex, const char **valueOut);
bool ParseIntArgWithHandling(const char *flag,
int *argc,
char **argv,
int argIndex,
int *valueOut,
ArgHandling handling);
bool ParseCStringArgWithHandling(const char *flag,
int *argc,
char **argv,
int argIndex,
const char **valueOut,
ArgHandling handling);
void AddArg(int *argc, char **argv, const char *arg);
uint32_t GetPlatformANGLETypeFromArg(const char *useANGLEArg, uint32_t defaultPlatformType);
uint32_t GetANGLEDeviceTypeFromArg(const char *useANGLEArg, uint32_t defaultDeviceType);
}
#endif