1e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch// Copyright 2014 The Chromium Authors. All rights reserved.
2e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch// Use of this source code is governed by a BSD-style license that can be
3e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch// found in the LICENSE file.
4e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
5e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch#ifndef MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_
6e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch#define MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_
7e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
8010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)#include <string>
9010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)#include <vector>
10010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
11e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch#include "mojo/public/c/test_support/test_support.h"
12e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
13e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdochnamespace mojo {
14e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdochnamespace test {
15e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
16e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdochinline void LogPerfResult(const char* test_name,
17e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch                          double value,
18e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch                          const char* units) {
19e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch  MojoTestSupportLogPerfResult(test_name, value, units);
20e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch}
21e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
22010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)// Opens text file relative to the source root for reading.
23010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)inline FILE* OpenSourceRootRelativeFile(const std::string& relative_path) {
24010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  return MojoTestSupportOpenSourceRootRelativeFile(relative_path.c_str());
25010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)}
26010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
27010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)// Returns the list of regular files in a directory relative to the source root.
28010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)std::vector<std::string> EnumerateSourceRootRelativeDirectory(
29010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)    const std::string& relative_path);
30010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
31e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch}  // namespace test
32e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch}  // namespace mojo
33e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
34e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch#endif  // MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_
35