OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Support functions for running "internal" tests. These functions are not for | 5 // Support functions for running "internal" tests. These functions are not for |
6 // public consumption. | 6 // public consumption. |
7 | 7 |
8 #ifndef MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_ | 8 #ifndef MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_ |
9 #define MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_ | 9 #define MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_ |
10 | 10 |
| 11 #include <stdio.h> |
| 12 |
11 #include <string> | 13 #include <string> |
12 #include <vector> | 14 #include <vector> |
13 | 15 |
14 namespace mojo { | 16 namespace mojo { |
15 namespace test { | 17 namespace test { |
16 | 18 |
17 // Logs the result of a perf test. (|sub_test_name| is optional and may be | 19 // Logs the result of a perf test. (|sub_test_name| is optional and may be |
18 // null.) You may only call this while running inside a perf test suite. | 20 // null.) You may only call this while running inside a perf test suite. |
19 void LogPerfResult(const char* test_name, | 21 void LogPerfResult(const char* test_name, |
20 const char* sub_test_name, | 22 const char* sub_test_name, |
21 double value, | 23 double value, |
22 const char* units); | 24 const char* units); |
23 | 25 |
24 // Opens a text file given by a path relative to the source root for reading. | 26 // Opens a text file given by a path relative to the source root for reading. |
25 FILE* OpenSourceRootRelativeFile(const std::string& relative_path); | 27 FILE* OpenSourceRootRelativeFile(const std::string& relative_path); |
26 | 28 |
27 // Returns the list of regular files in a directory given by a path relative to | 29 // Returns the list of regular files in a directory given by a path relative to |
28 // the source root. (The result only includes the filenames, not the path.) | 30 // the source root. (The result only includes the filenames, not the path.) |
29 std::vector<std::string> EnumerateSourceRootRelativeDirectory( | 31 std::vector<std::string> EnumerateSourceRootRelativeDirectory( |
30 const std::string& relative_path); | 32 const std::string& relative_path); |
31 | 33 |
32 } // namespace test | 34 } // namespace test |
33 } // namespace mojo | 35 } // namespace mojo |
34 | 36 |
35 #endif // MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_ | 37 #endif // MOJO_PUBLIC_CPP_TEST_SUPPORT_TEST_SUPPORT_H_ |
OLD | NEW |